/* Generated by Cython 3.0.12 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "gel/pgproto/debug.h"
        ],
        "extra_compile_args": [
            "-O2",
            "-std=gnu99",
            "-fsigned-char",
            "-Wall",
            "-Wsign-compare",
            "-Wconversion",
            "-Wno-error=incompatible-pointer-types"
        ],
        "include_dirs": [
            "gel/pgproto",
            "gel/pgproto/",
            "gel/datatypes"
        ],
        "name": "gel.protocol.protocol",
        "sources": [
            "gel/protocol/protocol.pyx"
        ]
    },
    "module_name": "gel.protocol.protocol"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#if defined(CYTHON_LIMITED_API) && 0
  #ifndef Py_LIMITED_API
    #if CYTHON_LIMITED_API+0 > 0x03030000
      #define Py_LIMITED_API CYTHON_LIMITED_API
    #else
      #define Py_LIMITED_API 0x03030000
    #endif
  #endif
#endif

#include "Python.h"

    #if PY_MAJOR_VERSION >= 3
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj)
    #else
      #define __Pyx_PyFloat_FromString(obj)  PyFloat_FromString(obj, NULL)
    #endif
    

    #if PY_MAJOR_VERSION <= 2
    #define PyDict_GetItemWithError _PyDict_GetItemWithError
    #endif
    

    #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get)
    #define PyContextVar_Get(var, d, v)         ((d) ?             ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) :             ((v)[0] = NULL, 0)         )
    #endif
    
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.7+ or Python 3.3+.
#else
#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
#define __PYX_EXTRA_ABI_MODULE_NAME "limited"
#else
#define __PYX_EXTRA_ABI_MODULE_NAME ""
#endif
#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
#define CYTHON_HEX_VERSION 0x03000CF0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !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
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 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
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #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
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 1
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #endif
  #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
  #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_GIL
  #define CYTHON_FAST_GIL 0
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 0
  #endif
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef 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
  #ifndef 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_GIL
    #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #if PY_VERSION_HEX < 0x030400a1
    #undef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #elif !defined(CYTHON_USE_TP_FINALIZE)
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #if PY_VERSION_HEX < 0x030600B1
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5)
  #endif
  #if PY_VERSION_HEX < 0x030700A3
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if !defined(CYTHON_VECTORCALL)
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#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(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #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_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #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 short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #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
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

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

#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_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, 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)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, 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 *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
    #ifndef CO_OPTIMIZED
    #define CO_OPTIMIZED 0x0001
    #endif
    #ifndef CO_NEWLOCALS
    #define CO_NEWLOCALS 0x0002
    #endif
    #ifndef CO_VARARGS
    #define CO_VARARGS 0x0004
    #endif
    #ifndef CO_VARKEYWORDS
    #define CO_VARKEYWORDS 0x0008
    #endif
    #ifndef CO_ASYNC_GENERATOR
    #define CO_ASYNC_GENERATOR 0x0200
    #endif
    #ifndef CO_GENERATOR
    #define CO_GENERATOR 0x0020
    #endif
    #ifndef CO_COROUTINE
    #define CO_COROUTINE 0x0080
    #endif
#elif PY_VERSION_HEX >= 0x030B0000
  static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, 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) {
    PyCodeObject *result;
    PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
    if (!empty_bytes) return NULL;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
    Py_DECREF(empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, 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
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef CO_COROUTINE
  #define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
  #define CO_ASYNC_GENERATOR 0x200
#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 Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 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
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_MAJOR_VERSION >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x030900B1
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#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_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_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_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#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 CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
#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 PY_MAJOR_VERSION < 3
    #if CYTHON_COMPILING_IN_PYPY
        #if PYPY_VERSION_NUM < 0x07030600
            #if defined(__cplusplus) && __cplusplus >= 201402L
                [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
            #elif defined(__GNUC__) || defined(__clang__)
                __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
            #elif defined(_MSC_VER)
                __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
            #endif
            static CYTHON_INLINE int PyGILState_Check(void) {
                return 0;
            }
        #else  // PYPY_VERSION_NUM < 0x07030600
        #endif  // PYPY_VERSION_NUM < 0x07030600
    #else
        static CYTHON_INLINE int PyGILState_Check(void) {
            PyThreadState * tstate = _PyThreadState_Current;
            return tstate && (tstate == PyGILState_GetThisThreadState());
        }
    #endif
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || 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 > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
#else
  #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
#endif
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #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)         ((int)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, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #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
  #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) ? 65535U : 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((int)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] = (Py_UNICODE) 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
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#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
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_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_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#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 __Pyx_Py3Int_Check(op)       PyLong_Check(op)
  #define __Pyx_Py3Int_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
#else
  #define __Pyx_Py3Int_Check(op)       (PyLong_Check(op) || PyInt_Check(op))
  #define __Pyx_Py3Int_CheckExact(op)  (PyLong_CheckExact(op) || PyInt_CheckExact(op))
#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 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(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#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; }

#ifdef CYTHON_EXTERN_C
    #undef __PYX_EXTERN_C
    #define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
    #ifdef _MSC_VER
    #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
    #else
    #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
    #endif
#else
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__gel__protocol__protocol
#define __PYX_HAVE_API__gel__protocol__protocol
/* Early includes */
#include <string.h>
#include <stdio.h>
#include <stddef.h>
#include "pythread.h"
#include <stdint.h>
#include "debug.h"
#include "datetime.h"

    /* Backport for Python 2.x */
    #if PY_MAJOR_VERSION < 3
        #ifndef PyDateTime_DELTA_GET_DAYS
            #define PyDateTime_DELTA_GET_DAYS(o) (((PyDateTime_Delta*)o)->days)
        #endif
        #ifndef PyDateTime_DELTA_GET_SECONDS
            #define PyDateTime_DELTA_GET_SECONDS(o) (((PyDateTime_Delta*)o)->seconds)
        #endif
        #ifndef PyDateTime_DELTA_GET_MICROSECONDS
            #define PyDateTime_DELTA_GET_MICROSECONDS(o) (((PyDateTime_Delta*)o)->microseconds)
        #endif
    #endif

    /* Backport for Python < 3.6 */
    #if PY_VERSION_HEX < 0x030600a4
        #ifndef PyDateTime_TIME_GET_FOLD
            #define PyDateTime_TIME_GET_FOLD(o) ((void)(o), 0)
        #endif
        #ifndef PyDateTime_DATE_GET_FOLD
            #define PyDateTime_DATE_GET_FOLD(o) ((void)(o), 0)
        #endif
    #endif

    /* Backport for Python < 3.6 */
    #if PY_VERSION_HEX < 0x030600a4
        #define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)             ((void)(fold), PyDateTimeAPI->DateTime_FromDateAndTime(year, month, day, hour, minute, second,                 microsecond, tz, PyDateTimeAPI->DateTimeType))
        #define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)             ((void)(fold), PyDateTimeAPI->Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI->TimeType))
    #else /* For Python 3.6+ so that we can pass tz */
        #define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)             PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, minute, second,                 microsecond, tz, fold, PyDateTimeAPI->DateTimeType)
        #define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)             PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, microsecond, tz, fold, PyDateTimeAPI->TimeType)
    #endif

    /* Backport for Python < 3.7 */
    #if PY_VERSION_HEX < 0x030700b1
        #define __Pyx_TimeZone_UTC NULL
        #define __Pyx_TimeZone_FromOffsetAndName(offset, name) ((void)(offset), (void)(name), (PyObject*)NULL)
    #else
        #define __Pyx_TimeZone_UTC PyDateTime_TimeZone_UTC
        #define __Pyx_TimeZone_FromOffsetAndName(offset, name) PyTimeZone_FromOffsetAndName(offset, name)
    #endif

    /* Backport for Python < 3.10 */
    #if PY_VERSION_HEX < 0x030a00a1
        #ifndef PyDateTime_TIME_GET_TZINFO
            #define PyDateTime_TIME_GET_TZINFO(o)                 ((((PyDateTime_Time*)o)->hastzinfo) ? ((PyDateTime_Time*)o)->tzinfo : Py_None)
        #endif
        #ifndef PyDateTime_DATE_GET_TZINFO
            #define PyDateTime_DATE_GET_TZINFO(o)                 ((((PyDateTime_DateTime*)o)->hastzinfo) ? ((PyDateTime_DateTime*)o)->tzinfo : Py_None)
        #endif
    #endif
    
#include "./hton.h"
#include "datatypes.h"
#include <stdlib.h>
#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 Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#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_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __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)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#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
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#include <string.h>
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] = (char) 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
#include <string.h>
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; }

#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char *__pyx_f[] = {
  "gel/protocol/./lru.pyx",
  "gel/protocol/./codecs/./base.pyx",
  "<stringsource>",
  "gel/protocol/./codecs/./namedtuple.pyx",
  "gel/protocol/./codecs/./object.pyx",
  "gel/protocol/./codecs/./array.pyx",
  "gel/protocol/./codecs/./range.pyx",
  "gel/protocol/./codecs/codecs.pyx",
  "gel/protocol/protocol.pyx",
  ".eggs/Cython-3.0.12-py3.13-linux-x86_64.egg/Cython/Includes/cpython/contextvars.pxd",
  "gel/pgproto/./frb.pxd",
  "gel/pgproto/./buffer.pxd",
  ".eggs/Cython-3.0.12-py3.13-linux-x86_64.egg/Cython/Includes/cpython/datetime.pxd",
  "gel/protocol/./codecs/./scalar.pyx",
  "gel/protocol/./codecs/./tuple.pyx",
  "gel/protocol/./codecs/./set.pyx",
  "gel/protocol/./codecs/./enum.pyx",
  "gel/protocol/./codecs/./record.pyx",
  "gel/protocol/protocol.pxd",
  "gel/protocol/protocol_v0.pyx",
  ".eggs/Cython-3.0.12-py3.13-linux-x86_64.egg/Cython/Includes/cpython/type.pxd",
  ".eggs/Cython-3.0.12-py3.13-linux-x86_64.egg/Cython/Includes/cpython/bool.pxd",
  ".eggs/Cython-3.0.12-py3.13-linux-x86_64.egg/Cython/Includes/cpython/complex.pxd",
  "gel/datatypes/./relative_duration.pxd",
  "gel/datatypes/./date_duration.pxd",
  "gel/datatypes/./config_memory.pxd",
  "gel/protocol/./codecs/./edb_types.pxi",
};
/* #### Code section: utility_code_proto_before_types ### */
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()

/* BufferFormatStructs.proto */
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
typedef struct {
  const char* name;
  struct __Pyx_StructField_* fields;
  size_t size;
  size_t arraysize[8];
  int ndim;
  char typegroup;
  char is_unsigned;
  int flags;
} __Pyx_TypeInfo;
typedef struct __Pyx_StructField_ {
  __Pyx_TypeInfo* type;
  const char* name;
  size_t offset;
} __Pyx_StructField;
typedef struct {
  __Pyx_StructField* field;
  size_t parent_offset;
} __Pyx_BufFmt_StackElem;
typedef struct {
  __Pyx_StructField root;
  __Pyx_BufFmt_StackElem* head;
  size_t fmt_offset;
  size_t new_count, enc_count;
  size_t struct_alignment;
  int is_complex;
  char enc_type;
  char new_packmode;
  char enc_packmode;
  char is_valid_array;
} __Pyx_BufFmt_Context;

/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #pragma intrinsic (_InterlockedExchangeAdd)
    #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
#else
    #define __pyx_add_acquisition_count(memview)\
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif

/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
  struct __pyx_memoryview_obj *memview;
  char *data;
  Py_ssize_t shape[8];
  Py_ssize_t strides[8];
  Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
#define __Pyx_MemoryView_Len(m)  (m.shape[0])

/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer;
struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer;
struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext;
struct __pyx_obj_3gel_9datatypes_9datatypes_RelativeDuration;
struct __pyx_obj_3gel_9datatypes_9datatypes_DateDuration;
struct __pyx_obj_3gel_9datatypes_9datatypes_ConfigMemory;
struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping;
struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec;
struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride;
struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec;
struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec;
struct __pyx_obj_3gel_8protocol_8protocol_NullCodec;
struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec;
struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext;
struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec;
struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec;
struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec;
struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec;
struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec;
struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec;
struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec;
struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec;
struct __pyx_obj_3gel_8protocol_8protocol_SetCodec;
struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec;
struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec;
struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry;
struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext;
struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol;
struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous;
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query;
struct __pyx_obj___Pyx_EnumMeta;
struct __pyx_array_obj;
struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
struct __pyx_opt_args_7cpython_11contextvars_get_value;
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;

/* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */
struct __pyx_opt_args_7cpython_11contextvars_get_value {
  int __pyx_n;
  PyObject *default_value;
};

/* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */
struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
  int __pyx_n;
  PyObject *default_value;
};
struct __pyx_opt_args_7cpython_8datetime_time_new;
struct __pyx_opt_args_7cpython_8datetime_datetime_new;
struct __pyx_opt_args_7cpython_8datetime_timezone_new;
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp;

/* "cpython/datetime.pxd":292
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
 */
struct __pyx_opt_args_7cpython_8datetime_time_new {
  int __pyx_n;
  int fold;
};

/* "cpython/datetime.pxd":297
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
 */
struct __pyx_opt_args_7cpython_8datetime_datetime_new {
  int __pyx_n;
  int fold;
};

/* "cpython/datetime.pxd":306
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */
struct __pyx_opt_args_7cpython_8datetime_timezone_new {
  int __pyx_n;
  PyObject *name;
};

/* "cpython/datetime.pxd":312
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 */
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp {
  int __pyx_n;
  PyObject *tz;
};
struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer;
struct __pyx_opt_args_3gel_7pgproto_7pgproto_10ReadBuffer_redirect_messages;

/* "gel/pgproto/frb.pxd":10
 * cdef:
 * 
 *     struct FRBuffer:             # <<<<<<<<<<<<<<
 *         const char* buf
 *         ssize_t len
 */
struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer {
  char const *buf;
  Py_ssize_t len;
};

/* "gel/pgproto/buffer.pxd":62
 * 
 * 
 * ctypedef const char * (*try_consume_message_method)(object, ssize_t*)             # <<<<<<<<<<<<<<
 * ctypedef int32_t (*take_message_type_method)(object, char) except -1
 * ctypedef int32_t (*take_message_method)(object) except -1
 */
typedef char const *(*__pyx_t_3gel_7pgproto_7pgproto_try_consume_message_method)(PyObject *, Py_ssize_t *);

/* "gel/pgproto/buffer.pxd":63
 * 
 * ctypedef const char * (*try_consume_message_method)(object, ssize_t*)
 * ctypedef int32_t (*take_message_type_method)(object, char) except -1             # <<<<<<<<<<<<<<
 * ctypedef int32_t (*take_message_method)(object) except -1
 * ctypedef char (*get_message_type_method)(object)
 */
typedef int32_t (*__pyx_t_3gel_7pgproto_7pgproto_take_message_type_method)(PyObject *, char);

/* "gel/pgproto/buffer.pxd":64
 * ctypedef const char * (*try_consume_message_method)(object, ssize_t*)
 * ctypedef int32_t (*take_message_type_method)(object, char) except -1
 * ctypedef int32_t (*take_message_method)(object) except -1             # <<<<<<<<<<<<<<
 * ctypedef char (*get_message_type_method)(object)
 * 
 */
typedef int32_t (*__pyx_t_3gel_7pgproto_7pgproto_take_message_method)(PyObject *);

/* "gel/pgproto/buffer.pxd":65
 * ctypedef int32_t (*take_message_type_method)(object, char) except -1
 * ctypedef int32_t (*take_message_method)(object) except -1
 * ctypedef char (*get_message_type_method)(object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef char (*__pyx_t_3gel_7pgproto_7pgproto_get_message_type_method)(PyObject *);

/* "gel/pgproto/buffer.pxd":130
 *     cdef bytes consume_message(self)
 *     cdef discard_message(self)
 *     cdef int32_t redirect_messages(self, WriteBuffer buf, char mtype, int stop_at=?)             # <<<<<<<<<<<<<<
 *     cdef bytearray consume_messages(self, char mtype)
 *     cdef finish_message(self)
 */
struct __pyx_opt_args_3gel_7pgproto_7pgproto_10ReadBuffer_redirect_messages {
  int __pyx_n;
  int stop_at;
};

/* "gel/pgproto/codecs/__init__.pxd":18
 * 
 * 
 * ctypedef object (*encode_func)(CodecContext settings,             # <<<<<<<<<<<<<<
 *                                WriteBuffer buf,
 *                                object obj)
 */
typedef PyObject *(*__pyx_t_3gel_7pgproto_7pgproto_encode_func)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);

/* "gel/pgproto/codecs/__init__.pxd":22
 *                                object obj)
 * 
 * ctypedef object (*decode_func)(CodecContext settings,             # <<<<<<<<<<<<<<
 *                                FRBuffer *buf)
 * 
 */
typedef PyObject *(*__pyx_t_3gel_7pgproto_7pgproto_decode_func)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *);
struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump;
struct __pyx_opt_args_3gel_8protocol_8protocol_19CodecPythonOverride_dump;
struct __pyx_opt_args_3gel_8protocol_8protocol_20BaseNamedRecordCodec_dump;
struct __pyx_opt_args_3gel_8protocol_8protocol_10TupleCodec_dump;
struct __pyx_opt_args_3gel_8protocol_8protocol_14BaseArrayCodec_dump;
struct __pyx_opt_args_3gel_8protocol_8protocol_10RangeCodec_dump;
struct __pyx_opt_args_3gel_8protocol_8protocol_15MultiRangeCodec_dump;
struct __pyx_opt_args_3gel_8protocol_8protocol_register_base_scalar_codec;
union __pyx_t_3gel_8protocol_8protocol_IntFloatSwap;

/* "gel/protocol/protocol.pxd":43
 * 
 * 
 * cpdef enum InputLanguage:             # <<<<<<<<<<<<<<
 *     EDGEQL = 0x45  # b'E'
 *     SQL = 0x53  # b'S'
 */
enum __pyx_t_3gel_8protocol_8protocol_InputLanguage {
  __pyx_e_3gel_8protocol_8protocol_EDGEQL = 0x45,
  __pyx_e_3gel_8protocol_8protocol_SQL = 0x53
};

/* "gel/protocol/protocol.pxd":48
 * 
 * 
 * cpdef enum OutputFormat:             # <<<<<<<<<<<<<<
 *     BINARY = 98  # b'b'
 *     JSON = 106  # b'j'
 */
enum __pyx_t_3gel_8protocol_8protocol_OutputFormat {
  __pyx_e_3gel_8protocol_8protocol_BINARY = 98,
  __pyx_e_3gel_8protocol_8protocol_JSON = 0x6A,
  __pyx_e_3gel_8protocol_8protocol_JSON_ELEMENTS = 74,
  __pyx_e_3gel_8protocol_8protocol_NONE = 0x6E
};

/* "gel/protocol/protocol.pxd":55
 * 
 * 
 * cdef enum TransactionStatus:             # <<<<<<<<<<<<<<
 *     TRANS_IDLE = 0                 # connection idle
 *     TRANS_ACTIVE = 1               # command in progress
 */
enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus {
  __pyx_e_3gel_8protocol_8protocol_TRANS_IDLE = 0,
  __pyx_e_3gel_8protocol_8protocol_TRANS_ACTIVE = 1,
  __pyx_e_3gel_8protocol_8protocol_TRANS_INTRANS = 2,
  __pyx_e_3gel_8protocol_8protocol_TRANS_INERROR = 3,
  __pyx_e_3gel_8protocol_8protocol_TRANS_UNKNOWN = 4
};

/* "gel/protocol/protocol.pxd":63
 * 
 * 
 * cdef enum EdgeParseFlags:             # <<<<<<<<<<<<<<
 *     PARSE_HAS_RESULT = 1 << 0
 *     PARSE_SINGLETON_RESULT = 1 << 1
 */
enum __pyx_t_3gel_8protocol_8protocol_EdgeParseFlags {

  /* "gel/protocol/protocol.pxd":65
 * cdef enum EdgeParseFlags:
 *     PARSE_HAS_RESULT = 1 << 0
 *     PARSE_SINGLETON_RESULT = 1 << 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_e_3gel_8protocol_8protocol_PARSE_HAS_RESULT = (1 << 0),
  __pyx_e_3gel_8protocol_8protocol_PARSE_SINGLETON_RESULT = (1 << 1)
};

/* "gel/protocol/protocol.pxd":68
 * 
 * 
 * cdef enum AuthenticationStatuses:             # <<<<<<<<<<<<<<
 *     AUTH_OK = 0
 *     AUTH_SASL = 10
 */
enum __pyx_t_3gel_8protocol_8protocol_AuthenticationStatuses {
  __pyx_e_3gel_8protocol_8protocol_AUTH_OK = 0,
  __pyx_e_3gel_8protocol_8protocol_AUTH_SASL = 10,
  __pyx_e_3gel_8protocol_8protocol_AUTH_SASL_CONTINUE = 11,
  __pyx_e_3gel_8protocol_8protocol_AUTH_SASL_FINAL = 12
};

/* "gel/protocol/codecs/base.pxd":33
 *     cdef decode(self, FRBuffer *buf)
 * 
 *     cdef dump(self, int level=?)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump {
  int __pyx_n;
  int level;
};

/* "gel/protocol/protocol.pxd":40
 * 
 * 
 * ctypedef object (*decode_row_method)(BaseCodec, FRBuffer *buf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef PyObject *(*__pyx_t_3gel_8protocol_8protocol_decode_row_method)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *);

/* "gel/protocol/codecs/base.pyx":71
 *         return self.decoder(self.codec.decode(buf))
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}<Python override>{self.name}'
 * 
 */
struct __pyx_opt_args_3gel_8protocol_8protocol_19CodecPythonOverride_dump {
  int __pyx_n;
  int level;
};

/* "gel/protocol/codecs/base.pyx":220
 *         self.descriptor = None
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         buf = [f'{level * " "}{self.name}']
 *         for pos, codec in enumerate(self.fields_codecs):
 */
struct __pyx_opt_args_3gel_8protocol_8protocol_20BaseNamedRecordCodec_dump {
  int __pyx_n;
  int level;
};

/* "gel/protocol/codecs/tuple.pyx":62
 *         return result
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         buf = [f'{level * " "}{self.name}']
 *         for codec in self.fields_codecs:
 */
struct __pyx_opt_args_3gel_8protocol_8protocol_10TupleCodec_dump {
  int __pyx_n;
  int level;
};

/* "gel/protocol/codecs/array.pyx":136
 *         return result
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */
struct __pyx_opt_args_3gel_8protocol_8protocol_14BaseArrayCodec_dump {
  int __pyx_n;
  int level;
};

/* "gel/protocol/codecs/range.pyx":147
 *         return RangeCodec.decode_range(buf, self.sub_codec)
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */
struct __pyx_opt_args_3gel_8protocol_8protocol_10RangeCodec_dump {
  int __pyx_n;
  int level;
};

/* "gel/protocol/codecs/range.pyx":248
 *         return range_mod.MultiRange(result)
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */
struct __pyx_opt_args_3gel_8protocol_8protocol_15MultiRangeCodec_dump {
  int __pyx_n;
  int level;
};

/* "gel/protocol/codecs/codecs.pyx":572
 * 
 * 
 * cdef register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         str name,
 *         pgproto.encode_func encoder,
 */
struct __pyx_opt_args_3gel_8protocol_8protocol_register_base_scalar_codec {
  int __pyx_n;
  PyObject *tid;
};

/* "gel/protocol/codecs/codecs.pyx":835
 * 
 * # Needed to perform bit manipulations to convert from float16 to float32
 * cdef union IntFloatSwap:             # <<<<<<<<<<<<<<
 *     uint32_t i
 *     float f
 */
union __pyx_t_3gel_8protocol_8protocol_IntFloatSwap {
  uint32_t i;
  float f;
};

/* "gel/pgproto/buffer.pxd":8
 * 
 * 
 * cdef class WriteBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Preallocated small buffer
 */
struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_vtab;
  int _smallbuf_inuse;
  char _smallbuf[0x400];
  char *_buf;
  Py_ssize_t _size;
  Py_ssize_t _length;
  int _view_count;
  int _message_mode;
};


/* "gel/pgproto/buffer.pxd":68
 * 
 * 
 * cdef class ReadBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # A deque of buffers (bytes objects)
 */
struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer {
  PyObject_HEAD
  struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_vtab;
  PyObject *_bufs;
  PyObject *_bufs_append;
  PyObject *_bufs_popleft;
  PyObject *_buf0;
  PyObject *_buf0_prev;
  int32_t _bufs_len;
  Py_ssize_t _pos0;
  Py_ssize_t _len0;
  Py_ssize_t _length;
  char _current_message_type;
  int32_t _current_message_len;
  Py_ssize_t _current_message_len_unread;
  int _current_message_ready;
};


/* "gel/pgproto/codecs/__init__.pxd":8
 * 
 * 
 * cdef class CodecContext:             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_text_codec(self)
 */
struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_CodecContext *__pyx_vtab;
};


/* "gel/datatypes/relative_duration.pxd":24
 * 
 * @cython.final
 * cdef class RelativeDuration:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_9datatypes_9datatypes_RelativeDuration {
  PyObject_HEAD
  int64_t microseconds;
  int32_t days;
  int32_t months;
};


/* "gel/datatypes/date_duration.pxd":24
 * 
 * @cython.final
 * cdef class DateDuration:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_9datatypes_9datatypes_DateDuration {
  PyObject_HEAD
  int32_t days;
  int32_t months;
};


/* "gel/datatypes/config_memory.pxd":24
 * 
 * @cython.final
 * cdef class ConfigMemory:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_9datatypes_9datatypes_ConfigMemory {
  PyObject_HEAD
  int64_t _bytes;
};


/* "gel/protocol/lru.pxd":20
 * 
 * 
 * cdef class LRUMapping:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping {
  PyObject_HEAD
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_LRUMapping *__pyx_vtab;
  PyObject *_dict;
  int _maxsize;
  PyObject *_dict_move_to_end;
  PyObject *_dict_get;
};


/* "gel/protocol/codecs/base.pxd":20
 * 
 * 
 * cdef class BaseCodec:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec {
  PyObject_HEAD
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *__pyx_vtab;
  PyObject *tid;
  PyObject *name;
  PyObject *type_name;
};


/* "gel/protocol/codecs/base.pxd":36
 * 
 * 
 * cdef class CodecPythonOverride(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *codec;
  PyObject *encoder;
  PyObject *decoder;
};


/* "gel/protocol/codecs/base.pxd":50
 * 
 * 
 * cdef class BaseRecordCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  PyObject *fields_codecs;
  uint64_t encoder_flags;
};


/* "gel/protocol/codecs/base.pxd":59
 * 
 * 
 * cdef class EmptyTupleCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  PyObject *empty_tup;
};


/* "gel/protocol/codecs/base.pxd":65
 * 
 * 
 * cdef class NullCodec(BaseCodec):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_3gel_8protocol_8protocol_NullCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
};


/* "gel/protocol/codecs/base.pxd":69
 * 
 * 
 * cdef class BaseNamedRecordCodec(BaseRecordCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec __pyx_base;
  PyObject *descriptor;
};


/* "gel/protocol/codecs/base.pxd":76
 * 
 * @cython.final
 * cdef class EdegDBCodecContext(pgproto.CodecContext):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext {
  struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext __pyx_base;
  PyObject *_codec;
};


/* "gel/protocol/codecs/scalar.pxd":21
 * 
 * @cython.final
 * cdef class ScalarCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  __pyx_t_3gel_7pgproto_7pgproto_encode_func c_encoder;
  __pyx_t_3gel_7pgproto_7pgproto_decode_func c_decoder;
  struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *base_codec;
};


/* "gel/protocol/codecs/tuple.pxd":21
 * 
 * @cython.final
 * cdef class TupleCodec(BaseRecordCodec):             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec __pyx_base;
};


/* "gel/protocol/codecs/namedtuple.pxd":21
 * 
 * @cython.final
 * cdef class NamedTupleCodec(BaseNamedRecordCodec):             # <<<<<<<<<<<<<<
 *     cdef object namedtuple_type
 * 
 */
struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_base;
  PyObject *namedtuple_type;
};


/* "gel/protocol/codecs/object.pxd":21
 * 
 * @cython.final
 * cdef class ObjectCodec(BaseNamedRecordCodec):             # <<<<<<<<<<<<<<
 *     cdef:
 *         bint is_sparse
 */
struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_base;
  int is_sparse;
  PyObject *cached_dataclass_fields;
};


/* "gel/protocol/codecs/array.pxd":20
 * 
 * 
 * cdef class BaseArrayCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *sub_codec;
  int32_t cardinality;
};


/* "gel/protocol/codecs/array.pxd":30
 * 
 * @cython.final
 * cdef class ArrayCodec(BaseArrayCodec):             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec __pyx_base;
};


/* "gel/protocol/codecs/range.pxd":21
 * 
 * @cython.final
 * cdef class RangeCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *sub_codec;
};


/* "gel/protocol/codecs/range.pxd":37
 * 
 * @cython.final
 * cdef class MultiRangeCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *sub_codec;
};


/* "gel/protocol/codecs/set.pxd":21
 * 
 * @cython.final
 * cdef class SetCodec(BaseArrayCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _decode_array_set(self, FRBuffer *buf)
 */
struct __pyx_obj_3gel_8protocol_8protocol_SetCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec __pyx_base;
};


/* "gel/protocol/codecs/enum.pxd":21
 * 
 * @cython.final
 * cdef class EnumCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  PyObject *cls;
};


/* "gel/protocol/codecs/record.pxd":21
 * 
 * @cython.final
 * cdef class RecordCodec(BaseNamedRecordCodec):             # <<<<<<<<<<<<<<
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple names, tuple codecs)
 */
struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_base;
};


/* "gel/protocol/codecs/codecs.pxd":32
 * 
 * 
 * cdef class CodecsRegistry:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry {
  PyObject_HEAD
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *__pyx_vtab;
  struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *codecs_build_cache;
  struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *codecs;
  PyObject *base_codec_overrides;
};


/* "gel/protocol/protocol.pxd":75
 * 
 * 
 * cdef class ExecuteContext:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Input arguments
 */
struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_ExecuteContext *__pyx_vtab;
  PyObject *query;
  PyObject *args;
  PyObject *kwargs;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *reg;
  struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *qc;
  enum __pyx_t_3gel_8protocol_8protocol_InputLanguage input_language;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat output_format;
  int expect_one;
  int required_one;
  int implicit_limit;
  int inline_typenames;
  int inline_typeids;
  uint64_t allow_capabilities;
  PyObject *state;
  PyObject *annotations;
  PyObject *cardinality;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *in_dc;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *out_dc;
  uint64_t capabilities;
  PyObject *warnings;
};


/* "gel/protocol/protocol.pxd":106
 * 
 * 
 * cdef class SansIOProtocol:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol {
  PyObject_HEAD
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *__pyx_vtab;
  struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *buffer;
  int connected;
  int cancelled;
  PyObject *con;
  PyObject *con_params;
  PyObject *backend_secret;
  enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus xact_status;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *internal_reg;
  PyObject *server_settings;
  PyObject *last_status;
  PyObject *last_details;
  PyObject *last_capabilities;
  PyObject *protocol_version;
  int is_legacy;
  PyObject *state_type_id;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *state_codec;
  PyObject *state_cache;
};


/* "gel/protocol/protocol_v0.pxd":19
 * #
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):             # <<<<<<<<<<<<<<
 *     cdef parse_legacy_describe_type_message(self, CodecsRegistry reg)
 *     cdef parse_legacy_command_complete_message(self)
 */
struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible {
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol __pyx_base;
};


/* "gel/protocol/codecs/tuple.pyx":81
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type {
  PyObject_HEAD
  PyObject *__pyx_v_describe_context;
};


/* "gel/protocol/codecs/tuple.pyx":86
 *             name=self.type_name,
 *             element_types=tuple(
 *                 codec.make_type(describe_context)             # <<<<<<<<<<<<<<
 *                 for codec in self.fields_codecs
 *             )
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *__pyx_outer_scope;
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_codec;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
};


/* "gel/protocol/codecs/enum.pyx":67
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 *             members=tuple(x.value for x in self.cls.__members__.values())             # <<<<<<<<<<<<<<
 *         )
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  PyObject *__pyx_genexpr_arg_0;
  PyObject *__pyx_v_x;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
};


/* "gel/protocol/protocol.pyx":211
 *         raise NotImplementedError
 * 
 *     async def wait_for_message(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message {
  PyObject_HEAD
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":214
 *         raise NotImplementedError
 * 
 *     async def try_recv_eagerly(self):             # <<<<<<<<<<<<<<
 *         # If there's data in the socket try reading it into the
 *         # buffer.  Needed for blocking-io connections.
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly {
  PyObject_HEAD
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":219
 *         raise NotImplementedError
 * 
 *     async def wait_for_connect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect {
  PyObject_HEAD
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":222
 *         raise NotImplementedError
 * 
 *     async def wait_for_disconnect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect {
  PyObject_HEAD
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":302
 *         return buf
 * 
 *     async def _parse(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf, params
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse {
  PyObject_HEAD
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx;
  PyObject *__pyx_v_exc;
  PyObject *__pyx_v_in_type_id;
  PyObject *__pyx_v_methname;
  char __pyx_v_mtype;
  PyObject *__pyx_v_out_type_id;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_params;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
  int16_t __pyx_v_type_size;
};


/* "gel/protocol/protocol.pyx":365
 *                 f'does not return any data')
 * 
 *     async def _execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute {
  PyObject_HEAD
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_exc;
  char __pyx_v_mtype;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_params;
  PyObject *__pyx_v_result;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":484
 *             return NULL_CODEC_ID, EMPTY_NULL_DATA
 * 
 *     async def execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         self.ensure_connected()
 *         self.reset_status()
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute {
  PyObject_HEAD
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":504
 *         return await self._execute(ctx)
 * 
 *     async def query(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query {
  PyObject_HEAD
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx;
  PyObject *__pyx_v_methname;
  PyObject *__pyx_v_ret;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":533
 *                     return ret
 * 
 *     async def dump(self, header_callback, block_callback):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump {
  PyObject_HEAD
  PyObject *__pyx_v_block_callback;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  int __pyx_v_data_received;
  PyObject *__pyx_v_exc;
  PyObject *__pyx_v_header_callback;
  int __pyx_v_header_received;
  char __pyx_v_mtype;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":605
 *             raise exc
 * 
 *     async def _sync(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync {
  PyObject_HEAD
  char __pyx_v_mtype;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":619
 *                 self.fallthrough()
 * 
 *     async def ping(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping {
  PyObject_HEAD
  PyObject *__pyx_v_exc;
  char __pyx_v_mtype;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
};


/* "gel/protocol/protocol.pyx":640
 *             raise exc
 * 
 *     async def restore(self, bytes header, data_gen):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore {
  PyObject_HEAD
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  PyObject *__pyx_v_data;
  PyObject *__pyx_v_data_gen;
  PyObject *__pyx_v_exc;
  PyObject *__pyx_v_header;
  char __pyx_v_mtype;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
  PyObject *__pyx_t_0;
};


/* "gel/protocol/protocol.pyx":731
 *             pass
 * 
 *     async def connect(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer ver_buf
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect {
  PyObject_HEAD
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_handshake_buf;
  PyObject *__pyx_v_k;
  int16_t __pyx_v_major;
  int16_t __pyx_v_minor;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg_buf;
  char __pyx_v_mtype;
  PyObject *__pyx_v_params;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
  int32_t __pyx_v_status;
  PyObject *__pyx_v_v;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_ver_buf;
};


/* "gel/protocol/protocol.pyx":829
 *             self.buffer.finish_message()
 * 
 *     async def _auth_sasl(self):             # <<<<<<<<<<<<<<
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl {
  PyObject_HEAD
  PyObject *__pyx_v_client_final;
  PyObject *__pyx_v_client_first;
  PyObject *__pyx_v_client_first_bare;
  PyObject *__pyx_v_client_nonce;
  PyObject *__pyx_v_exc;
  PyObject *__pyx_v_expected_server_sig;
  int32_t __pyx_v_i;
  PyObject *__pyx_v_itercount;
  PyObject *__pyx_v_method;
  PyObject *__pyx_v_methods;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_msg_buf;
  char __pyx_v_mtype;
  int32_t __pyx_v_num_methods;
  PyObject *__pyx_v_salt;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self;
  PyObject *__pyx_v_server_final;
  PyObject *__pyx_v_server_first;
  PyObject *__pyx_v_server_nonce;
  PyObject *__pyx_v_server_sig;
  int32_t __pyx_v_status;
};


/* "gel/protocol/protocol_v0.pyx":32
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):
 *     async def _legacy_parse(             # <<<<<<<<<<<<<<
 *         self,
 *         query: str,
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse {
  PyObject_HEAD
  PyObject *__pyx_v__;
  PyObject *__pyx_v_allow_capabilities;
  PyObject *__pyx_v_attrs;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  PyObject *__pyx_v_cardinality;
  PyObject *__pyx_v_exc;
  PyObject *__pyx_v_expect_one;
  PyObject *__pyx_v_implicit_limit;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc;
  PyObject *__pyx_v_in_type_id;
  PyObject *__pyx_v_inline_typeids;
  PyObject *__pyx_v_inline_typenames;
  PyObject *__pyx_v_methname;
  char __pyx_v_mtype;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc;
  PyObject *__pyx_v_out_type_id;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format;
  PyObject *__pyx_v_query;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg;
  PyObject *__pyx_v_required_one;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self;
  int16_t __pyx_v_type_size;
};


/* "gel/protocol/protocol_v0.pyx":156
 *         return cardinality, in_dc, out_dc, attrs
 * 
 *     async def _legacy_execute(             # <<<<<<<<<<<<<<
 *         self, BaseCodec in_dc, BaseCodec out_dc, args, kwargs
 *     ):
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute {
  PyObject_HEAD
  PyObject *__pyx_v_args;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_exc;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc;
  PyObject *__pyx_v_kwargs;
  char __pyx_v_mtype;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet;
  PyObject *__pyx_v_result;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self;
};


/* "gel/protocol/protocol_v0.pyx":228
 *         return result
 * 
 *     async def _legacy_optimistic_execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute {
  PyObject_HEAD
  uint64_t __pyx_v_allow_capabilities;
  PyObject *__pyx_v_args;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  PyObject *__pyx_v_capabilities;
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx;
  PyObject *__pyx_v_ex;
  PyObject *__pyx_v_exc;
  int __pyx_v_expect_one;
  PyObject *__pyx_v_headers;
  int __pyx_v_implicit_limit;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc;
  int __pyx_v_inline_typeids;
  int __pyx_v_inline_typenames;
  PyObject *__pyx_v_kwargs;
  PyObject *__pyx_v_methname;
  char __pyx_v_mtype;
  PyObject *__pyx_v_new_cardinality;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_packet;
  PyObject *__pyx_v_query;
  int __pyx_v_re_exec;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg;
  int __pyx_v_required_one;
  PyObject *__pyx_v_result;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self;
};


/* "gel/protocol/protocol_v0.pyx":348
 *             return result
 * 
 *     async def legacy_execute_anonymous(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             BaseCodec in_dc
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous {
  PyObject_HEAD
  uint64_t __pyx_v_allow_capabilities;
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_capabilities;
  PyObject *__pyx_v_cardinality;
  PyObject *__pyx_v_codecs;
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx;
  int __pyx_v_expect_one;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_headers;
  int __pyx_v_implicit_limit;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc;
  int __pyx_v_inline_typeids;
  int __pyx_v_inline_typenames;
  PyObject *__pyx_v_kwargs;
  PyObject *__pyx_v_methname;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format;
  PyObject *__pyx_v_query;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg;
  int __pyx_v_required_one;
  PyObject *__pyx_v_ret;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self;
};


/* "gel/protocol/protocol_v0.pyx":434
 *                     return ret
 * 
 *     async def legacy_simple_query(             # <<<<<<<<<<<<<<
 *         self, str query, capabilities: enums.Capability
 *     ):
 */
struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query {
  PyObject_HEAD
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf;
  PyObject *__pyx_v_cap_bytes;
  PyObject *__pyx_v_capabilities;
  PyObject *__pyx_v_exc;
  char __pyx_v_mtype;
  PyObject *__pyx_v_query;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self;
};


/* "EnumBase":16
 * 
 * @cython.internal
 * cdef class __Pyx_EnumMeta(type):             # <<<<<<<<<<<<<<
 *     def __init__(cls, name, parents, dct):
 *         type.__init__(cls, name, parents, dct)
 */
struct __pyx_obj___Pyx_EnumMeta {
  PyHeapTypeObject __pyx_base;
};


/* "View.MemoryView":114
 * @cython.collection_type("sequence")
 * @cname("__pyx_array")
 * cdef class array:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
struct __pyx_array_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_array *__pyx_vtab;
  char *data;
  Py_ssize_t len;
  char *format;
  int ndim;
  Py_ssize_t *_shape;
  Py_ssize_t *_strides;
  Py_ssize_t itemsize;
  PyObject *mode;
  PyObject *_format;
  void (*callback_free_data)(void *);
  int free_data;
  int dtype_is_object;
};


/* "View.MemoryView":302
 * 
 * @cname('__pyx_MemviewEnum')
 * cdef class Enum(object):             # <<<<<<<<<<<<<<
 *     cdef object name
 *     def __init__(self, name):
 */
struct __pyx_MemviewEnum_obj {
  PyObject_HEAD
  PyObject *name;
};


/* "View.MemoryView":337
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview:             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */
struct __pyx_memoryview_obj {
  PyObject_HEAD
  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
  PyObject *obj;
  PyObject *_size;
  PyObject *_array_interface;
  PyThread_type_lock lock;
  __pyx_atomic_int_type acquisition_count;
  Py_buffer view;
  int flags;
  int dtype_is_object;
  __Pyx_TypeInfo *typeinfo;
};


/* "View.MemoryView":952
 * @cython.collection_type("sequence")
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */
struct __pyx_memoryviewslice_obj {
  struct __pyx_memoryview_obj __pyx_base;
  __Pyx_memviewslice from_slice;
  PyObject *from_object;
  PyObject *(*to_object_func)(char *);
  int (*to_dtype_func)(char *, PyObject *);
};



/* "gel/pgproto/buffer.pxd":8
 * 
 * 
 * cdef class WriteBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # Preallocated small buffer
 */

struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer {
  PyObject *(*len)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*write_len_prefixed_utf8)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*_check_readonly)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*_ensure_alloced)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t);
  PyObject *(*_reallocate)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, Py_ssize_t);
  PyObject *(*reset)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*start_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, char);
  PyObject *(*end_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*write_buffer)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*write_byte)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, char);
  PyObject *(*write_bytes)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*write_len_prefixed_buffer)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*write_len_prefixed_bytes)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*write_bytestring)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*write_str)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *, PyObject *);
  PyObject *(*write_frbuf)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*write_cstr)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, char const *, Py_ssize_t);
  PyObject *(*write_int16)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, int16_t);
  PyObject *(*write_int32)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, int32_t);
  PyObject *(*write_int64)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, int64_t);
  PyObject *(*write_float)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, float);
  PyObject *(*write_double)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, double);
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *(*new_message)(char);
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *(*new)(void);
};
static struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer;
static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);


/* "gel/pgproto/buffer.pxd":68
 * 
 * 
 * cdef class ReadBuffer:             # <<<<<<<<<<<<<<
 *     cdef:
 *         # A deque of buffers (bytes objects)
 */

struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer {
  PyObject *(*len)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  char (*get_message_type)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*get_message_length)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*feed_data)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, PyObject *);
  PyObject *(*_ensure_first_buf)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*_switch_to_next_buf)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  char (*read_byte)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  char const *(*_try_read_bytes)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t);
  PyObject *(*_read_into)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, char *, Py_ssize_t);
  PyObject *(*_read_and_discard)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t);
  PyObject *(*read_bytes)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t);
  PyObject *(*read_len_prefixed_bytes)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*read_len_prefixed_utf8)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*read_uuid)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  int64_t (*read_int64)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*read_int32)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  int16_t (*read_int16)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*read_null_str)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*take_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*take_message_type)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, char);
  int32_t (*put_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  char const *(*try_consume_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, Py_ssize_t *);
  PyObject *(*consume_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*discard_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  int32_t (*redirect_messages)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, char, struct __pyx_opt_args_3gel_7pgproto_7pgproto_10ReadBuffer_redirect_messages *__pyx_optional_args);
  PyObject *(*consume_messages)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *, char);
  PyObject *(*finish_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  PyObject *(*_finish_message)(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
  struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *(*new_message_parser)(PyObject *);
};
static struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_vtabptr_3gel_7pgproto_7pgproto_ReadBuffer;
static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
static CYTHON_INLINE char __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);
static CYTHON_INLINE int32_t __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *);


/* "gel/pgproto/codecs/__init__.pxd":8
 * 
 * 
 * cdef class CodecContext:             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_text_codec(self)
 */

struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_CodecContext {
  PyObject *(*get_text_codec)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch);
  PyObject *(*is_encoding_utf8)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *);
  PyObject *(*get_json_decoder)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch);
  PyObject *(*is_decoding_json)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *);
  PyObject *(*get_json_encoder)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch);
  PyObject *(*is_encoding_json)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *);
};
static struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_CodecContext *__pyx_vtabptr_3gel_7pgproto_7pgproto_CodecContext;


/* "gel/protocol/lru.pyx":26
 * 
 * 
 * cdef class LRUMapping:             # <<<<<<<<<<<<<<
 * 
 *     # We use an OrderedDict for LRU implementation.  Operations:
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_LRUMapping {
  PyObject *(*get)(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_LRUMapping *__pyx_vtabptr_3gel_8protocol_8protocol_LRUMapping;


/* "gel/protocol/codecs/base.pyx":35
 * 
 * 
 * cdef class BaseCodec:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec {
  PyObject *(*get_tid)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);
  PyObject *(*encode)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*decode)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *);
  PyObject *(*dump)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_get_tid(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);


/* "gel/protocol/codecs/base.pyx":58
 * 
 * 
 * cdef class CodecPythonOverride(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecPythonOverride {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_vtabptr_3gel_8protocol_8protocol_CodecPythonOverride;


/* "gel/protocol/codecs/base.pyx":142
 * 
 * 
 * cdef class BaseRecordCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseRecordCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  PyObject *(*_check_encoder)(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_vtabptr_3gel_8protocol_8protocol_BaseRecordCodec;


/* "gel/protocol/codecs/base.pyx":95
 * 
 * 
 * cdef class EmptyTupleCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_EmptyTupleCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_vtabptr_3gel_8protocol_8protocol_EmptyTupleCodec;


/* "gel/protocol/codecs/base.pyx":132
 * 
 * 
 * cdef class NullCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_NullCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_NullCodec *__pyx_vtabptr_3gel_8protocol_8protocol_NullCodec;


/* "gel/protocol/codecs/base.pyx":215
 * 
 * 
 * cdef class BaseNamedRecordCodec(BaseRecordCodec):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseNamedRecordCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseRecordCodec __pyx_base;
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_vtabptr_3gel_8protocol_8protocol_BaseNamedRecordCodec;


/* "gel/protocol/codecs/base.pyx":312
 * 
 * @cython.final
 * cdef class EdegDBCodecContext(pgproto.CodecContext):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_EdegDBCodecContext {
  struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_CodecContext __pyx_base;
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_vtabptr_3gel_8protocol_8protocol_EdegDBCodecContext;


/* "gel/protocol/codecs/scalar.pyx":21
 * 
 * @cython.final
 * cdef class ScalarCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_ScalarCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  PyObject *(*derive)(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *, PyObject *);
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, PyObject *, __pyx_t_3gel_7pgproto_7pgproto_encode_func, __pyx_t_3gel_7pgproto_7pgproto_decode_func);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_ScalarCodec *__pyx_vtabptr_3gel_8protocol_8protocol_ScalarCodec;
static PyObject *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_derive(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *, PyObject *);
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_new(PyObject *, PyObject *, __pyx_t_3gel_7pgproto_7pgproto_encode_func, __pyx_t_3gel_7pgproto_7pgproto_decode_func);


/* "gel/protocol/codecs/tuple.pyx":21
 * 
 * @cython.final
 * cdef class TupleCodec(BaseRecordCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_TupleCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseRecordCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_TupleCodec *__pyx_vtabptr_3gel_8protocol_8protocol_TupleCodec;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10TupleCodec_new(PyObject *, PyObject *);


/* "gel/protocol/codecs/namedtuple.pyx":21
 * 
 * @cython.final
 * cdef class NamedTupleCodec(BaseNamedRecordCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_NamedTupleCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_vtabptr_3gel_8protocol_8protocol_NamedTupleCodec;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_15NamedTupleCodec_new(PyObject *, PyObject *, PyObject *);


/* "gel/protocol/codecs/object.pyx":32
 * 
 * @cython.final
 * cdef class ObjectCodec(BaseNamedRecordCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_ObjectCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_base;
  PyObject *(*encode_args)(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_ObjectCodec *__pyx_vtabptr_3gel_8protocol_8protocol_ObjectCodec;
static PyObject *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_encode_args(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_new(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int);


/* "gel/protocol/codecs/array.pyx":25
 * 
 * 
 * cdef class BaseArrayCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     # Base codec for arrays & sets.
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseArrayCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  PyObject *(*_decode_array)(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_vtabptr_3gel_8protocol_8protocol_BaseArrayCodec;
static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec__decode_array(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *);


/* "gel/protocol/codecs/array.pyx":141
 * 
 * @cython.final
 * cdef class ArrayCodec(BaseArrayCodec):             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_ArrayCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseArrayCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, int32_t);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_ArrayCodec *__pyx_vtabptr_3gel_8protocol_8protocol_ArrayCodec;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10ArrayCodec_new(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, int32_t);


/* "gel/protocol/codecs/range.pyx":31
 * 
 * @cython.final
 * cdef class RangeCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_RangeCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);
  PyObject *(*encode_range)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);
  PyObject *(*decode_range)(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_RangeCodec *__pyx_vtabptr_3gel_8protocol_8protocol_RangeCodec;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_new(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);
static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode_range(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);
static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode_range(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);


/* "gel/protocol/codecs/range.pyx":159
 * 
 * @cython.final
 * cdef class MultiRangeCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_MultiRangeCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_vtabptr_3gel_8protocol_8protocol_MultiRangeCodec;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_new(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);


/* "gel/protocol/codecs/set.pyx":21
 * 
 * @cython.final
 * cdef class SetCodec(BaseArrayCodec):             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_SetCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseArrayCodec __pyx_base;
  PyObject *(*_decode_array_set)(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *);
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_SetCodec *__pyx_vtabptr_3gel_8protocol_8protocol_SetCodec;
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_8SetCodec__decode_array_set(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *);
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_8SetCodec_new(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *);


/* "gel/protocol/codecs/enum.pyx":23
 * 
 * @cython.final
 * cdef class EnumCodec(BaseCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_EnumCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_EnumCodec *__pyx_vtabptr_3gel_8protocol_8protocol_EnumCodec;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_9EnumCodec_new(PyObject *, PyObject *);


/* "gel/protocol/codecs/record.pyx":21
 * 
 * @cython.final
 * cdef class RecordCodec(BaseNamedRecordCodec):             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_RecordCodec {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_base;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*new)(PyObject *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_RecordCodec *__pyx_vtabptr_3gel_8protocol_8protocol_RecordCodec;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11RecordCodec_new(PyObject *, PyObject *, PyObject *);


/* "gel/protocol/codecs/codecs.pyx":72
 * 
 * 
 * cdef class CodecsRegistry:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, *, cache_size=1000):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*_build_codec)(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, PyObject *, PyObject *);
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*build_codec)(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, PyObject *, PyObject *);
  PyObject *(*has_codec)(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, PyObject *);
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*get_codec)(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, PyObject *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *__pyx_vtabptr_3gel_8protocol_8protocol_CodecsRegistry;


/* "gel/protocol/protocol.pyx":94
 * 
 * 
 * cdef class ExecuteContext:             # <<<<<<<<<<<<<<
 *     def __init__(
 *         self,
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_ExecuteContext {
  int (*has_na_cardinality)(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *);
  int (*load_from_cache)(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *);
  PyObject *(*store_to_cache)(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_ExecuteContext *__pyx_vtabptr_3gel_8protocol_8protocol_ExecuteContext;
static CYTHON_INLINE int __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_has_na_cardinality(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *);
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14ExecuteContext_store_to_cache(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *);


/* "gel/protocol/protocol.pyx":170
 * 
 * 
 * cdef class SansIOProtocol:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, con_params):
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol {
  PyObject *(*encode_args)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *, PyObject *);
  PyObject *(*encode_state)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, PyObject *);
  PyObject *(*parse_data_messages)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, PyObject *);
  PyObject *(*parse_sync_message)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*parse_command_complete_message)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*parse_describe_type_message)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *);
  PyObject *(*parse_describe_state_message)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*parse_type_data)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *);
  PyObject *(*_amend_parse_error)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, PyObject *, enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, int, int);
  PyObject *(*ignore_headers)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*read_headers)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*parse_error_headers)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*write_annotations)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*parse_error_message)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*write)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *);
  PyObject *(*abort)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, int __pyx_skip_dispatch);
  PyObject *(*reset_status)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*parse_system_config)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, PyObject *);
  PyObject *(*parse_server_settings)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, PyObject *, PyObject *);
  PyObject *(*fallthrough)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  PyObject *(*ensure_connected)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *(*encode_parse_params)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *__pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocol;
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_read_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *);


/* "gel/protocol/protocol_v0.pyx":31
 * 
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):             # <<<<<<<<<<<<<<
 *     async def _legacy_parse(
 *         self,
 */

struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible {
  struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol __pyx_base;
  PyObject *(*parse_legacy_describe_type_message)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *);
  PyObject *(*parse_legacy_command_complete_message)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *);
  PyObject *(*legacy_write_headers)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *);
  PyObject *(*legacy_write_execute_headers)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, int, int, int, uint64_t);
  PyObject *(*legacy_parse_headers)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *);
};
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible;


/* "View.MemoryView":114
 * @cython.collection_type("sequence")
 * @cname("__pyx_array")
 * cdef class array:             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */

struct __pyx_vtabstruct_array {
  PyObject *(*get_memview)(struct __pyx_array_obj *);
};
static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;


/* "View.MemoryView":337
 * 
 * @cname('__pyx_memoryview')
 * cdef class memoryview:             # <<<<<<<<<<<<<<
 * 
 *     cdef object obj
 */

struct __pyx_vtabstruct_memoryview {
  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
  PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
};
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;


/* "View.MemoryView":952
 * @cython.collection_type("sequence")
 * @cname('__pyx_memoryviewslice')
 * cdef class _memoryviewslice(memoryview):             # <<<<<<<<<<<<<<
 *     "Internal class for passing memoryview slices to Python"
 * 
 */

struct __pyx_vtabstruct__memoryviewslice {
  struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, 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__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
  #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
#endif
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
  #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); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #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_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#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)

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

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred()  (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
#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

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

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

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

/* 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)  do {\
    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);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  do {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
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

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *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_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
  #include "frameobject.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
  #define __Pxy_PyFrame_Initialize_Offsets()
  #define __Pyx_PyFrame_GetLocalsplus(frame)  ((frame)->f_localsplus)
#else
  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
#endif
#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

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

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

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

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

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

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
#else
    #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
#endif
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
    #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
#else
    #define __Pyx_Arg_NewRef_VARARGS(arg) arg
    #define __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_Arg_FASTCALL(args, i) args[i]
    #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
    #define __Pyx_Arg_NewRef_FASTCALL(arg) arg  /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
                                                   to have the same reference counting */
    #define __Pyx_Arg_XDECREF_FASTCALL(arg)
#else
    #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
    #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
    #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
#else
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* 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 *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
    const char* function_name);

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

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

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

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

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

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

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

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

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

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

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

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

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_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);

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

/* BuildPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);

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

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

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif PY_MAJOR_VERSION < 3
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
/* DivInt[Py_ssize_t].proto */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);

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

/* AssertionsEnabled.proto */
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (1)
#elif CYTHON_COMPILING_IN_LIMITED_API  ||  (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
  static int __pyx_assertions_enabled_flag;
  #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
  static int __Pyx_init_assertions_enabled(void) {
    PyObject *builtins, *debug, *debug_str;
    int flag;
    builtins = PyEval_GetBuiltins();
    if (!builtins) goto bad;
    debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
    if (!debug_str) goto bad;
    debug = PyObject_GetItem(builtins, debug_str);
    Py_DECREF(debug_str);
    if (!debug) goto bad;
    flag = PyObject_IsTrue(debug);
    Py_DECREF(debug);
    if (flag == -1) goto bad;
    __pyx_assertions_enabled_flag = flag;
    return 0;
  bad:
    __pyx_assertions_enabled_flag = 1;
    return -1;
  }
#else
  #define __Pyx_init_assertions_enabled()  (0)
  #define __pyx_assertions_enabled()  (!Py_OptimizeFlag)
#endif

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

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

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

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

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

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

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

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

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
#endif

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, 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_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#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_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
/* 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);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __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

/* PySequenceMultiply.proto */
#define __Pyx_PySequence_Multiply_Left(mul, seq)  __Pyx_PySequence_Multiply(seq, mul)
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);

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

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

/* DivInt[long].proto */
static CYTHON_INLINE long __Pyx_div_long(long, long);

/* RaiseKeywordRequired.proto */
static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name);

/* PyUnicode_Unicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);

/* UnicodeConcatInPlace.proto */
# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
    #if CYTHON_REFNANNY
        #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny)
    #else
        #define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right)
    #endif
    static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    );
#else
#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat
#endif
#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
    PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right))

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

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#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

/* 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);
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
        L->ob_item[len] = x;
        #else
        PyList_SET_ITEM(list, len, x);
        #endif
        __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

/* RaiseClosureNameError.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* pep479.proto */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen);

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

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

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

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

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

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

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

/* CIntToPyUnicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char);

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

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

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

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

/* PyDictContains.proto */
static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
    int result = PyDict_Contains(dict, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);

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

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

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

/* IncludeStructmemberH.proto */
#include <structmember.h>

/* FixUpExtensionType.proto */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
#endif

/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);

/* FetchCommonType.proto */
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
#else
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
#endif

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

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

/* CoroutineBase.proto */
struct __pyx_CoroutineObject;
typedef PyObject *(*__pyx_coroutine_body_t)(struct __pyx_CoroutineObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct __pyx_CoroutineObject {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    PyObject *gi_frame;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Coroutine.proto */
#define __Pyx_Coroutine_USED
#define __Pyx_Coroutine_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CoroutineType)
#define __Pyx_Coroutine_Check(obj) __Pyx_Coroutine_CheckExact(obj)
#define __Pyx_CoroutineAwait_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CoroutineAwaitType)
#define __Pyx_Coroutine_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_CoroutineType, body, code, closure, name, qualname, module_name)
static int __pyx_Coroutine_init(PyObject *module);
static PyObject *__Pyx__Coroutine_await(PyObject *coroutine);
typedef struct {
    PyObject_HEAD
    PyObject *coroutine;
} __pyx_CoroutineAwaitObject;
static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, PyObject *arg);
static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args);

/* GetAwaitIter.proto */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o);
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *o);

/* CoroutineYieldFrom.proto */
static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source);

/* ReturnWithStopIteration.proto */
#define __Pyx_ReturnWithStopIteration(value)\
    if (value == Py_None) PyErr_SetNone(PyExc_StopIteration); else __Pyx__ReturnWithStopIteration(value)
static void __Pyx__ReturnWithStopIteration(PyObject* value);

/* AsyncIter.proto */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAsyncIter(PyObject *o);
static CYTHON_INLINE PyObject *__Pyx_Coroutine_AsyncIterNext(PyObject *o);

/* StopAsyncIteration.proto */
#define __Pyx_StopAsyncIteration_USED
static PyObject *__Pyx_PyExc_StopAsyncIteration;
static int __pyx_StopAsyncIteration_init(PyObject *module);

/* decode_c_string_utf16.proto */
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 0;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = -1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
    int byteorder = 1;
    return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
}

/* decode_c_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));

/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
         PyObject* string, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    char* as_c_string;
    Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
    as_c_string = PyBytes_AS_STRING(string);
    size = PyBytes_GET_SIZE(string);
#else
    if (PyBytes_AsStringAndSize(string, &as_c_string, &size) < 0) {
        return NULL;
    }
#endif
    return __Pyx_decode_c_bytes(
        as_c_string, size,
        start, stop, encoding, errors, decode_func);
}

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

/* CallNextTpTraverse.proto */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

/* CallNextTpClear.proto */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear);

/* CallNextTpDealloc.proto */
static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif

/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type);
#endif

/* SetupReduce.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce(PyObject* type_obj);
#endif

/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12
#define __PYX_HAVE_RT_ImportType_proto_3_0_12
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include <stdalign.h>
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_0_12 {
   __Pyx_ImportType_CheckSize_Error_3_0_12 = 0,
   __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1,
   __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2
};
static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size);
#endif

/* PyMethodNew.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    typesModule = PyImport_ImportModule("types");
    if (!typesModule) return NULL;
    methodType = PyObject_GetAttrString(typesModule, "MethodType");
    Py_DECREF(typesModule);
    if (!methodType) return NULL;
    result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
    Py_DECREF(methodType);
    return result;
}
#elif PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#else
    #define __Pyx_PyMethod_New PyMethod_New
#endif

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

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

/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);

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

/* SetNewInClass.proto */
static int __Pyx_SetNewInClass(PyObject *ns, PyObject *name, PyObject *value);

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

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

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

/* Globals.proto */
static PyObject* __Pyx_Globals(void);

/* PatchInspect.proto */
static PyObject* __Pyx_patch_inspect(PyObject* module);

/* PatchAsyncIO.proto */
static PyObject* __Pyx_patch_asyncio(PyObject* module);

/* 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 */
#if !CYTHON_COMPILING_IN_LIMITED_API
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);
#endif

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

#if PY_MAJOR_VERSION < 3
    static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
    static void __Pyx_ReleaseBuffer(Py_buffer *view);
#else
    #define __Pyx_GetBuffer PyObject_GetBuffer
    #define __Pyx_ReleaseBuffer PyBuffer_Release
#endif


/* BufferStructDeclare.proto */
typedef struct {
  Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
typedef struct {
  size_t refcount;
  Py_buffer pybuffer;
} __Pyx_Buffer;
typedef struct {
  __Pyx_Buffer *rcbuffer;
  char *data;
  __Pyx_Buf_DimInfo diminfo[8];
} __Pyx_LocalBuf_ND;

/* MemviewSliceIsContig.proto */
static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);

/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
                                __Pyx_memviewslice *slice2,
                                int ndim, size_t itemsize);

/* MemviewDtypeToObject.proto */
static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp);
static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj);

/* IsLittleEndian.proto */
static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);

/* BufferFormatCheck.proto */
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type);

/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);

/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);

/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(PyObject *, int writable_flag);

/* MemviewSliceCopyTemplate.proto */
static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object);

/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT   1
#define __Pyx_MEMVIEW_PTR      2
#define __Pyx_MEMVIEW_FULL     4
#define __Pyx_MEMVIEW_CONTIG   8
#define __Pyx_MEMVIEW_STRIDED  16
#define __Pyx_MEMVIEW_FOLLOW   32
#define __Pyx_IS_C_CONTIG 1
#define __Pyx_IS_F_CONTIG 2
static int __Pyx_init_memviewslice(
                struct __pyx_memoryview_obj *memview,
                int ndim,
                __Pyx_memviewslice *memviewslice,
                int memview_is_new_reference);
static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
    __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
    __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
#define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
#define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);

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

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

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

/* CIntFromPy.proto */
static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_3gel_8protocol_8protocol_InputLanguage __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_EdgeFieldCardinality(EdgeFieldCardinality value);

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

/* CIntFromPy.proto */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);

/* CIntFromPy.proto */
static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat value);

/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#else
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* Generator.proto */
#define __Pyx_Generator_USED
#define __Pyx_Generator_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(PyObject *module);

/* CheckBinaryVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);

/* FunctionImport.proto */
static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

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

/* #### Code section: module_declarations ### */
static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_s); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/
static CYTHON_INLINE char __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/
static CYTHON_INLINE int32_t __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_get_tid(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_10LRUMapping_get(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_encode(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, CYTHON_UNUSED PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_decode(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_encode(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_decode(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_dump(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_19CodecPythonOverride_dump *__pyx_optional_args); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_basecodec, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_15EmptyTupleCodec_encode(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_15EmptyTupleCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_15BaseRecordCodec__check_encoder(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_15BaseRecordCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_20BaseNamedRecordCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_20BaseNamedRecordCodec_dump *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_20BaseNamedRecordCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_18EdegDBCodecContext_get_text_codec(struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_18EdegDBCodecContext_is_encoding_utf8(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_derive(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, PyObject *__pyx_v_tid); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_name, __pyx_t_3gel_7pgproto_7pgproto_encode_func __pyx_v_encoder, __pyx_t_3gel_7pgproto_7pgproto_decode_func __pyx_v_decoder); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_10TupleCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_10TupleCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_10TupleCodec_dump *__pyx_optional_args); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10TupleCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_fields_codecs); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_15NamedTupleCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_15NamedTupleCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_fields_names, PyObject *__pyx_v_fields_codecs); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_encode_args(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_names, PyObject *__pyx_v_flags, PyObject *__pyx_v_cards, PyObject *__pyx_v_codecs, int __pyx_v_is_sparse); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec__decode_array(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_14BaseArrayCodec_dump *__pyx_optional_args); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10ArrayCodec_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec, int32_t __pyx_v_cardinality); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode_range(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode_range(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_10RangeCodec_dump *__pyx_optional_args); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_15MultiRangeCodec_dump *__pyx_optional_args); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_8SetCodec_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_8SetCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_8SetCodec__decode_array_set(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_9EnumCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_9EnumCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_9EnumCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_enum_labels); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_11RecordCodec_encode(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, CYTHON_UNUSED PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_11RecordCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11RecordCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_names, PyObject *__pyx_v_codecs); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry__build_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_spec, PyObject *__pyx_v_codecs_list, PyObject *__pyx_v_protocol_version); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_has_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_type_id); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_get_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_type_id); /* proto*/
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_build_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_protocol_version); /* proto*/
static CYTHON_INLINE int __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_has_na_cardinality(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto*/
static int __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_load_from_cache(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14ExecuteContext_store_to_cache(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_reset_status(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_abort(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_write(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_read_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_write_annotations(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ensure_connected(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_parse_params(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_state(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_state); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_system_config(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_codec, PyObject *__pyx_v_data); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_server_settings(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_fallthrough(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_args(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_describe_type_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_describe_state_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_type_data(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_data_messages(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc, PyObject *__pyx_v_result); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_command_complete_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_sync_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol__amend_parse_error(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_exc, enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format, int __pyx_v_expect_one, int __pyx_v_required_one); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_error_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_error_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_parse_legacy_describe_type_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_parse_legacy_command_complete_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_write_headers(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_headers); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_write_execute_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, int __pyx_v_implicit_limit, int __pyx_v_inline_typenames, int __pyx_v_inline_typeids, uint64_t __pyx_v_allow_capabilities); /* proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_parse_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self); /* proto*/

/* Module declarations from "cython.view" */

/* Module declarations from "cython.dataclasses" */

/* Module declarations from "cython" */

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

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.type" */

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

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

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

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

/* Module declarations from "cpython.exc" */

/* Module declarations from "cpython.module" */

/* Module declarations from "cpython.mem" */

/* Module declarations from "cpython.tuple" */

/* Module declarations from "cpython.list" */

/* Module declarations from "cpython.sequence" */

/* Module declarations from "cpython.mapping" */

/* Module declarations from "cpython.iterator" */

/* Module declarations from "cpython.number" */

/* Module declarations from "cpython.int" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.bool" */

/* Module declarations from "cpython.long" */

/* Module declarations from "cpython.float" */

/* Module declarations from "__builtin__" */

/* Module declarations from "cpython.complex" */

/* Module declarations from "cpython.string" */

/* Module declarations from "libc.stddef" */

/* Module declarations from "cpython.unicode" */

/* Module declarations from "cpython.pyport" */

/* Module declarations from "cpython.dict" */

/* Module declarations from "cpython.instance" */

/* Module declarations from "cpython.function" */

/* Module declarations from "cpython.method" */

/* Module declarations from "cpython.weakref" */

/* Module declarations from "cpython.getargs" */

/* Module declarations from "cpython.pythread" */

/* Module declarations from "cpython.pystate" */

/* Module declarations from "cpython.cobject" */

/* Module declarations from "cpython.oldbuffer" */

/* Module declarations from "cpython.set" */

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

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

/* Module declarations from "cpython.pycapsule" */

/* Module declarations from "cpython.contextvars" */

/* Module declarations from "datetime" */

/* Module declarations from "cpython.datetime" */
static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void); /*proto*/

/* Module declarations from "cpython" */

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

/* Module declarations from "gel.pgproto.pgproto" */
static CYTHON_INLINE Py_ssize_t __pyx_f_3gel_7pgproto_7pgproto_frb_get_len(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static CYTHON_INLINE void __pyx_f_3gel_7pgproto_7pgproto_frb_set_len(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/
static CYTHON_INLINE void __pyx_f_3gel_7pgproto_7pgproto_frb_init(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, char const *, Py_ssize_t); /*proto*/
static CYTHON_INLINE char const *__pyx_f_3gel_7pgproto_7pgproto_frb_read(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/
static CYTHON_INLINE char const *__pyx_f_3gel_7pgproto_7pgproto_frb_read_all(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static CYTHON_INLINE struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_f_3gel_7pgproto_7pgproto_frb_slice_from(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_frb_check)(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_date_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_date_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_timestamp_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_timestamp_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_timestamptz_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_timestamptz_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_time_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_time_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_bool_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_bool_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_int2_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_int2_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_int4_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_int4_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_int8_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_int8_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_float4_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_float4_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_float8_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_float8_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_jsonb_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_jsonb_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_json_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_json_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_text_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_text_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_bytea_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_bytea_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_uuid_encode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_uuid_decode)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_numeric_encode_binary)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_7pgproto_7pgproto_numeric_decode_binary_ex)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, int); /*proto*/

/* Module declarations from "gel.pgproto" */

/* Module declarations from "gel.pgproto.debug" */

/* Module declarations from "gel.pgproto.hton" */

/* Module declarations from "gel.datatypes" */

/* Module declarations from "gel.datatypes.datatypes" */
__PYX_EXTERN_C DL_IMPORT(PyObject) *at_sign_ptr;
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_record_desc_new)(PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name)(PyObject *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_card)(PyObject *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_link_prop)(PyObject *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_link)(PyObject *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_implicit)(PyObject *, Py_ssize_t); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_namedtuple_new)(PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_namedtuple_type_new)(PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_object_new)(PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_object_set)(PyObject *, Py_ssize_t, PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_record_new)(PyObject *); /*proto*/
static PyObject *(*__pyx_f_3gel_9datatypes_9datatypes_record_set)(PyObject *, Py_ssize_t, PyObject *); /*proto*/

/* Module declarations from "gel.protocol" */

/* Module declarations from "gel.protocol.cpythonx" */

/* Module declarations from "gel.protocol.protocol" */
static PyObject *__pyx_v_3gel_8protocol_8protocol__LRU_MARKER = 0;
static uint64_t __pyx_v_3gel_8protocol_8protocol_RECORD_ENCODER_CHECKED;
static uint64_t __pyx_v_3gel_8protocol_8protocol_RECORD_ENCODER_INVALID;
static PyObject *__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID = 0;
static struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_3gel_8protocol_8protocol_DEFAULT_CODEC_CONTEXT = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_CARDS_MAP = 0;
static uint8_t __pyx_v_3gel_8protocol_8protocol_RANGE_EMPTY;
static uint8_t __pyx_v_3gel_8protocol_8protocol_RANGE_LB_INC;
static uint8_t __pyx_v_3gel_8protocol_8protocol_RANGE_UB_INC;
static uint8_t __pyx_v_3gel_8protocol_8protocol_RANGE_LB_INF;
static uint8_t __pyx_v_3gel_8protocol_8protocol_RANGE_UB_INF;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_3gel_8protocol_8protocol_NULL_CODEC = 0;
static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_ONE_EL_F32_ARRAY = 0;
static uint32_t __pyx_v_3gel_8protocol_8protocol_MANTISSA_TABLE[0x800];
static uint32_t __pyx_v_3gel_8protocol_8protocol_EXP_TABLE[64];
static uint32_t __pyx_v_3gel_8protocol_8protocol_OFFSET_TABLE[64];
static uint32_t __pyx_v_3gel_8protocol_8protocol_BASE_TABLE[0x200];
static uint32_t __pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[0x200];
static PyObject *__pyx_v_3gel_8protocol_8protocol_ONE_EL16_ARRAY = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_ONE_EL_I32_ARRAY = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_OLD_ERROR_CODES = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_result_cardinality_mismatch_code = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_parameter_type_mismatch_code = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE = 0;
static PyObject *__pyx_v_3gel_8protocol_8protocol_FLUSH_MESSAGE = 0;
static PyObject *__Pyx_OrderedDict = 0;
static PyObject *__Pyx_EnumBase = 0;
static PyObject *__Pyx_FlagBase = 0;
static PyObject *__pyx_collections_abc_Sequence = 0;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
static int __pyx_memoryview_thread_locks_used;
static PyThread_type_lock __pyx_memoryview_thread_locks[8];
static PyObject *__Pyx_globals = 0;
static CYTHON_INLINE int __pyx_f_3gel_8protocol_8protocol__is_trivial_container(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol__is_array_iterable(PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(PyObject *, __pyx_t_3gel_7pgproto_7pgproto_encode_func, __pyx_t_3gel_7pgproto_7pgproto_decode_func, struct __pyx_opt_args_3gel_8protocol_8protocol_register_base_scalar_codec *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_time_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_date_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_timestamp_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_timestamptz_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_duration_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_duration_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_relative_duration_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_relative_duration_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_date_duration_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_date_duration_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_config_memory_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_config_memory_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_encode_memview(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, __Pyx_memviewslice); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_convertmantissa(uint32_t); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_generate_tables(void); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_hv_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_hv_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_sv_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_sv_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_checked_decimal_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_decimal_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_ensure_is_int(PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_checked_int2_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_checked_int4_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_checked_int8_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_bigint_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_bigint_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_geometry_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_geometry_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_register_base_scalar_codecs(void); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_LRUMapping__set_state(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_CodecsRegistry__set_state(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_ExecuteContext__set_state(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_SansIOProtocol__set_state(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, PyObject *); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *, PyObject *); /*proto*/
static PyObject *__Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage); /*proto*/
static PyObject *__Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat); /*proto*/
static PyObject *__pyx_unpickle___Pyx_EnumMeta__set_state(struct __pyx_obj___Pyx_EnumMeta *, PyObject *); /*proto*/
static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
static PyObject *_unellipsify(PyObject *, int); /*proto*/
static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
static int __pyx_memoryview_err_no_memory(void); /*proto*/
static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_short = { "unsigned short", NULL, sizeof(unsigned short), { 0 }, 0, __PYX_IS_UNSIGNED(unsigned short) ? 'U' : 'I', __PYX_IS_UNSIGNED(unsigned short), 0 };
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "gel.protocol.protocol"
extern int __pyx_module_is_main_gel__protocol__protocol;
int __pyx_module_is_main_gel__protocol__protocol = 0;

/* Implementation of "gel.protocol.protocol" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_LookupError;
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_OverflowError;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_reversed;
static PyObject *__pyx_builtin_chr;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_Ellipsis;
static PyObject *__pyx_builtin_IndexError;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = "";
static const char __pyx_k_H[] = "H";
static const char __pyx_k_O[] = "O";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_l[] = "l";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_v[] = "v";
static const char __pyx_k__3[] = ".";
static const char __pyx_k__4[] = ": ";
static const char __pyx_k__5[] = "*";
static const char __pyx_k__8[] = "'";
static const char __pyx_k__9[] = ")";
static const char __pyx_k_ex[] = "ex";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_qc[] = "qc";
static const char __pyx_k_rv[] = "rv";
static const char __pyx_k_ALL[] = "ALL";
static const char __pyx_k_ONE[] = "ONE";
static const char __pyx_k_SQL[] = "SQL";
static const char __pyx_k_Set[] = "Set";
static const char __pyx_k__13[] = " ";
static const char __pyx_k__17[] = "...";
static const char __pyx_k__18[] = "{}{} := {}";
static const char __pyx_k__19[] = "\n";
static const char __pyx_k__20[] = " := ";
static const char __pyx_k__21[] = " (";
static const char __pyx_k__33[] = "@";
static const char __pyx_k__48[] = "-";
static const char __pyx_k__65[] = "[]";
static const char __pyx_k__80[] = ", ";
static const char __pyx_k_abc[] = "abc";
static const char __pyx_k_and[] = " and ";
static const char __pyx_k_big[] = "big";
static const char __pyx_k_buf[] = "buf";
static const char __pyx_k_chr[] = "chr";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_con[] = "con";
static const char __pyx_k_ctx[] = "ctx";
static const char __pyx_k_dct[] = "dct";
static const char __pyx_k_dim[] = "dim";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_exc[] = "exc";
static const char __pyx_k_gel[] = "gel";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_got[] = " (got ";
static const char __pyx_k_int[] = "int";
static const char __pyx_k_key[] = "' key";
static const char __pyx_k_msg[] = "msg";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_ref[] = "ref";
static const char __pyx_k_reg[] = "reg";
static const char __pyx_k_res[] = "res";
static const char __pyx_k_ret[] = "ret";
static const char __pyx_k_s_s[] = "%s.%s";
static const char __pyx_k_std[] = "std";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tid[] = "__tid__";
static const char __pyx_k_wkb[] = "wkb";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_0000[] = "0000";
static const char __pyx_k_Enum[] = "Enum";
static const char __pyx_k_JSON[] = "JSON";
static const char __pyx_k_LINK[] = "LINK";
static const char __pyx_k_MANY[] = "MANY";
static const char __pyx_k_NONE[] = "NONE";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_UUID[] = "UUID";
static const char __pyx_k__154[] = "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000";
static const char __pyx_k__156[] = "\000\000\000\000";
static const char __pyx_k__157[] = "\000\000\000\004\000\000\000\000";
static const char __pyx_k__241[] = "_";
static const char __pyx_k__254[] = "?";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_base[] = "base";
static const char __pyx_k_bint[] = "bint";
static const char __pyx_k_bool[] = "bool";
static const char __pyx_k_code[] = "_code";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_days[] = "days";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_dump[] = "dump";
static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_init[] = "__init__";
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_last[] = "last";
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_ndim[] = "ndim";
static const char __pyx_k_null[] = "null";
static const char __pyx_k_pack[] = "pack";
static const char __pyx_k_ping[] = "ping";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_salt[] = "salt";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_size[] = "size";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_sync[] = "_sync";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_user[] = "user";
static const char __pyx_k_uuid[] = "uuid";
static const char __pyx_k_ASCII[] = "ASCII";
static const char __pyx_k_Array[] = "Array";
static const char __pyx_k_FIELD[] = "_FIELD";
static const char __pyx_k_Range[] = "Range";
static const char __pyx_k_Sized[] = "Sized";
static const char __pyx_k_Tuple[] = "Tuple";
static const char __pyx_k_abort[] = "abort";
static const char __pyx_k_aiter[] = "__aiter__";
static const char __pyx_k_anext[] = "__anext__";
static const char __pyx_k_array[] = "array";
static const char __pyx_k_attrs[] = "_attrs";
static const char __pyx_k_await[] = "__await__";
static const char __pyx_k_bytes[] = "bytes";
static const char __pyx_k_cause[] = "__cause__";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_codec[] = "codec";
static const char __pyx_k_count[] = "count";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_enums[] = "enums";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_extra[] = ", extra ";
static const char __pyx_k_field[] = "field";
static const char __pyx_k_flags[] = "flags";
static const char __pyx_k_got_2[] = ", got ";
static const char __pyx_k_in_dc[] = "in_dc";
static const char __pyx_k_index[] = "_index_";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_loads[] = "loads";
static const char __pyx_k_lower[] = "lower";
static const char __pyx_k_major[] = "major";
static const char __pyx_k_minor[] = "minor";
static const char __pyx_k_mtype[] = "mtype";
static const char __pyx_k_parse[] = "_parse";
static const char __pyx_k_query[] = "query";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_s_s_d[] = "<%s.%s: %d>";
static const char __pyx_k_scram[] = "scram";
static const char __pyx_k_shape[] = "shape";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_str_2[] = "str";
static const char __pyx_k_strip[] = "strip";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_tname[] = "__tname__";
static const char __pyx_k_types[] = "types";
static const char __pyx_k_upper[] = "upper";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_zfill[] = "zfill";
static const char __pyx_k_BINARY[] = "BINARY";
static const char __pyx_k_EDGEQL[] = "EDGEQL";
static const char __pyx_k_Object[] = "Object";
static const char __pyx_k_Record[] = "Record";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_codecs[] = "codecs";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_errors[] = "errors";
static const char __pyx_k_fields[] = "_fields";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_header[] = "header";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_lookup[] = "lookup";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_missed[] = ", missed ";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_months[] = "months";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_out_dc[] = "out_dc";
static const char __pyx_k_packet[] = "packet";
static const char __pyx_k_params[] = "params";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_python[] = "python";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_status[] = "status";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_typeid[] = "typeid";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_tzinfo[] = "tzinfo";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_Decimal[] = "Decimal";
static const char __pyx_k_Element[] = "Element";
static const char __pyx_k_IntEnum[] = "IntEnum";
static const char __pyx_k_IntFlag[] = "IntFlag";
static const char __pyx_k_Mapping[] = "Mapping";
static const char __pyx_k_anytype[] = "anytype";
static const char __pyx_k_asyncio[] = "asyncio";
static const char __pyx_k_attrs_2[] = "attrs";
static const char __pyx_k_bytes_2[] = " bytes";
static const char __pyx_k_bytes_3[] = "_bytes";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_decimal[] = "decimal";
static const char __pyx_k_decoder[] = "decoder";
static const char __pyx_k_desc_id[] = "desc_id";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_encoder[] = "encoder";
static const char __pyx_k_execute[] = "_execute";
static const char __pyx_k_fortran[] = "fortran";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_get_pos[] = "get_pos";
static const char __pyx_k_headers[] = "headers";
static const char __pyx_k_index_2[] = "index";
static const char __pyx_k_inspect[] = "inspect";
static const char __pyx_k_maxsize[] = "maxsize";
static const char __pyx_k_members[] = "__members__";
static const char __pyx_k_memview[] = "memview";
static const char __pyx_k_methods[] = "methods";
static const char __pyx_k_msg_buf[] = "msg_buf";
static const char __pyx_k_nothing[] = "nothing";
static const char __pyx_k_parents[] = "parents";
static const char __pyx_k_pgproto[] = "pgproto";
static const char __pyx_k_popitem[] = "popitem";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_query_2[] = "_query";
static const char __pyx_k_re_exec[] = "re_exec";
static const char __pyx_k_restore[] = "restore";
static const char __pyx_k_std_str[] = "std::str";
static const char __pyx_k_ver_buf[] = "ver_buf";
static const char __pyx_k_weakref[] = "weakref";
static const char __pyx_k_Ellipsis[] = "Ellipsis";
static const char __pyx_k_EnumBase[] = "EnumBase";
static const char __pyx_k_EnumMeta[] = "EnumMeta";
static const char __pyx_k_EnumType[] = "EnumType";
static const char __pyx_k_Iterable[] = "Iterable";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_PROPERTY[] = "PROPERTY";
static const char __pyx_k_Sequence[] = "Sequence";
static const char __pyx_k_SetCodec[] = "SetCodec";
static const char __pyx_k_SizedABC[] = "SizedABC";
static const char __pyx_k_TYPE_IDS[] = "TYPE_IDS";
static const char __pyx_k_anytuple[] = "anytuple";
static const char __pyx_k_argument[] = "argument $";
static const char __pyx_k_byteswap[] = "byteswap";
static const char __pyx_k_data_gen[] = "data_gen";
static const char __pyx_k_database[] = "database";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_describe[] = "describe";
static const char __pyx_k_elements[] = "elements";
static const char __pyx_k_expected[] = "expected ";
static const char __pyx_k_get_code[] = "get_code";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_is_empty[] = "is_empty";
static const char __pyx_k_itemsize[] = "itemsize";
static const char __pyx_k_methname[] = "methname";
static const char __pyx_k_module_2[] = "module";
static const char __pyx_k_no_input[] = "no-input";
static const char __pyx_k_password[] = "password";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_required[] = "required";
static const char __pyx_k_reversed[] = "reversed";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_std_bool[] = "std::bool";
static const char __pyx_k_std_json[] = "std::json";
static const char __pyx_k_std_uuid[] = "std::uuid";
static const char __pyx_k_try_from[] = "_try_from";
static const char __pyx_k_warnings[] = "warnings";
static const char __pyx_k_ArrayType[] = "ArrayType";
static const char __pyx_k_BaseCodec[] = "BaseCodec";
static const char __pyx_k_EnumCodec[] = "EnumCodec";
static const char __pyx_k_EnumValue[] = "EnumValue";
static const char __pyx_k_NO_RESULT[] = "NO_RESULT";
static const char __pyx_k_NullCodec[] = "NullCodec";
static const char __pyx_k_RangeType[] = "RangeType";
static const char __pyx_k_TupleType[] = "TupleType";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_arguments[] = " arguments";
static const char __pyx_k_attribute[] = "' attribute";
static const char __pyx_k_auth_sasl[] = "_auth_sasl";
static const char __pyx_k_base_type[] = "base_type";
static const char __pyx_k_basecodec[] = "basecodec";
static const char __pyx_k_cap_bytes[] = "cap_bytes";
static const char __pyx_k_datatypes[] = "datatypes";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_execute_2[] = "execute";
static const char __pyx_k_from_code[] = "_from_code";
static const char __pyx_k_from_json[] = "_from_json";
static const char __pyx_k_inc_lower[] = "inc_lower";
static const char __pyx_k_inc_upper[] = "inc_upper";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_itercount[] = "itercount";
static const char __pyx_k_make_type[] = "make_type";
static const char __pyx_k_members_2[] = "members";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_range_mod[] = "range_mod";
static const char __pyx_k_raw_query[] = "raw_query";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_std_bytes[] = "std::bytes";
static const char __pyx_k_std_int16[] = "std::int16";
static const char __pyx_k_std_int32[] = "std::int32";
static const char __pyx_k_std_int64[] = "std::int64";
static const char __pyx_k_terminate[] = "terminate";
static const char __pyx_k_timedelta[] = "timedelta";
static const char __pyx_k_type_size[] = "type_size";
static const char __pyx_k_ArrayCodec[] = "ArrayCodec";
static const char __pyx_k_Capability[] = "Capability";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_LRUMapping[] = "LRUMapping";
static const char __pyx_k_MappingABC[] = "MappingABC";
static const char __pyx_k_MultiRange[] = "MultiRange";
static const char __pyx_k_NamedTuple[] = "NamedTuple";
static const char __pyx_k_ObjectType[] = "ObjectType";
static const char __pyx_k_RangeCodec[] = "RangeCodec";
static const char __pyx_k_ScalarType[] = "ScalarType";
static const char __pyx_k_TupleCodec[] = "TupleCodec";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_acceptable[] = "acceptable";
static const char __pyx_k_cache_size[] = "cache_size";
static const char __pyx_k_cfg_memory[] = "cfg::memory";
static const char __pyx_k_con_params[] = "con_params";
static const char __pyx_k_descriptor[] = "descriptor";
static const char __pyx_k_expect_one[] = "expect_one";
static const char __pyx_k_expected_2[] = "expected";
static const char __pyx_k_expected_3[] = ", expected ";
static const char __pyx_k_extra_args[] = "extra_args";
static const char __pyx_k_field_type[] = "_field_type";
static const char __pyx_k_from_bytes[] = "from_bytes";
static const char __pyx_k_in_type_id[] = "in_type_id";
static const char __pyx_k_null_codec[] = "null-codec";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_secret_key[] = "secret_key";
static const char __pyx_k_server_sig[] = "server_sig";
static const char __pyx_k_std_bigint[] = "std::bigint";
static const char __pyx_k_value_type[] = "value_type";
static const char __pyx_k_AT_MOST_ONE[] = "AT_MOST_ONE";
static const char __pyx_k_Cardinality[] = "Cardinality";
static const char __pyx_k_ClientError[] = "ClientError";
static const char __pyx_k_EdgeDBError[] = "EdgeDBError";
static const char __pyx_k_ElementKind[] = "ElementKind";
static const char __pyx_k_IterableABC[] = "IterableABC";
static const char __pyx_k_LookupError[] = "LookupError";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_NoDataError[] = "NoDataError";
static const char __pyx_k_ObjectCodec[] = "ObjectCodec";
static const char __pyx_k_OrderedDict[] = "OrderedDict";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_RecordCodec[] = "RecordCodec";
static const char __pyx_k_ScalarCodec[] = "ScalarCodec";
static const char __pyx_k_annotations[] = "annotations";
static const char __pyx_k_cardinality[] = "cardinality";
static const char __pyx_k_clear_cache[] = "clear_cache";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_dataclasses[] = "dataclasses";
static const char __pyx_k_empty_tuple[] = "empty-tuple";
static const char __pyx_k_gel_pgproto[] = "gel.pgproto";
static const char __pyx_k_is_implicit[] = "is_implicit";
static const char __pyx_k_missed_args[] = "missed_args";
static const char __pyx_k_move_to_end[] = "move_to_end";
static const char __pyx_k_mro_entries[] = "__mro_entries__";
static const char __pyx_k_num_methods[] = "num_methods";
static const char __pyx_k_out_type_id[] = "out_type_id";
static const char __pyx_k_passed_args[] = "passed_args";
static const char __pyx_k_std_decimal[] = "std::decimal";
static const char __pyx_k_std_float32[] = "std::float32";
static const char __pyx_k_std_float64[] = "std::float64";
static const char __pyx_k_std_pg_date[] = "std::pg::date";
static const char __pyx_k_std_pg_json[] = "std::pg::json";
static const char __pyx_k_AT_LEAST_ONE[] = "AT_LEAST_ONE";
static const char __pyx_k_OutputFormat[] = "OutputFormat";
static const char __pyx_k_Pyx_EnumBase[] = "__Pyx_EnumBase";
static const char __pyx_k_Pyx_FlagBase[] = "__Pyx_FlagBase";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_SparseObject[] = "SparseObject";
static const char __pyx_k_capabilities[] = "capabilities";
static const char __pyx_k_client_final[] = "client_final";
static const char __pyx_k_client_first[] = "client_first";
static const char __pyx_k_client_nonce[] = "client_nonce";
static const char __pyx_k_element_type[] = "element_type";
static const char __pyx_k_elements_got[] = " elements, got ";
static const char __pyx_k_fts_language[] = "fts::language";
static const char __pyx_k_get_settings[] = "get_settings";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_legacy_parse[] = "_legacy_parse";
static const char __pyx_k_member_names[] = "_member_names_";
static const char __pyx_k_microseconds[] = "microseconds";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_query_single[] = "query_single";
static const char __pyx_k_required_one[] = "required_one";
static const char __pyx_k_server_final[] = "server_final";
static const char __pyx_k_server_first[] = "server_first";
static const char __pyx_k_server_nonce[] = "server_nonce";
static const char __pyx_k_std_datetime[] = "std::datetime";
static const char __pyx_k_std_duration[] = "std::duration";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_EdgeDBMessage[] = "EdgeDBMessage";
static const char __pyx_k_InputLanguage[] = "InputLanguage";
static const char __pyx_k_JSON_ELEMENTS[] = "JSON_ELEMENTS";
static const char __pyx_k_LINK_PROPERTY[] = "LINK_PROPERTY";
static const char __pyx_k_OverflowError[] = "OverflowError";
static const char __pyx_k_ProtocolError[] = "ProtocolError";
static const char __pyx_k_SCRAM_SHA_256[] = "SCRAM-SHA-256";
static const char __pyx_k_asyncio_tasks[] = "asyncio.tasks";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_data_received[] = "data_received";
static const char __pyx_k_element_types[] = "element_types";
static const char __pyx_k_error_message[] = "error_message";
static const char __pyx_k_gel_datatypes[] = "gel.datatypes";
static const char __pyx_k_handshake_buf[] = "handshake_buf";
static const char __pyx_k_init_subclass[] = "__init_subclass__";
static const char __pyx_k_not_connected[] = "not connected";
static const char __pyx_k_output_format[] = "output_format";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_required_args[] = "required_args";
static const char __pyx_k_system_config[] = "system_config";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_BaseArrayCodec[] = "BaseArrayCodec";
static const char __pyx_k_BaseScalarType[] = "BaseScalarType";
static const char __pyx_k_CodecsRegistry[] = "CodecsRegistry";
static const char __pyx_k_ExecuteContext[] = "ExecuteContext";
static const char __pyx_k_InterfaceError[] = "InterfaceError";
static const char __pyx_k_MultiRangeType[] = "MultiRangeType";
static const char __pyx_k_NamedTupleType[] = "NamedTupleType";
static const char __pyx_k_SansIOProtocol[] = "SansIOProtocol";
static const char __pyx_k_block_callback[] = "block_callback";
static const char __pyx_k_cal_local_date[] = "cal::local_date";
static const char __pyx_k_cal_local_time[] = "cal::local_time";
static const char __pyx_k_generate_nonce[] = "generate_nonce";
static const char __pyx_k_get_text_codec[] = "get_text_codec";
static const char __pyx_k_implicit_limit[] = "implicit_limit";
static const char __pyx_k_inline_typeids[] = "inline_typeids";
static const char __pyx_k_input_language[] = "input_language";
static const char __pyx_k_legacy_execute[] = "_legacy_execute";
static const char __pyx_k_on_log_message[] = "_on_log_message";
static const char __pyx_k_set_connection[] = "set_connection";
static const char __pyx_k_set_type_codec[] = "set_type_codec";
static const char __pyx_k_BaseRecordCodec[] = "BaseRecordCodec";
static const char __pyx_k_CompilationFlag[] = "CompilationFlag";
static const char __pyx_k_EMPTY_NULL_DATA[] = "EMPTY_NULL_DATA";
static const char __pyx_k_EmptyTupleCodec[] = "EmptyTupleCodec";
static const char __pyx_k_MultiRangeCodec[] = "MultiRangeCodec";
static const char __pyx_k_NamedTupleCodec[] = "NamedTupleCodec";
static const char __pyx_k_Python_override[] = "<Python override>";
static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
static const char __pyx_k_collections_abc[] = "collections.abc";
static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
static const char __pyx_k_expected_an_int[] = "expected an int";
static const char __pyx_k_header_callback[] = "header_callback";
static const char __pyx_k_header_received[] = "header_received";
static const char __pyx_k_new_cardinality[] = "new_cardinality";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_std_pg_interval[] = "std::pg::interval";
static const char __pyx_k_ALL_CAPABILITIES[] = "ALL_CAPABILITIES";
static const char __pyx_k_DerivedEnumValue[] = "DerivedEnumValue";
static const char __pyx_k_LRUMapping_clear[] = "LRUMapping.clear";
static const char __pyx_k_MappingProxyType[] = "MappingProxyType";
static const char __pyx_k_describe_context[] = "describe_context";
static const char __pyx_k_enums_Capability[] = "enums.Capability";
static const char __pyx_k_inline_typenames[] = "inline_typenames";
static const char __pyx_k_passed_args_repr[] = "passed_args_repr";
static const char __pyx_k_returned_no_data[] = "() returned no data";
static const char __pyx_k_std_pg_timestamp[] = "std::pg::timestamp";
static const char __pyx_k_try_recv_eagerly[] = "try_recv_eagerly";
static const char __pyx_k_wait_for_connect[] = "wait_for_connect";
static const char __pyx_k_wait_for_message[] = "wait_for_message";
static const char __pyx_k_EMPTY_RECORD_DATA[] = "EMPTY_RECORD_DATA";
static const char __pyx_k_already_connected[] = "already connected";
static const char __pyx_k_cal_date_duration[] = "cal::date_duration";
static const char __pyx_k_client_first_bare[] = "client_first_bare";
static const char __pyx_k_ext_postgis_box2d[] = "ext::postgis::box2d";
static const char __pyx_k_ext_postgis_box3d[] = "ext::postgis::box3d";
static const char __pyx_k_is_in_transaction[] = "is_in_transaction";
static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
static const char __pyx_k_query_single_json[] = "query_single_json";
static const char __pyx_k_EdegDBCodecContext[] = "EdegDBCodecContext";
static const char __pyx_k_Pyx_EnumBase___new[] = "__Pyx_EnumBase.__new__";
static const char __pyx_k_Pyx_EnumBase___str[] = "__Pyx_EnumBase.__str__";
static const char __pyx_k_Pyx_FlagBase___new[] = "__Pyx_FlagBase.__new__";
static const char __pyx_k_Pyx_FlagBase___str[] = "__Pyx_FlagBase.__str__";
static const char __pyx_k_QueryArgumentError[] = "QueryArgumentError";
static const char __pyx_k_SetCodec_make_type[] = "SetCodec.make_type";
static const char __pyx_k_allow_capabilities[] = "allow_capabilities";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cal_local_datetime[] = "cal::local_datetime";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_dim_key_is_missing[] = "\"dim\" key is missing";
static const char __pyx_k_query_executed_via[] = "query executed via ";
static const char __pyx_k_std_pg_timestamptz[] = "std::pg::timestamptz";
static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
static const char __pyx_k_BaseCodec_make_type[] = "BaseCodec.make_type";
static const char __pyx_k_CodecPythonOverride[] = "CodecPythonOverride";
static const char __pyx_k_EnumCodec_make_type[] = "EnumCodec.make_type";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_NullCodec_make_type[] = "NullCodec.make_type";
static const char __pyx_k_Pyx_EnumBase___repr[] = "__Pyx_EnumBase.__repr__";
static const char __pyx_k_Pyx_FlagBase___repr[] = "__Pyx_FlagBase.__repr__";
static const char __pyx_k_QUERY_SINGLE_METHOD[] = "_QUERY_SINGLE_METHOD";
static const char __pyx_k_SansIOProtocol_dump[] = "SansIOProtocol.dump";
static const char __pyx_k_SansIOProtocol_ping[] = "SansIOProtocol.ping";
static const char __pyx_k_expected_server_sig[] = "expected_server_sig";
static const char __pyx_k_ext_pgvector_vector[] = "ext::pgvector::vector";
static const char __pyx_k_gel_pgproto_pgproto[] = "gel.pgproto.pgproto";
static const char __pyx_k_legacy_simple_query[] = "legacy_simple_query";
static const char __pyx_k_typing_Optional_int[] = "typing.Optional[int]";
static const char __pyx_k_wait_for_disconnect[] = "wait_for_disconnect";
static const char __pyx_k_ArrayCodec_make_type[] = "ArrayCodec.make_type";
static const char __pyx_k_BaseNamedRecordCodec[] = "BaseNamedRecordCodec";
static const char __pyx_k_InvalidArgumentError[] = "InvalidArgumentError";
static const char __pyx_k_RangeCodec_make_type[] = "RangeCodec.make_type";
static const char __pyx_k_SansIOProtocol__sync[] = "SansIOProtocol._sync";
static const char __pyx_k_SansIOProtocol_abort[] = "SansIOProtocol.abort";
static const char __pyx_k_SansIOProtocol_query[] = "SansIOProtocol.query";
static const char __pyx_k_TupleCodec_make_type[] = "TupleCodec.make_type";
static const char __pyx_k_Unknown_enum_value_s[] = "Unknown enum value: '%s'";
static const char __pyx_k_bad_bigint_sign_data[] = "bad bigint sign data";
static const char __pyx_k_ext_pgvector_halfvec[] = "ext::pgvector::halfvec";
static const char __pyx_k_ext_postgis_geometry[] = "ext::postgis::geometry";
static const char __pyx_k_gel_DerivedEnumValue[] = "gel.DerivedEnumValue";
static const char __pyx_k_gel_protocol_lru_pyx[] = "gel/protocol/./lru.pyx";
static const char __pyx_k_get_dataclass_fields[] = "get_dataclass_fields";
static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
static const char __pyx_k_too_many_annotations[] = "too many annotations";
static const char __pyx_k_ClientConnectionError[] = "ClientConnectionError";
static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
static const char __pyx_k_ObjectCodec_make_type[] = "ObjectCodec.make_type";
static const char __pyx_k_SansIOProtocol__parse[] = "SansIOProtocol._parse";
static const char __pyx_k_ScalarCodec_make_type[] = "ScalarCodec.make_type";
static const char __pyx_k_base_scalar_codec_for[] = "base scalar codec for ";
static const char __pyx_k_cal_relative_duration[] = "cal::relative_duration";
static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
static const char __pyx_k_ext_postgis_geography[] = "ext::postgis::geography";
static const char __pyx_k_gel_protocol_protocol[] = "gel.protocol.protocol";
static const char __pyx_k_invalid_array_element[] = "invalid array element: {}";
static const char __pyx_k_invalid_buffer_length[] = "invalid buffer length";
static const char __pyx_k_is_already_registered[] = " is already registered";
static const char __pyx_k_neither_are_supported[] = ", neither are supported.";
static const char __pyx_k_query_required_single[] = "query_required_single";
static const char __pyx_k_typeid_must_be_a_UUID[] = "typeid must be a UUID";
static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
static const char __pyx_k_INJECT_OUTPUT_TYPE_IDS[] = "INJECT_OUTPUT_TYPE_IDS";
static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
static const char __pyx_k_SansIOProtocol_connect[] = "SansIOProtocol.connect";
static const char __pyx_k_SansIOProtocol_execute[] = "SansIOProtocol.execute";
static const char __pyx_k_SansIOProtocol_restore[] = "SansIOProtocol.restore";
static const char __pyx_k_ext_pgvector_sparsevec[] = "ext::pgvector::sparsevec";
static const char __pyx_k_named_tuple_is_missing[] = "named tuple is missing '";
static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
static const char __pyx_k_SansIOProtocol__execute[] = "SansIOProtocol._execute";
static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
static const char __pyx_k_pyx_unpickle_LRUMapping[] = "__pyx_unpickle_LRUMapping";
static const char __pyx_k_unexpected_message_type[] = "unexpected message type ";
static const char __pyx_k_EDGE_POINTER_IS_LINKPROP[] = "_EDGE_POINTER_IS_LINKPROP";
static const char __pyx_k_INJECT_OUTPUT_OBJECT_IDS[] = "INJECT_OUTPUT_OBJECT_IDS";
static const char __pyx_k_INJECT_OUTPUT_TYPE_NAMES[] = "INJECT_OUTPUT_TYPE_NAMES";
static const char __pyx_k_SansIOProtocol_terminate[] = "SansIOProtocol.terminate";
static const char __pyx_k_SetCodec___reduce_cython[] = "SetCodec.__reduce_cython__";
static const char __pyx_k_legacy_execute_anonymous[] = "legacy_execute_anonymous";
static const char __pyx_k_make_type_locals_genexpr[] = "make_type.<locals>.genexpr";
static const char __pyx_k_result_is_not_a_list_but[] = "result is not a list, but ";
static const char __pyx_k_BaseCodec___reduce_cython[] = "BaseCodec.__reduce_cython__";
static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
static const char __pyx_k_EmptyTupleCodec_make_type[] = "EmptyTupleCodec.make_type";
static const char __pyx_k_EnumCodec___reduce_cython[] = "EnumCodec.__reduce_cython__";
static const char __pyx_k_MultiRangeCodec_make_type[] = "MultiRangeCodec.make_type";
static const char __pyx_k_NamedTupleCodec_make_type[] = "NamedTupleCodec.make_type";
static const char __pyx_k_NullCodec___reduce_cython[] = "NullCodec.__reduce_cython__";
static const char __pyx_k_SansIOProtocol__auth_sasl[] = "SansIOProtocol._auth_sasl";
static const char __pyx_k_elements_in_the_tuple_got[] = " elements in the tuple, got ";
static const char __pyx_k_gel_protocol_protocol_pyx[] = "gel/protocol/protocol.pyx";
static const char __pyx_k_invalid_range_lower_bound[] = "invalid range lower bound: {}";
static const char __pyx_k_invalid_range_upper_bound[] = "invalid range upper bound: {}";
static const char __pyx_k_legacy_optimistic_execute[] = "_legacy_optimistic_execute";
static const char __pyx_k_set_dataclass_fields_func[] = "set_dataclass_fields_func";
static const char __pyx_k_ArrayCodec___reduce_cython[] = "ArrayCodec.__reduce_cython__";
static const char __pyx_k_CodecsRegistry_clear_cache[] = "CodecsRegistry.clear_cache";
static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
static const char __pyx_k_LRUMapping___reduce_cython[] = "LRUMapping.__reduce_cython__";
static const char __pyx_k_ParameterTypeMismatchError[] = "ParameterTypeMismatchError";
static const char __pyx_k_RangeCodec___reduce_cython[] = "RangeCodec.__reduce_cython__";
static const char __pyx_k_SetCodec___setstate_cython[] = "SetCodec.__setstate_cython__";
static const char __pyx_k_TupleCodec___reduce_cython[] = "TupleCodec.__reduce_cython__";
static const char __pyx_k_build_client_final_message[] = "build_client_final_message";
static const char __pyx_k_build_client_first_message[] = "build_client_first_message";
static const char __pyx_k_invalid_multirange_element[] = "invalid multirange element: ";
static const char __pyx_k_more_than_one_header_block[] = "more than one header block";
static const char __pyx_k_parse_server_final_message[] = "parse_server_final_message";
static const char __pyx_k_parse_server_first_message[] = "parse_server_first_message";
static const char __pyx_k_query_required_single_json[] = "query_required_single_json";
static const char __pyx_k_suggested_pool_concurrency[] = "suggested_pool_concurrency";
static const char __pyx_k_BaseCodec___setstate_cython[] = "BaseCodec.__setstate_cython__";
static const char __pyx_k_ClientConnectionClosedError[] = "ClientConnectionClosedError";
static const char __pyx_k_EnumCodec___setstate_cython[] = "EnumCodec.__setstate_cython__";
static const char __pyx_k_NullCodec___setstate_cython[] = "NullCodec.__setstate_cython__";
static const char __pyx_k_ObjectCodec___reduce_cython[] = "ObjectCodec.__reduce_cython__";
static const char __pyx_k_RecordCodec___reduce_cython[] = "RecordCodec.__reduce_cython__";
static const char __pyx_k_SansIOProtocol_get_settings[] = "SansIOProtocol.get_settings";
static const char __pyx_k_ScalarCodec___reduce_cython[] = "ScalarCodec.__reduce_cython__";
static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
static const char __pyx_k_expected_no_named_arguments[] = "expected no named arguments";
static const char __pyx_k_gel_protocol_codecs_set_pyx[] = "gel/protocol/./codecs/./set.pyx";
static const char __pyx_k_invalid_array_size_received[] = "invalid array size: received ";
static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
static const char __pyx_k_named_tuple_dict_is_missing[] = "named tuple dict is missing '";
static const char __pyx_k_pyx_unpickle_CodecsRegistry[] = "__pyx_unpickle_CodecsRegistry";
static const char __pyx_k_pyx_unpickle_ExecuteContext[] = "__pyx_unpickle_ExecuteContext";
static const char __pyx_k_pyx_unpickle_SansIOProtocol[] = "__pyx_unpickle_SansIOProtocol";
static const char __pyx_k_pyx_unpickle___Pyx_EnumMeta[] = "__pyx_unpickle___Pyx_EnumMeta";
static const char __pyx_k_ArrayCodec___setstate_cython[] = "ArrayCodec.__setstate_cython__";
static const char __pyx_k_LRUMapping___setstate_cython[] = "LRUMapping.__setstate_cython__";
static const char __pyx_k_Pyx_EnumMeta___reduce_cython[] = "__Pyx_EnumMeta.__reduce_cython__";
static const char __pyx_k_RangeCodec___setstate_cython[] = "RangeCodec.__setstate_cython__";
static const char __pyx_k_TupleCodec___setstate_cython[] = "TupleCodec.__setstate_cython__";
static const char __pyx_k_a_str_or_gel_EnumValue___tid[] = "a str or gel.EnumValue(__tid__=";
static const char __pyx_k_cannot_decode_Tuple_expected[] = "cannot decode Tuple: expected ";
static const char __pyx_k_expected_a_Decimal_or_an_int[] = "expected a Decimal or an int";
static const char __pyx_k_first_message_is_not_DataMsg[] = "first message is not \"DataMsg\"";
static const char __pyx_k_gel_protocol_codecs_base_pyx[] = "gel/protocol/./codecs/./base.pyx";
static const char __pyx_k_gel_protocol_codecs_enum_pyx[] = "gel/protocol/./codecs/./enum.pyx";
static const char __pyx_k_gel_protocol_protocol_v0_pyx[] = "gel/protocol/protocol_v0.pyx";
static const char __pyx_k_CodecPythonOverride_make_type[] = "CodecPythonOverride.make_type";
static const char __pyx_k_CodecsRegistry_set_type_codec[] = "CodecsRegistry.set_type_codec";
static const char __pyx_k_ObjectCodec___setstate_cython[] = "ObjectCodec.__setstate_cython__";
static const char __pyx_k_RecordCodec___setstate_cython[] = "RecordCodec.__setstate_cython__";
static const char __pyx_k_SansIOProtocol_set_connection[] = "SansIOProtocol.set_connection";
static const char __pyx_k_ScalarCodec___setstate_cython[] = "ScalarCodec.__setstate_cython__";
static const char __pyx_k_cannot_decode_Object_expected[] = "cannot decode Object: expected ";
static const char __pyx_k_cannot_decode_Record_expected[] = "cannot decode Record: expected ";
static const char __pyx_k_cannot_find_known_ID_for_type[] = "cannot find known ID for type ";
static const char __pyx_k_gel_protocol_codecs_array_pyx[] = "gel/protocol/./codecs/./array.pyx";
static const char __pyx_k_gel_protocol_codecs_range_pyx[] = "gel/protocol/./codecs/./range.pyx";
static const char __pyx_k_gel_protocol_codecs_tuple_pyx[] = "gel/protocol/./codecs/./tuple.pyx";
static const char __pyx_k_header_block_after_data_block[] = "header block after data block";
static const char __pyx_k_header_block_was_not_received[] = "header block was not received";
static const char __pyx_k_is_required_but_received_None[] = " is required, but received None";
static const char __pyx_k_non_idle_status_after_connect[] = "non-idle status after connect";
static const char __pyx_k_query_cannot_be_executed_with[] = "query cannot be executed with ";
static const char __pyx_k_too_many_elements_for_a_tuple[] = "too many elements for a tuple";
static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
static const char __pyx_k_BaseArrayCodec___reduce_cython[] = "BaseArrayCodec.__reduce_cython__";
static const char __pyx_k_CodecsRegistry___reduce_cython[] = "CodecsRegistry.__reduce_cython__";
static const char __pyx_k_ExecuteContext___reduce_cython[] = "ExecuteContext.__reduce_cython__";
static const char __pyx_k_Pyx_EnumMeta___setstate_cython[] = "__Pyx_EnumMeta.__setstate_cython__";
static const char __pyx_k_ResultCardinalityMismatchError[] = "ResultCardinalityMismatchError";
static const char __pyx_k_SansIOProtocol___reduce_cython[] = "SansIOProtocol.__reduce_cython__";
static const char __pyx_k_as_it_does_not_return_any_data[] = "() as it does not return any data";
static const char __pyx_k_as_it_may_return_more_than_one[] = "() as it may return more than one element";
static const char __pyx_k_data_block_before_header_block[] = "data block before header block";
static const char __pyx_k_gel_protocol_codecs_codecs_pyx[] = "gel/protocol/./codecs/codecs.pyx";
static const char __pyx_k_gel_protocol_codecs_object_pyx[] = "gel/protocol/./codecs/./object.pyx";
static const char __pyx_k_gel_protocol_codecs_scalar_pyx[] = "gel/protocol/./codecs/./scalar.pyx";
static const char __pyx_k_pyx_unpickle_SansIOProtocolBac[] = "__pyx_unpickle_SansIOProtocolBackwardsCompatible";
static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
static const char __pyx_k_the_connection_has_been_closed[] = "the connection has been closed";
static const char __pyx_k_BaseNamedRecordCodec___setstate[] = "BaseNamedRecordCodec.__setstate_cython__";
static const char __pyx_k_BaseRecordCodec___reduce_cython[] = "BaseRecordCodec.__reduce_cython__";
static const char __pyx_k_EmptyTupleCodec___reduce_cython[] = "EmptyTupleCodec.__reduce_cython__";
static const char __pyx_k_MultiRangeCodec___reduce_cython[] = "MultiRangeCodec.__reduce_cython__";
static const char __pyx_k_NamedTupleCodec___reduce_cython[] = "NamedTupleCodec.__reduce_cython__";
static const char __pyx_k_SansIOProtocol_try_recv_eagerly[] = "SansIOProtocol.try_recv_eagerly";
static const char __pyx_k_SansIOProtocol_wait_for_connect[] = "SansIOProtocol.wait_for_connect";
static const char __pyx_k_SansIOProtocol_wait_for_message[] = "SansIOProtocol.wait_for_message";
static const char __pyx_k_bigint_data_has_fractional_part[] = "bigint data has fractional part";
static const char __pyx_k_does_not_correspond_to_any_know[] = " does not correspond to any known base type";
static const char __pyx_k_expected_a_record_with_a_single[] = "expected a record with a single element as an array set element envelope";
static const char __pyx_k_is_expected_as_a_valid_enum_arg[] = ") is expected as a valid enum argument, got ";
static const char __pyx_k_make_missing_args_error_message[] = "_make_missing_args_error_message";
static const char __pyx_k_python_is_the_only_valid_format[] = "\"python\" is the only valid format";
static const char __pyx_k_r_is_out_of_range_for_type_half[] = "{!r} is out of range for type halfvec";
static const char __pyx_k_too_many_elements_in_multirange[] = "too many elements in multirange value";
static const char __pyx_k_unable_to_decode_data_to_Python[] = "unable to decode data to Python objects";
static const char __pyx_k_unexpected_query_argument_codec[] = "unexpected query argument codec";
static const char __pyx_k_00000000_0000_0000_0000_00000000[] = "00000000-0000-0000-0000-000000000001";
static const char __pyx_k_00000000_0000_0000_0000_00000100[] = "00000000-0000-0000-0000-000001000001";
static const char __pyx_k_003e434d_cac2_430a_b238_fb39d734[] = "003e434d-cac2-430a-b238-fb39d73447d2";
static const char __pyx_k_44c901c0_d922_4894_83c8_061bd05e[] = "44c901c0-d922-4894-83c8-061bd05e4840";
static const char __pyx_k_4ba84534_188e_43b4_a7ce_cea2af0f[] = "4ba84534-188e-43b4-a7ce-cea2af0f405b";
static const char __pyx_k_4d738878_3a5f_4821_ab76_9d8e7d6b[] = "4d738878-3a5f-4821-ab76-9d8e7d6b32c4";
static const char __pyx_k_7fae5536_6311_4f60_8eb9_096a5d97[] = "7fae5536-6311-4f60-8eb9-096a5d972f48";
static const char __pyx_k_9565dd88_04f5_11ee_a691_0b6ebe17[] = "9565dd88-04f5-11ee-a691-0b6ebe179825";
static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
static const char __pyx_k_BaseArrayCodec___setstate_cython[] = "BaseArrayCodec.__setstate_cython__";
static const char __pyx_k_BaseNamedRecordCodec___reduce_cy[] = "BaseNamedRecordCodec.__reduce_cython__";
static const char __pyx_k_BaseRecordCodec___setstate_cytho[] = "BaseRecordCodec.__setstate_cython__";
static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
static const char __pyx_k_CodecPythonOverride___reduce_cyt[] = "CodecPythonOverride.__reduce_cython__";
static const char __pyx_k_CodecPythonOverride___setstate_c[] = "CodecPythonOverride.__setstate_cython__";
static const char __pyx_k_CodecsRegistry___setstate_cython[] = "CodecsRegistry.__setstate_cython__";
static const char __pyx_k_EdegDBCodecContext___reduce_cyth[] = "EdegDBCodecContext.__reduce_cython__";
static const char __pyx_k_EdegDBCodecContext___setstate_cy[] = "EdegDBCodecContext.__setstate_cython__";
static const char __pyx_k_EdegDBCodecContext_get_text_code[] = "EdegDBCodecContext.get_text_codec";
static const char __pyx_k_EmptyTupleCodec___setstate_cytho[] = "EmptyTupleCodec.__setstate_cython__";
static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
static const char __pyx_k_ExecuteContext___setstate_cython[] = "ExecuteContext.__setstate_cython__";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())";
static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
static const char __pyx_k_MultiRangeCodec___setstate_cytho[] = "MultiRangeCodec.__setstate_cython__";
static const char __pyx_k_NamedTupleCodec___setstate_cytho[] = "NamedTupleCodec.__setstate_cython__";
static const char __pyx_k_ObjectCodec__make_missing_args_e[] = "ObjectCodec._make_missing_args_error_message";
static const char __pyx_k_ObjectCodec_get_dataclass_fields[] = "ObjectCodec.get_dataclass_fields";
static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
static const char __pyx_k_SansIOProtocolBackwardsCompatibl[] = "SansIOProtocolBackwardsCompatible._legacy_parse";
static const char __pyx_k_SansIOProtocol___setstate_cython[] = "SansIOProtocol.__setstate_cython__";
static const char __pyx_k_SansIOProtocol_is_in_transaction[] = "SansIOProtocol.is_in_transaction";
static const char __pyx_k_SansIOProtocol_wait_for_disconne[] = "SansIOProtocol.wait_for_disconnect";
static const char __pyx_k_Time_zones_are_not_available_fro[] = "Time zones are not available from the C-API.";
static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
static const char __pyx_k_a_datetime_datetime_object_was_e[] = "a datetime.datetime object was expected, got ";
static const char __pyx_k_a_dict_or_Mapping_expected_got_t[] = "a dict or Mapping expected (got type {!r})";
static const char __pyx_k_a_naive_date_object_tzinfo_is_No[] = "a naive date object (tzinfo is None) was expected";
static const char __pyx_k_a_naive_datetime_object_tzinfo_i[] = "a naive datetime object (tzinfo is None) was expected";
static const char __pyx_k_a_naive_time_object_tzinfo_is_No[] = "a naive time object (tzinfo is None) was expected";
static const char __pyx_k_a_scalar_codec_expected_for_base[] = "a scalar codec expected for base scalar type, got ";
static const char __pyx_k_a_sized_iterable_container_expec[] = "a sized iterable container expected (got type {!r})";
static const char __pyx_k_a_sized_iterable_container_or_ma[] = "a sized iterable container or mapping expected (got type {!r})";
static const char __pyx_k_a_timezone_aware_datetime_object[] = "a timezone-aware datetime object (tzinfo is not None) was expected";
static const char __pyx_k_argument_tuples_do_not_support_o[] = "argument tuples do not support objects";
static const char __pyx_k_c1a50ff8_fded_48b0_85c2_4905a848[] = "c1a50ff8-fded-48b0-85c2-4905a8481433";
static const char __pyx_k_cannot_decode_NamedTuple_expecte[] = "cannot decode NamedTuple: expected ";
static const char __pyx_k_cannot_decode_empty_Tuple_expect[] = "cannot decode empty Tuple: expected 0 elements, got ";
static const char __pyx_k_cannot_encode_empty_Tuple_expect[] = "cannot encode empty Tuple: expected a tuple, got ";
static const char __pyx_k_cannot_handle_arrays_with_more_t[] = "cannot handle arrays with more than one dimension";
static const char __pyx_k_cannot_not_build_codec_empty_typ[] = "cannot not build codec; empty type desc";
static const char __pyx_k_codecs_are_not_supposed_to_be_in[] = "codecs are not supposed to be instantiated directly";
static const char __pyx_k_date_duration_has_non_zero_micro[] = "date duration has non-zero microseconds";
static const char __pyx_k_either_positional_or_named_argum[] = "either positional or named arguments are supported; not both";
static const char __pyx_k_elements_in_a_sparse_vector_cann[] = "elements in a sparse vector cannot be 0";
static const char __pyx_k_expected_SASLContinue_from_the_s[] = "expected SASLContinue from the server, received ";
static const char __pyx_k_expected_SASLFinal_from_the_serv[] = "expected SASLFinal from the server, received ";
static const char __pyx_k_expected_a_two_dimensional_array[] = "expected a two-dimensional array for a set of arrays";
static const char __pyx_k_expected_no_positional_arguments[] = "expected no positional arguments";
static const char __pyx_k_gel_protocol_codecs_namedtuple_p[] = "gel/protocol/./codecs/./namedtuple.pyx";
static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
static const char __pyx_k_invalid_array_element_at_index_N[] = "invalid array element at index {}: None is not allowed";
static const char __pyx_k_invalid_input_for_query_argument[] = "invalid input for query argument ${n}: {v} ({msg})";
static const char __pyx_k_invalid_input_for_state_argument[] = "invalid input for state argument  ";
static const char __pyx_k_invalid_number_of_columns_expect[] = "invalid number of columns: expected 1 got ";
static const char __pyx_k_maxsize_is_expected_to_be_greate[] = "maxsize is expected to be greater than 0, got ";
static const char __pyx_k_no_codec_implementation_for_Edge[] = "no codec implementation for EdgeDB data class ";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_non_zero_reserved_bytes_in_durat[] = "non-zero reserved bytes in duration";
static const char __pyx_k_only_1_dimensional_arrays_are_su[] = "only 1-dimensional arrays are supported";
static const char __pyx_k_only_arrays_of_scalars_are_suppo[] = "only arrays of scalars are supported (got type {!r})";
static const char __pyx_k_only_scalar_multiranges_are_supp[] = "only scalar multiranges are supported (got type ";
static const char __pyx_k_only_scalar_ranges_are_supported[] = "only scalar ranges are supported (got type {!r})";
static const char __pyx_k_server_SCRAM_proof_does_not_matc[] = "server SCRAM proof does not match";
static const char __pyx_k_size_of_encoded_multirange_datum[] = "size of encoded multirange datum exceeds the maximum allowed ";
static const char __pyx_k_the_connection_has_been_closed_b[] = "the connection has been closed because an operation was cancelled on it";
static const char __pyx_k_the_server_offered_the_following[] = "the server offered the following SASL authentication methods: ";
static const char __pyx_k_the_server_requested_SASL_authen[] = "the server requested SASL authentication but did not offer any methods";
static const char __pyx_k_the_server_requested_an_unsuppor[] = "the server requested an unsupported version of the protocol: ";
static const char __pyx_k_too_many_elements_in_array_value[] = "too many elements in array value";
static const char __pyx_k_too_many_elements_in_vector_valu[] = "too many elements in vector value";
static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static const char __pyx_k_unexpected_NULL_element_in_multi[] = "unexpected NULL element in multirange value";
static const char __pyx_k_unexpected_NULL_value_in_array_s[] = "unexpected NULL value in array set element ";
static const char __pyx_k_unexpected_trailing_data_in_buff[] = "unexpected trailing data in buffer after tuple element decoding: ";
static const char __pyx_k_unexpected_trailing_data_in_type[] = "unexpected trailing data in type descriptor datum";
static const char __pyx_k_unsupported_authentication_metho[] = "unsupported authentication method requested by the server: ";
static const char __pyx_k_00000000_0000_0000_0000_00000000_2[] = "00000000-0000-0000-0000-000000000002";
static const char __pyx_k_00000000_0000_0000_0000_00000000_3[] = "00000000-0000-0000-0000-0000000000f0";
static const char __pyx_k_00000000_0000_0000_0000_00000000_4[] = "00000000-0000-0000-0000-0000000000ff";
static const char __pyx_k_00000000_0000_0000_0000_00000000_5[] = "00000000-0000-0000-0000-000000000100";
static const char __pyx_k_00000000_0000_0000_0000_00000000_6[] = "00000000-0000-0000-0000-000000000101";
static const char __pyx_k_00000000_0000_0000_0000_00000000_7[] = "00000000-0000-0000-0000-000000000102";
static const char __pyx_k_00000000_0000_0000_0000_00000000_8[] = "00000000-0000-0000-0000-000000000103";
static const char __pyx_k_00000000_0000_0000_0000_00000000_9[] = "00000000-0000-0000-0000-000000000104";
static const char __pyx_k_00000000_0000_0000_0000_00000100_2[] = "00000000-0000-0000-0000-000001000002";
static const char __pyx_k_00000000_0000_0000_0000_00000100_3[] = "00000000-0000-0000-0000-000001000003";
static const char __pyx_k_00000000_0000_0000_0000_00000100_4[] = "00000000-0000-0000-0000-000001000004";
static const char __pyx_k_00000000_0000_0000_0000_00000100_5[] = "00000000-0000-0000-0000-000001000005";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_3[] = "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_4[] = "Incompatible checksums (0x%x vs (0xd998748, 0x6ca3226, 0x324635c) = (base_codec_overrides, codecs, codecs_build_cache))";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_5[] = "Incompatible checksums (0x%x vs (0x3eeaf27, 0x20daed4, 0x7646152) = (allow_capabilities, annotations, args, capabilities, cardinality, expect_one, implicit_limit, in_dc, inline_typeids, inline_typenames, input_language, kwargs, out_dc, output_format, qc, query, reg, required_one, state, warnings))";
static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_6[] = "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))";
static const char __pyx_k_SansIOProtocolBackwardsCompatibl_2[] = "SansIOProtocolBackwardsCompatible._legacy_execute";
static const char __pyx_k_SansIOProtocolBackwardsCompatibl_3[] = "SansIOProtocolBackwardsCompatible._legacy_optimistic_execute";
static const char __pyx_k_SansIOProtocolBackwardsCompatibl_4[] = "SansIOProtocolBackwardsCompatible.legacy_execute_anonymous";
static const char __pyx_k_SansIOProtocolBackwardsCompatibl_5[] = "SansIOProtocolBackwardsCompatible.legacy_simple_query";
static const char __pyx_k_SansIOProtocolBackwardsCompatibl_6[] = "SansIOProtocolBackwardsCompatible";
static const char __pyx_k_SansIOProtocolBackwardsCompatibl_7[] = "SansIOProtocolBackwardsCompatible.__reduce_cython__";
static const char __pyx_k_SansIOProtocolBackwardsCompatibl_8[] = "SansIOProtocolBackwardsCompatible.__setstate_cython__";
static const char __pyx_k_a_datetime_datetime_object_was_e_2[] = "a datetime.datetime object was expected";
static const char __pyx_k_a_sized_iterable_container_expec_2[] = "a sized iterable container expected (got type ";
static const char __pyx_k_cannot_encode_empty_Tuple_expect_2[] = "cannot encode empty Tuple: expected 0 elements, got ";
static const char __pyx_k_invalid_input_for_query_argument_2[] = "invalid input for query argument $";
static const char __pyx_k_unexpected_trailing_data_in_buff_2[] = "unexpected trailing data in buffer after named tuple element decoding: ";
static const char __pyx_k_unexpected_trailing_data_in_buff_3[] = "unexpected trailing data in buffer after object element decoding: ";
static const char __pyx_k_unexpected_trailing_data_in_buff_4[] = "unexpected trailing data in buffer after array element decoding: ";
static const char __pyx_k_unexpected_trailing_data_in_buff_5[] = "unexpected trailing data in buffer after range bound decoding: ";
static const char __pyx_k_unexpected_trailing_data_in_buff_6[] = "unexpected trailing data in buffer after multirange element decoding: ";
static const char __pyx_k_unexpected_trailing_data_in_buff_7[] = "unexpected trailing data in buffer after set element decoding: ";
static const char __pyx_k_unexpected_trailing_data_in_buff_8[] = "unexpected trailing data in buffer after record element decoding: ";
static const char __pyx_k_unexpected_trailing_data_in_buff_9[] = "unexpected trailing data in buffer after data message decoding: ";
static const char __pyx_k_00000000_0000_0000_0000_00000000_10[] = "00000000-0000-0000-0000-000000000105";
static const char __pyx_k_00000000_0000_0000_0000_00000000_11[] = "00000000-0000-0000-0000-000000000106";
static const char __pyx_k_00000000_0000_0000_0000_00000000_12[] = "00000000-0000-0000-0000-000000000107";
static const char __pyx_k_00000000_0000_0000_0000_00000000_13[] = "00000000-0000-0000-0000-000000000108";
static const char __pyx_k_00000000_0000_0000_0000_00000000_14[] = "00000000-0000-0000-0000-000000000109";
static const char __pyx_k_00000000_0000_0000_0000_00000000_15[] = "00000000-0000-0000-0000-00000000010a";
static const char __pyx_k_00000000_0000_0000_0000_00000000_16[] = "00000000-0000-0000-0000-00000000010b";
static const char __pyx_k_00000000_0000_0000_0000_00000000_17[] = "00000000-0000-0000-0000-00000000010c";
static const char __pyx_k_00000000_0000_0000_0000_00000000_18[] = "00000000-0000-0000-0000-00000000010d";
static const char __pyx_k_00000000_0000_0000_0000_00000000_19[] = "00000000-0000-0000-0000-00000000010e";
static const char __pyx_k_00000000_0000_0000_0000_00000000_20[] = "00000000-0000-0000-0000-00000000010f";
static const char __pyx_k_00000000_0000_0000_0000_00000000_21[] = "00000000-0000-0000-0000-000000000110";
static const char __pyx_k_00000000_0000_0000_0000_00000000_22[] = "00000000-0000-0000-0000-000000000111";
static const char __pyx_k_00000000_0000_0000_0000_00000000_23[] = "00000000-0000-0000-0000-000000000112";
static const char __pyx_k_00000000_0000_0000_0000_00000000_24[] = "00000000-0000-0000-0000-000000000130";
static const char __pyx_k_00000000_0000_0000_0000_00000000_25[] = "00000000-0000-0000-0000-000000000140";
/* #### Code section: decls ### */
static int __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_parents, PyObject *__pyx_v_dct); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase_4__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_FlagBase___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_FlagBase_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8EnumBase_14__Pyx_FlagBase_4__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_10LRUMapping___init__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_maxsize); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_2__getitem__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_4__setitem__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_o); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_6__delitem__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_8__contains__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static Py_ssize_t __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_10__len__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_12__iter__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_14clear(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_16__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_18__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_9BaseCodec___init__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_9BaseCodec_2__cinit__(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9BaseCodec_4make_type(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9BaseCodec_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9BaseCodec_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_9NullCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9NullCodec_2make_type(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9NullCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9NullCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_2get_text_codec(struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_11ScalarCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10TupleCodec_9make_type_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10TupleCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10TupleCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10TupleCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec__make_missing_args_error_message(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_2get_dataclass_fields(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_4make_type(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_10RangeCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10RangeCodec_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10RangeCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_10RangeCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_8SetCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self, PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_8SetCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_8SetCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9EnumCodec_9make_type_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9EnumCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_describe_context); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9EnumCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_9EnumCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11RecordCodec___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_11RecordCodec_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry___init__(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_cache_size); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_2clear_cache(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_4set_type_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_typeid, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_6__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_8__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext___init__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg, struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_qc, enum __pyx_t_3gel_8protocol_8protocol_InputLanguage __pyx_v_input_language, enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format, PyObject *__pyx_v_expect_one, PyObject *__pyx_v_required_one, PyObject *__pyx_v_implicit_limit, PyObject *__pyx_v_inline_typenames, PyObject *__pyx_v_inline_typeids, PyObject *__pyx_v_allow_capabilities, PyObject *__pyx_v_state, PyObject *__pyx_v_annotations); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_11cardinality___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_5in_dc___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_6out_dc___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_12capabilities___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_8warnings___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_2__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_4__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol___init__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_con_params); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_2get_settings(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_4is_in_transaction(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_6set_connection(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_con); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_8abort(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_10wait_for_message(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_13try_recv_eagerly(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_16wait_for_connect(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_19wait_for_disconnect(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_22_parse(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_25_execute(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_28execute(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_31query(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_34dump(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_header_callback, PyObject *__pyx_v_block_callback); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_37_sync(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_40ping(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_43restore(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_header, PyObject *__pyx_v_data_gen); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_46terminate(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_48connect(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_51_auth_sasl(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9connected___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9cancelled___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_10con_params___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_11last_status___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_12last_details___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_17last_capabilities___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_16protocol_version___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9is_legacy___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_54__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_56__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible__legacy_parse(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, PyObject *__pyx_v_query, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg, enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format, PyObject *__pyx_v_expect_one, PyObject *__pyx_v_required_one, PyObject *__pyx_v_implicit_limit, PyObject *__pyx_v_inline_typenames, PyObject *__pyx_v_inline_typeids, PyObject *__pyx_v_allow_capabilities); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_3_legacy_execute(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_6_legacy_optimistic_execute(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_9legacy_execute_anonymous(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_12legacy_simple_query(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_capabilities); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_15__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_17__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol___pyx_unpickle_LRUMapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_2__pyx_unpickle_CodecsRegistry(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_4__pyx_unpickle_ExecuteContext(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_6__pyx_unpickle_SansIOProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_3gel_8protocol_8protocol_8__pyx_unpickle_SansIOProtocolBackwardsCompatible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_LRUMapping(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_CodecPythonOverride(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_BaseRecordCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_EmptyTupleCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_NullCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_BaseNamedRecordCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_EdegDBCodecContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_ScalarCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_TupleCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_NamedTupleCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_ObjectCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_BaseArrayCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_ArrayCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_RangeCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_MultiRangeCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_SetCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_EnumCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_RecordCodec(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_CodecsRegistry(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_ExecuteContext(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocol(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct__make_type(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_7__parse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_8__execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_9_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_10_query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_11_dump(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_12__sync(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_13_ping(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_14_restore(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_15_connect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_update = {0, 0, 0, 0, 0};
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4type_type;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_7cpython_8datetime_date;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_time;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta;
  PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer;
  PyTypeObject *__pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer;
  PyTypeObject *__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  PyTypeObject *__pyx_ptype_3gel_9datatypes_9datatypes_RelativeDuration;
  PyTypeObject *__pyx_ptype_3gel_9datatypes_9datatypes_DateDuration;
  PyTypeObject *__pyx_ptype_3gel_9datatypes_9datatypes_ConfigMemory;
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  #endif
  #if CYTHON_USE_MODULE_STATE
  PyObject *__pyx_type_3gel_8protocol_8protocol_LRUMapping;
  PyObject *__pyx_type_3gel_8protocol_8protocol_BaseCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_CodecPythonOverride;
  PyObject *__pyx_type_3gel_8protocol_8protocol_BaseRecordCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_NullCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext;
  PyObject *__pyx_type_3gel_8protocol_8protocol_ScalarCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_TupleCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_NamedTupleCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_ObjectCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_BaseArrayCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_ArrayCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_RangeCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_MultiRangeCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_SetCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_EnumCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_RecordCodec;
  PyObject *__pyx_type_3gel_8protocol_8protocol_CodecsRegistry;
  PyObject *__pyx_type_3gel_8protocol_8protocol_ExecuteContext;
  PyObject *__pyx_type_3gel_8protocol_8protocol_SansIOProtocol;
  PyObject *__pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous;
  PyObject *__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query;
  PyObject *__Pyx_EnumMeta;
  PyObject *__pyx_type___pyx_array;
  PyObject *__pyx_type___pyx_MemviewEnum;
  PyObject *__pyx_type___pyx_memoryview;
  PyObject *__pyx_type___pyx_memoryviewslice;
  #endif
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_LRUMapping;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_NullCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_TupleCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_RangeCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_SetCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_EnumCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_RecordCodec;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous;
  PyTypeObject *__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query;
  PyTypeObject *__pyx_ptype___Pyx_EnumMeta;
  PyTypeObject *__pyx_array_type;
  PyTypeObject *__pyx_MemviewEnum_type;
  PyTypeObject *__pyx_memoryview_type;
  PyTypeObject *__pyx_memoryviewslice_type;
  PyObject *__pyx_kp_b_;
  PyObject *__pyx_kp_s_;
  PyObject *__pyx_kp_u_;
  PyObject *__pyx_kp_u_0000;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_10;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_11;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_12;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_13;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_14;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_15;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_16;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_17;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_18;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_19;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_2;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_20;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_21;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_22;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_23;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_24;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_25;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_3;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_4;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_5;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_6;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_7;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_8;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000000_9;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000100;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000100_2;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000100_3;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000100_4;
  PyObject *__pyx_kp_u_00000000_0000_0000_0000_00000100_5;
  PyObject *__pyx_kp_u_003e434d_cac2_430a_b238_fb39d734;
  PyObject *__pyx_kp_u_44c901c0_d922_4894_83c8_061bd05e;
  PyObject *__pyx_kp_u_4ba84534_188e_43b4_a7ce_cea2af0f;
  PyObject *__pyx_kp_u_4d738878_3a5f_4821_ab76_9d8e7d6b;
  PyObject *__pyx_kp_u_7fae5536_6311_4f60_8eb9_096a5d97;
  PyObject *__pyx_kp_u_9565dd88_04f5_11ee_a691_0b6ebe17;
  PyObject *__pyx_n_s_ALL;
  PyObject *__pyx_n_s_ALL_CAPABILITIES;
  PyObject *__pyx_n_s_ASCII;
  PyObject *__pyx_n_s_AT_LEAST_ONE;
  PyObject *__pyx_n_s_AT_MOST_ONE;
  PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
  PyObject *__pyx_n_u_Array;
  PyObject *__pyx_n_s_ArrayCodec;
  PyObject *__pyx_n_s_ArrayCodec___reduce_cython;
  PyObject *__pyx_n_s_ArrayCodec___setstate_cython;
  PyObject *__pyx_n_s_ArrayCodec_make_type;
  PyObject *__pyx_n_s_ArrayType;
  PyObject *__pyx_n_s_AssertionError;
  PyObject *__pyx_n_s_AttributeError;
  PyObject *__pyx_n_s_BINARY;
  PyObject *__pyx_n_s_BaseArrayCodec;
  PyObject *__pyx_n_s_BaseArrayCodec___reduce_cython;
  PyObject *__pyx_n_s_BaseArrayCodec___setstate_cython;
  PyObject *__pyx_n_s_BaseCodec;
  PyObject *__pyx_n_s_BaseCodec___reduce_cython;
  PyObject *__pyx_n_s_BaseCodec___setstate_cython;
  PyObject *__pyx_n_s_BaseCodec_make_type;
  PyObject *__pyx_n_s_BaseNamedRecordCodec;
  PyObject *__pyx_n_s_BaseNamedRecordCodec___reduce_cy;
  PyObject *__pyx_n_s_BaseNamedRecordCodec___setstate;
  PyObject *__pyx_n_s_BaseRecordCodec;
  PyObject *__pyx_n_s_BaseRecordCodec___reduce_cython;
  PyObject *__pyx_n_s_BaseRecordCodec___setstate_cytho;
  PyObject *__pyx_n_s_BaseScalarType;
  PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
  PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
  PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
  PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
  PyObject *__pyx_kp_u_Cannot_index_with_type;
  PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
  PyObject *__pyx_n_s_Capability;
  PyObject *__pyx_n_s_Cardinality;
  PyObject *__pyx_n_s_ClientConnectionClosedError;
  PyObject *__pyx_n_s_ClientConnectionError;
  PyObject *__pyx_n_s_ClientError;
  PyObject *__pyx_n_s_CodecPythonOverride;
  PyObject *__pyx_n_s_CodecPythonOverride___reduce_cyt;
  PyObject *__pyx_n_s_CodecPythonOverride___setstate_c;
  PyObject *__pyx_n_s_CodecPythonOverride_make_type;
  PyObject *__pyx_n_s_CodecsRegistry;
  PyObject *__pyx_n_s_CodecsRegistry___reduce_cython;
  PyObject *__pyx_n_s_CodecsRegistry___setstate_cython;
  PyObject *__pyx_n_s_CodecsRegistry_clear_cache;
  PyObject *__pyx_n_s_CodecsRegistry_set_type_codec;
  PyObject *__pyx_n_s_CompilationFlag;
  PyObject *__pyx_n_s_Decimal;
  PyObject *__pyx_n_u_DerivedEnumValue;
  PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
  PyObject *__pyx_n_s_EDGEQL;
  PyObject *__pyx_n_s_EDGE_POINTER_IS_LINKPROP;
  PyObject *__pyx_n_s_EMPTY_NULL_DATA;
  PyObject *__pyx_n_s_EMPTY_RECORD_DATA;
  PyObject *__pyx_n_s_EdegDBCodecContext;
  PyObject *__pyx_n_s_EdegDBCodecContext___reduce_cyth;
  PyObject *__pyx_n_s_EdegDBCodecContext___setstate_cy;
  PyObject *__pyx_n_s_EdegDBCodecContext_get_text_code;
  PyObject *__pyx_n_s_EdgeDBError;
  PyObject *__pyx_n_s_EdgeDBMessage;
  PyObject *__pyx_n_s_Element;
  PyObject *__pyx_n_s_ElementKind;
  PyObject *__pyx_n_s_Ellipsis;
  PyObject *__pyx_n_s_EmptyTupleCodec;
  PyObject *__pyx_n_s_EmptyTupleCodec___reduce_cython;
  PyObject *__pyx_n_s_EmptyTupleCodec___setstate_cytho;
  PyObject *__pyx_n_s_EmptyTupleCodec_make_type;
  PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
  PyObject *__pyx_n_u_Enum;
  PyObject *__pyx_n_s_EnumBase;
  PyObject *__pyx_n_s_EnumCodec;
  PyObject *__pyx_n_s_EnumCodec___reduce_cython;
  PyObject *__pyx_n_s_EnumCodec___setstate_cython;
  PyObject *__pyx_n_s_EnumCodec_make_type;
  PyObject *__pyx_n_s_EnumMeta;
  PyObject *__pyx_n_s_EnumType;
  PyObject *__pyx_n_s_EnumValue;
  PyObject *__pyx_n_s_ExecuteContext;
  PyObject *__pyx_n_s_ExecuteContext___reduce_cython;
  PyObject *__pyx_n_s_ExecuteContext___setstate_cython;
  PyObject *__pyx_n_s_FIELD;
  PyObject *__pyx_n_u_H;
  PyObject *__pyx_n_s_INJECT_OUTPUT_OBJECT_IDS;
  PyObject *__pyx_n_s_INJECT_OUTPUT_TYPE_IDS;
  PyObject *__pyx_n_s_INJECT_OUTPUT_TYPE_NAMES;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_4;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_5;
  PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_6;
  PyObject *__pyx_n_s_IndexError;
  PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
  PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
  PyObject *__pyx_n_s_InputLanguage;
  PyObject *__pyx_n_s_IntEnum;
  PyObject *__pyx_n_s_IntFlag;
  PyObject *__pyx_n_s_InterfaceError;
  PyObject *__pyx_n_s_InvalidArgumentError;
  PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
  PyObject *__pyx_kp_u_Invalid_shape_in_axis;
  PyObject *__pyx_n_s_Iterable;
  PyObject *__pyx_n_s_IterableABC;
  PyObject *__pyx_n_s_JSON;
  PyObject *__pyx_n_s_JSON_ELEMENTS;
  PyObject *__pyx_n_s_KeyError;
  PyObject *__pyx_n_s_LINK;
  PyObject *__pyx_n_s_LINK_PROPERTY;
  PyObject *__pyx_n_s_LRUMapping;
  PyObject *__pyx_n_s_LRUMapping___reduce_cython;
  PyObject *__pyx_n_s_LRUMapping___setstate_cython;
  PyObject *__pyx_n_s_LRUMapping_clear;
  PyObject *__pyx_n_s_LookupError;
  PyObject *__pyx_n_s_MANY;
  PyObject *__pyx_n_s_Mapping;
  PyObject *__pyx_n_s_MappingABC;
  PyObject *__pyx_n_s_MappingProxyType;
  PyObject *__pyx_n_s_MemoryError;
  PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
  PyObject *__pyx_kp_s_MemoryView_of_r_object;
  PyObject *__pyx_n_s_MultiRange;
  PyObject *__pyx_n_u_MultiRange;
  PyObject *__pyx_n_s_MultiRangeCodec;
  PyObject *__pyx_n_s_MultiRangeCodec___reduce_cython;
  PyObject *__pyx_n_s_MultiRangeCodec___setstate_cytho;
  PyObject *__pyx_n_s_MultiRangeCodec_make_type;
  PyObject *__pyx_n_s_MultiRangeType;
  PyObject *__pyx_n_s_NONE;
  PyObject *__pyx_n_s_NO_RESULT;
  PyObject *__pyx_n_u_NamedTuple;
  PyObject *__pyx_n_s_NamedTupleCodec;
  PyObject *__pyx_n_s_NamedTupleCodec___reduce_cython;
  PyObject *__pyx_n_s_NamedTupleCodec___setstate_cytho;
  PyObject *__pyx_n_s_NamedTupleCodec_make_type;
  PyObject *__pyx_n_s_NamedTupleType;
  PyObject *__pyx_n_s_NoDataError;
  PyObject *__pyx_kp_u_None;
  PyObject *__pyx_n_s_NotImplementedError;
  PyObject *__pyx_n_s_NullCodec;
  PyObject *__pyx_n_s_NullCodec___reduce_cython;
  PyObject *__pyx_n_s_NullCodec___setstate_cython;
  PyObject *__pyx_n_s_NullCodec_make_type;
  PyObject *__pyx_n_b_O;
  PyObject *__pyx_n_s_ONE;
  PyObject *__pyx_n_u_Object;
  PyObject *__pyx_n_s_ObjectCodec;
  PyObject *__pyx_n_s_ObjectCodec___reduce_cython;
  PyObject *__pyx_n_s_ObjectCodec___setstate_cython;
  PyObject *__pyx_n_s_ObjectCodec__make_missing_args_e;
  PyObject *__pyx_n_s_ObjectCodec_get_dataclass_fields;
  PyObject *__pyx_n_s_ObjectCodec_make_type;
  PyObject *__pyx_n_s_ObjectType;
  PyObject *__pyx_n_s_OrderedDict;
  PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
  PyObject *__pyx_n_s_OutputFormat;
  PyObject *__pyx_n_s_OverflowError;
  PyObject *__pyx_n_s_PROPERTY;
  PyObject *__pyx_n_s_ParameterTypeMismatchError;
  PyObject *__pyx_n_s_PickleError;
  PyObject *__pyx_n_s_ProtocolError;
  PyObject *__pyx_kp_u_Python_override;
  PyObject *__pyx_n_s_Pyx_EnumBase;
  PyObject *__pyx_n_s_Pyx_EnumBase___new;
  PyObject *__pyx_n_s_Pyx_EnumBase___repr;
  PyObject *__pyx_n_s_Pyx_EnumBase___str;
  PyObject *__pyx_n_s_Pyx_EnumMeta___reduce_cython;
  PyObject *__pyx_n_s_Pyx_EnumMeta___setstate_cython;
  PyObject *__pyx_n_s_Pyx_FlagBase;
  PyObject *__pyx_n_s_Pyx_FlagBase___new;
  PyObject *__pyx_n_s_Pyx_FlagBase___repr;
  PyObject *__pyx_n_s_Pyx_FlagBase___str;
  PyObject *__pyx_n_s_QUERY_SINGLE_METHOD;
  PyObject *__pyx_n_s_QueryArgumentError;
  PyObject *__pyx_n_s_Range;
  PyObject *__pyx_n_u_Range;
  PyObject *__pyx_n_s_RangeCodec;
  PyObject *__pyx_n_s_RangeCodec___reduce_cython;
  PyObject *__pyx_n_s_RangeCodec___setstate_cython;
  PyObject *__pyx_n_s_RangeCodec_make_type;
  PyObject *__pyx_n_s_RangeType;
  PyObject *__pyx_n_u_Record;
  PyObject *__pyx_n_s_RecordCodec;
  PyObject *__pyx_n_s_RecordCodec___reduce_cython;
  PyObject *__pyx_n_s_RecordCodec___setstate_cython;
  PyObject *__pyx_n_s_ResultCardinalityMismatchError;
  PyObject *__pyx_n_s_RuntimeError;
  PyObject *__pyx_kp_b_SCRAM_SHA_256;
  PyObject *__pyx_n_s_SQL;
  PyObject *__pyx_n_s_SansIOProtocol;
  PyObject *__pyx_n_s_SansIOProtocolBackwardsCompatibl;
  PyObject *__pyx_n_s_SansIOProtocolBackwardsCompatibl_2;
  PyObject *__pyx_n_s_SansIOProtocolBackwardsCompatibl_3;
  PyObject *__pyx_n_s_SansIOProtocolBackwardsCompatibl_4;
  PyObject *__pyx_n_s_SansIOProtocolBackwardsCompatibl_5;
  PyObject *__pyx_n_s_SansIOProtocolBackwardsCompatibl_6;
  PyObject *__pyx_n_s_SansIOProtocolBackwardsCompatibl_7;
  PyObject *__pyx_n_s_SansIOProtocolBackwardsCompatibl_8;
  PyObject *__pyx_n_s_SansIOProtocol___reduce_cython;
  PyObject *__pyx_n_s_SansIOProtocol___setstate_cython;
  PyObject *__pyx_n_s_SansIOProtocol__auth_sasl;
  PyObject *__pyx_n_s_SansIOProtocol__execute;
  PyObject *__pyx_n_s_SansIOProtocol__parse;
  PyObject *__pyx_n_s_SansIOProtocol__sync;
  PyObject *__pyx_n_s_SansIOProtocol_abort;
  PyObject *__pyx_n_s_SansIOProtocol_connect;
  PyObject *__pyx_n_s_SansIOProtocol_dump;
  PyObject *__pyx_n_s_SansIOProtocol_execute;
  PyObject *__pyx_n_s_SansIOProtocol_get_settings;
  PyObject *__pyx_n_s_SansIOProtocol_is_in_transaction;
  PyObject *__pyx_n_s_SansIOProtocol_ping;
  PyObject *__pyx_n_s_SansIOProtocol_query;
  PyObject *__pyx_n_s_SansIOProtocol_restore;
  PyObject *__pyx_n_s_SansIOProtocol_set_connection;
  PyObject *__pyx_n_s_SansIOProtocol_terminate;
  PyObject *__pyx_n_s_SansIOProtocol_try_recv_eagerly;
  PyObject *__pyx_n_s_SansIOProtocol_wait_for_connect;
  PyObject *__pyx_n_s_SansIOProtocol_wait_for_disconne;
  PyObject *__pyx_n_s_SansIOProtocol_wait_for_message;
  PyObject *__pyx_n_s_ScalarCodec;
  PyObject *__pyx_n_s_ScalarCodec___reduce_cython;
  PyObject *__pyx_n_s_ScalarCodec___setstate_cython;
  PyObject *__pyx_n_s_ScalarCodec_make_type;
  PyObject *__pyx_n_s_ScalarType;
  PyObject *__pyx_n_s_Sequence;
  PyObject *__pyx_n_u_Set;
  PyObject *__pyx_n_s_SetCodec;
  PyObject *__pyx_n_s_SetCodec___reduce_cython;
  PyObject *__pyx_n_s_SetCodec___setstate_cython;
  PyObject *__pyx_n_s_SetCodec_make_type;
  PyObject *__pyx_n_s_Sized;
  PyObject *__pyx_n_s_SizedABC;
  PyObject *__pyx_n_u_SparseObject;
  PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
  PyObject *__pyx_n_s_TYPE_IDS;
  PyObject *__pyx_kp_u_Time_zones_are_not_available_fro;
  PyObject *__pyx_n_u_Tuple;
  PyObject *__pyx_n_s_TupleCodec;
  PyObject *__pyx_n_s_TupleCodec___reduce_cython;
  PyObject *__pyx_n_s_TupleCodec___setstate_cython;
  PyObject *__pyx_n_s_TupleCodec_make_type;
  PyObject *__pyx_n_s_TupleType;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_n_s_UUID;
  PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
  PyObject *__pyx_kp_s_Unknown_enum_value_s;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_n_s_View_MemoryView;
  PyObject *__pyx_kp_u__13;
  PyObject *__pyx_kp_b__154;
  PyObject *__pyx_kp_b__156;
  PyObject *__pyx_kp_b__157;
  PyObject *__pyx_kp_u__17;
  PyObject *__pyx_kp_u__18;
  PyObject *__pyx_kp_u__19;
  PyObject *__pyx_kp_u__20;
  PyObject *__pyx_kp_u__21;
  PyObject *__pyx_n_s__241;
  PyObject *__pyx_n_s__254;
  PyObject *__pyx_kp_u__3;
  PyObject *__pyx_kp_u__33;
  PyObject *__pyx_kp_u__4;
  PyObject *__pyx_kp_u__48;
  PyObject *__pyx_n_s__5;
  PyObject *__pyx_kp_u__65;
  PyObject *__pyx_kp_u__8;
  PyObject *__pyx_kp_u__80;
  PyObject *__pyx_kp_u__9;
  PyObject *__pyx_kp_u_a_datetime_datetime_object_was_e;
  PyObject *__pyx_kp_u_a_datetime_datetime_object_was_e_2;
  PyObject *__pyx_kp_u_a_dict_or_Mapping_expected_got_t;
  PyObject *__pyx_kp_u_a_naive_date_object_tzinfo_is_No;
  PyObject *__pyx_kp_u_a_naive_datetime_object_tzinfo_i;
  PyObject *__pyx_kp_u_a_naive_time_object_tzinfo_is_No;
  PyObject *__pyx_kp_u_a_scalar_codec_expected_for_base;
  PyObject *__pyx_kp_u_a_sized_iterable_container_expec;
  PyObject *__pyx_kp_u_a_sized_iterable_container_expec_2;
  PyObject *__pyx_kp_u_a_sized_iterable_container_or_ma;
  PyObject *__pyx_kp_u_a_str_or_gel_EnumValue___tid;
  PyObject *__pyx_kp_u_a_timezone_aware_datetime_object;
  PyObject *__pyx_n_s_abc;
  PyObject *__pyx_n_s_abort;
  PyObject *__pyx_n_u_acceptable;
  PyObject *__pyx_n_s_aiter;
  PyObject *__pyx_n_s_allocate_buffer;
  PyObject *__pyx_n_s_allow_capabilities;
  PyObject *__pyx_kp_u_already_connected;
  PyObject *__pyx_kp_u_and;
  PyObject *__pyx_n_s_anext;
  PyObject *__pyx_n_s_annotations;
  PyObject *__pyx_n_u_anytuple;
  PyObject *__pyx_n_u_anytype;
  PyObject *__pyx_n_s_append;
  PyObject *__pyx_n_s_args;
  PyObject *__pyx_kp_u_argument;
  PyObject *__pyx_kp_u_argument_tuples_do_not_support_o;
  PyObject *__pyx_kp_u_arguments;
  PyObject *__pyx_n_s_array;
  PyObject *__pyx_kp_u_as_it_does_not_return_any_data;
  PyObject *__pyx_kp_u_as_it_may_return_more_than_one;
  PyObject *__pyx_n_s_asyncio;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_n_s_asyncio_tasks;
  PyObject *__pyx_kp_u_attribute;
  PyObject *__pyx_n_s_attrs;
  PyObject *__pyx_n_s_attrs_2;
  PyObject *__pyx_n_s_auth_sasl;
  PyObject *__pyx_n_s_await;
  PyObject *__pyx_kp_u_bad_bigint_sign_data;
  PyObject *__pyx_n_s_base;
  PyObject *__pyx_kp_u_base_scalar_codec_for;
  PyObject *__pyx_n_s_base_type;
  PyObject *__pyx_n_s_basecodec;
  PyObject *__pyx_n_u_big;
  PyObject *__pyx_kp_u_bigint_data_has_fractional_part;
  PyObject *__pyx_n_s_bint;
  PyObject *__pyx_n_s_block_callback;
  PyObject *__pyx_n_s_bool;
  PyObject *__pyx_n_s_buf;
  PyObject *__pyx_n_s_build_client_final_message;
  PyObject *__pyx_n_s_build_client_first_message;
  PyObject *__pyx_n_s_bytes;
  PyObject *__pyx_kp_u_bytes_2;
  PyObject *__pyx_n_s_bytes_3;
  PyObject *__pyx_n_s_byteswap;
  PyObject *__pyx_n_s_c;
  PyObject *__pyx_n_u_c;
  PyObject *__pyx_kp_u_c1a50ff8_fded_48b0_85c2_4905a848;
  PyObject *__pyx_n_s_cache_size;
  PyObject *__pyx_kp_u_cal_date_duration;
  PyObject *__pyx_kp_u_cal_local_date;
  PyObject *__pyx_kp_u_cal_local_datetime;
  PyObject *__pyx_kp_u_cal_local_time;
  PyObject *__pyx_kp_u_cal_relative_duration;
  PyObject *__pyx_kp_u_cannot_decode_NamedTuple_expecte;
  PyObject *__pyx_kp_u_cannot_decode_Object_expected;
  PyObject *__pyx_kp_u_cannot_decode_Record_expected;
  PyObject *__pyx_kp_u_cannot_decode_Tuple_expected;
  PyObject *__pyx_kp_u_cannot_decode_empty_Tuple_expect;
  PyObject *__pyx_kp_u_cannot_encode_empty_Tuple_expect;
  PyObject *__pyx_kp_u_cannot_encode_empty_Tuple_expect_2;
  PyObject *__pyx_kp_u_cannot_find_known_ID_for_type;
  PyObject *__pyx_kp_u_cannot_handle_arrays_with_more_t;
  PyObject *__pyx_kp_u_cannot_not_build_codec_empty_typ;
  PyObject *__pyx_n_s_cap_bytes;
  PyObject *__pyx_n_s_capabilities;
  PyObject *__pyx_n_s_cardinality;
  PyObject *__pyx_n_s_cause;
  PyObject *__pyx_kp_u_cfg_memory;
  PyObject *__pyx_n_s_chr;
  PyObject *__pyx_n_s_class;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_s_clear;
  PyObject *__pyx_n_s_clear_cache;
  PyObject *__pyx_n_s_client_final;
  PyObject *__pyx_n_s_client_first;
  PyObject *__pyx_n_s_client_first_bare;
  PyObject *__pyx_n_s_client_nonce;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_close;
  PyObject *__pyx_n_s_cls;
  PyObject *__pyx_n_s_code;
  PyObject *__pyx_n_s_codec;
  PyObject *__pyx_n_s_codecs;
  PyObject *__pyx_kp_u_codecs_are_not_supposed_to_be_in;
  PyObject *__pyx_n_s_collections;
  PyObject *__pyx_kp_s_collections_abc;
  PyObject *__pyx_n_s_con;
  PyObject *__pyx_n_s_con_params;
  PyObject *__pyx_n_s_connect;
  PyObject *__pyx_kp_s_contiguous_and_direct;
  PyObject *__pyx_kp_s_contiguous_and_indirect;
  PyObject *__pyx_n_s_count;
  PyObject *__pyx_n_s_ctx;
  PyObject *__pyx_n_s_data;
  PyObject *__pyx_kp_u_data_block_before_header_block;
  PyObject *__pyx_n_s_data_gen;
  PyObject *__pyx_n_s_data_received;
  PyObject *__pyx_n_s_database;
  PyObject *__pyx_n_u_database;
  PyObject *__pyx_n_s_dataclasses;
  PyObject *__pyx_n_s_datatypes;
  PyObject *__pyx_kp_u_date_duration_has_non_zero_micro;
  PyObject *__pyx_n_s_datetime;
  PyObject *__pyx_n_s_days;
  PyObject *__pyx_n_s_dct;
  PyObject *__pyx_n_s_decimal;
  PyObject *__pyx_n_s_decoder;
  PyObject *__pyx_n_s_desc_id;
  PyObject *__pyx_n_s_describe;
  PyObject *__pyx_n_s_describe_context;
  PyObject *__pyx_n_s_descriptor;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_n_s_dict_2;
  PyObject *__pyx_n_u_dim;
  PyObject *__pyx_kp_u_dim_key_is_missing;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_n_s_doc;
  PyObject *__pyx_kp_u_does_not_correspond_to_any_know;
  PyObject *__pyx_n_s_dtype_is_object;
  PyObject *__pyx_n_s_dump;
  PyObject *__pyx_kp_u_either_positional_or_named_argum;
  PyObject *__pyx_n_s_element_type;
  PyObject *__pyx_n_s_element_types;
  PyObject *__pyx_n_s_elements;
  PyObject *__pyx_kp_u_elements_got;
  PyObject *__pyx_kp_u_elements_in_a_sparse_vector_cann;
  PyObject *__pyx_kp_u_elements_in_the_tuple_got;
  PyObject *__pyx_n_s_empty;
  PyObject *__pyx_kp_u_empty_tuple;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_n_s_encode;
  PyObject *__pyx_n_s_encoder;
  PyObject *__pyx_n_s_enum;
  PyObject *__pyx_n_s_enumerate;
  PyObject *__pyx_n_s_enums;
  PyObject *__pyx_kp_s_enums_Capability;
  PyObject *__pyx_n_s_error;
  PyObject *__pyx_n_s_error_message;
  PyObject *__pyx_n_s_errors;
  PyObject *__pyx_n_s_ex;
  PyObject *__pyx_n_s_exc;
  PyObject *__pyx_n_s_execute;
  PyObject *__pyx_n_s_execute_2;
  PyObject *__pyx_n_s_expect_one;
  PyObject *__pyx_kp_u_expected;
  PyObject *__pyx_n_u_expected_2;
  PyObject *__pyx_kp_u_expected_3;
  PyObject *__pyx_kp_u_expected_SASLContinue_from_the_s;
  PyObject *__pyx_kp_u_expected_SASLFinal_from_the_serv;
  PyObject *__pyx_kp_u_expected_a_Decimal_or_an_int;
  PyObject *__pyx_kp_u_expected_a_record_with_a_single;
  PyObject *__pyx_kp_u_expected_a_two_dimensional_array;
  PyObject *__pyx_kp_u_expected_an_int;
  PyObject *__pyx_kp_u_expected_no_named_arguments;
  PyObject *__pyx_kp_u_expected_no_positional_arguments;
  PyObject *__pyx_n_s_expected_server_sig;
  PyObject *__pyx_kp_u_ext_pgvector_halfvec;
  PyObject *__pyx_kp_u_ext_pgvector_sparsevec;
  PyObject *__pyx_kp_u_ext_pgvector_vector;
  PyObject *__pyx_kp_u_ext_postgis_box2d;
  PyObject *__pyx_kp_u_ext_postgis_box3d;
  PyObject *__pyx_kp_u_ext_postgis_geography;
  PyObject *__pyx_kp_u_ext_postgis_geometry;
  PyObject *__pyx_kp_u_extra;
  PyObject *__pyx_n_s_extra_args;
  PyObject *__pyx_n_u_f;
  PyObject *__pyx_n_s_field;
  PyObject *__pyx_n_s_field_type;
  PyObject *__pyx_n_s_fields;
  PyObject *__pyx_n_u_fields;
  PyObject *__pyx_kp_u_first_message_is_not_DataMsg;
  PyObject *__pyx_n_s_flags;
  PyObject *__pyx_n_s_format;
  PyObject *__pyx_n_s_fortran;
  PyObject *__pyx_n_u_fortran;
  PyObject *__pyx_n_s_from_bytes;
  PyObject *__pyx_n_s_from_code;
  PyObject *__pyx_n_s_from_json;
  PyObject *__pyx_kp_u_fts_language;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_gel;
  PyObject *__pyx_n_u_gel;
  PyObject *__pyx_kp_u_gel_DerivedEnumValue;
  PyObject *__pyx_n_s_gel_datatypes;
  PyObject *__pyx_n_s_gel_pgproto;
  PyObject *__pyx_n_s_gel_pgproto_pgproto;
  PyObject *__pyx_kp_s_gel_protocol_codecs_array_pyx;
  PyObject *__pyx_kp_s_gel_protocol_codecs_base_pyx;
  PyObject *__pyx_kp_s_gel_protocol_codecs_codecs_pyx;
  PyObject *__pyx_kp_s_gel_protocol_codecs_enum_pyx;
  PyObject *__pyx_kp_s_gel_protocol_codecs_namedtuple_p;
  PyObject *__pyx_kp_s_gel_protocol_codecs_object_pyx;
  PyObject *__pyx_kp_s_gel_protocol_codecs_range_pyx;
  PyObject *__pyx_kp_s_gel_protocol_codecs_scalar_pyx;
  PyObject *__pyx_kp_s_gel_protocol_codecs_set_pyx;
  PyObject *__pyx_kp_s_gel_protocol_codecs_tuple_pyx;
  PyObject *__pyx_kp_s_gel_protocol_lru_pyx;
  PyObject *__pyx_n_s_gel_protocol_protocol;
  PyObject *__pyx_kp_s_gel_protocol_protocol_pyx;
  PyObject *__pyx_kp_s_gel_protocol_protocol_v0_pyx;
  PyObject *__pyx_n_s_generate_nonce;
  PyObject *__pyx_n_s_genexpr;
  PyObject *__pyx_n_s_get;
  PyObject *__pyx_n_s_get_code;
  PyObject *__pyx_n_s_get_dataclass_fields;
  PyObject *__pyx_n_s_get_pos;
  PyObject *__pyx_n_s_get_settings;
  PyObject *__pyx_n_s_get_text_codec;
  PyObject *__pyx_n_s_getstate;
  PyObject *__pyx_kp_u_got;
  PyObject *__pyx_kp_u_got_2;
  PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
  PyObject *__pyx_n_s_handshake_buf;
  PyObject *__pyx_n_s_header;
  PyObject *__pyx_kp_u_header_block_after_data_block;
  PyObject *__pyx_kp_u_header_block_was_not_received;
  PyObject *__pyx_n_s_header_callback;
  PyObject *__pyx_n_s_header_received;
  PyObject *__pyx_n_s_headers;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_n_s_id;
  PyObject *__pyx_n_s_implicit_limit;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_in_dc;
  PyObject *__pyx_n_s_in_type_id;
  PyObject *__pyx_n_s_inc_lower;
  PyObject *__pyx_n_s_inc_upper;
  PyObject *__pyx_n_s_index;
  PyObject *__pyx_n_s_index_2;
  PyObject *__pyx_n_s_init;
  PyObject *__pyx_n_s_init_subclass;
  PyObject *__pyx_n_s_initializing;
  PyObject *__pyx_n_s_inline_typeids;
  PyObject *__pyx_n_s_inline_typenames;
  PyObject *__pyx_n_s_input_language;
  PyObject *__pyx_n_s_inspect;
  PyObject *__pyx_n_s_int;
  PyObject *__pyx_kp_u_invalid_array_element;
  PyObject *__pyx_kp_u_invalid_array_element_at_index_N;
  PyObject *__pyx_kp_u_invalid_array_size_received;
  PyObject *__pyx_kp_u_invalid_buffer_length;
  PyObject *__pyx_kp_u_invalid_input_for_query_argument;
  PyObject *__pyx_kp_u_invalid_input_for_query_argument_2;
  PyObject *__pyx_kp_u_invalid_input_for_state_argument;
  PyObject *__pyx_kp_u_invalid_multirange_element;
  PyObject *__pyx_kp_u_invalid_number_of_columns_expect;
  PyObject *__pyx_kp_u_invalid_range_lower_bound;
  PyObject *__pyx_kp_u_invalid_range_upper_bound;
  PyObject *__pyx_kp_u_is_already_registered;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_n_s_is_empty;
  PyObject *__pyx_kp_u_is_expected_as_a_valid_enum_arg;
  PyObject *__pyx_n_s_is_implicit;
  PyObject *__pyx_n_s_is_in_transaction;
  PyObject *__pyx_kp_u_is_required_but_received_None;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_items;
  PyObject *__pyx_n_s_itemsize;
  PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
  PyObject *__pyx_n_s_itercount;
  PyObject *__pyx_n_s_json;
  PyObject *__pyx_n_s_k;
  PyObject *__pyx_kp_u_key;
  PyObject *__pyx_n_s_keys;
  PyObject *__pyx_n_s_kind;
  PyObject *__pyx_n_s_kwargs;
  PyObject *__pyx_n_u_l;
  PyObject *__pyx_n_s_last;
  PyObject *__pyx_n_s_legacy_execute;
  PyObject *__pyx_n_s_legacy_execute_anonymous;
  PyObject *__pyx_n_s_legacy_optimistic_execute;
  PyObject *__pyx_n_s_legacy_parse;
  PyObject *__pyx_n_s_legacy_simple_query;
  PyObject *__pyx_n_s_loads;
  PyObject *__pyx_n_s_lookup;
  PyObject *__pyx_n_s_lower;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_major;
  PyObject *__pyx_n_s_make_missing_args_error_message;
  PyObject *__pyx_n_s_make_type;
  PyObject *__pyx_n_s_make_type_locals_genexpr;
  PyObject *__pyx_n_s_maxsize;
  PyObject *__pyx_kp_u_maxsize_is_expected_to_be_greate;
  PyObject *__pyx_n_s_member_names;
  PyObject *__pyx_n_s_members;
  PyObject *__pyx_n_s_members_2;
  PyObject *__pyx_n_s_memview;
  PyObject *__pyx_n_s_metaclass;
  PyObject *__pyx_n_s_methname;
  PyObject *__pyx_n_s_method;
  PyObject *__pyx_n_s_methods;
  PyObject *__pyx_n_s_microseconds;
  PyObject *__pyx_n_s_minor;
  PyObject *__pyx_kp_u_missed;
  PyObject *__pyx_n_s_missed_args;
  PyObject *__pyx_n_s_mode;
  PyObject *__pyx_n_s_module;
  PyObject *__pyx_n_u_module;
  PyObject *__pyx_n_s_module_2;
  PyObject *__pyx_n_s_months;
  PyObject *__pyx_kp_u_more_than_one_header_block;
  PyObject *__pyx_n_s_move_to_end;
  PyObject *__pyx_n_s_mro_entries;
  PyObject *__pyx_n_s_msg;
  PyObject *__pyx_n_s_msg_buf;
  PyObject *__pyx_n_s_mtype;
  PyObject *__pyx_n_b_n;
  PyObject *__pyx_n_s_n;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_name_2;
  PyObject *__pyx_kp_u_named_tuple_dict_is_missing;
  PyObject *__pyx_kp_u_named_tuple_is_missing;
  PyObject *__pyx_n_s_ndim;
  PyObject *__pyx_kp_u_neither_are_supported;
  PyObject *__pyx_n_s_new;
  PyObject *__pyx_n_s_new_cardinality;
  PyObject *__pyx_kp_u_no_codec_implementation_for_Edge;
  PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
  PyObject *__pyx_kp_u_no_input;
  PyObject *__pyx_kp_u_non_idle_status_after_connect;
  PyObject *__pyx_kp_u_non_zero_reserved_bytes_in_durat;
  PyObject *__pyx_kp_u_not_connected;
  PyObject *__pyx_n_u_nothing;
  PyObject *__pyx_n_u_null;
  PyObject *__pyx_kp_u_null_codec;
  PyObject *__pyx_n_s_num_methods;
  PyObject *__pyx_n_s_obj;
  PyObject *__pyx_n_s_object;
  PyObject *__pyx_n_s_on_log_message;
  PyObject *__pyx_kp_u_only_1_dimensional_arrays_are_su;
  PyObject *__pyx_kp_u_only_arrays_of_scalars_are_suppo;
  PyObject *__pyx_kp_u_only_scalar_multiranges_are_supp;
  PyObject *__pyx_kp_u_only_scalar_ranges_are_supported;
  PyObject *__pyx_n_s_out_dc;
  PyObject *__pyx_n_s_out_type_id;
  PyObject *__pyx_n_s_output_format;
  PyObject *__pyx_n_s_pack;
  PyObject *__pyx_n_s_packet;
  PyObject *__pyx_n_s_params;
  PyObject *__pyx_n_s_parents;
  PyObject *__pyx_n_s_parse;
  PyObject *__pyx_n_s_parse_server_final_message;
  PyObject *__pyx_n_s_parse_server_first_message;
  PyObject *__pyx_n_s_passed_args;
  PyObject *__pyx_n_s_passed_args_repr;
  PyObject *__pyx_n_s_password;
  PyObject *__pyx_n_s_pgproto;
  PyObject *__pyx_n_s_pickle;
  PyObject *__pyx_n_s_ping;
  PyObject *__pyx_n_s_popitem;
  PyObject *__pyx_n_s_prepare;
  PyObject *__pyx_n_u_python;
  PyObject *__pyx_kp_u_python_is_the_only_valid_format;
  PyObject *__pyx_n_s_pyx_PickleError;
  PyObject *__pyx_n_s_pyx_checksum;
  PyObject *__pyx_n_s_pyx_result;
  PyObject *__pyx_n_s_pyx_state;
  PyObject *__pyx_n_s_pyx_type;
  PyObject *__pyx_n_s_pyx_unpickle_CodecsRegistry;
  PyObject *__pyx_n_s_pyx_unpickle_Enum;
  PyObject *__pyx_n_s_pyx_unpickle_ExecuteContext;
  PyObject *__pyx_n_s_pyx_unpickle_LRUMapping;
  PyObject *__pyx_n_s_pyx_unpickle_SansIOProtocol;
  PyObject *__pyx_n_s_pyx_unpickle_SansIOProtocolBac;
  PyObject *__pyx_n_s_pyx_unpickle___Pyx_EnumMeta;
  PyObject *__pyx_n_s_pyx_vtable;
  PyObject *__pyx_n_s_qc;
  PyObject *__pyx_n_s_qualname;
  PyObject *__pyx_n_u_qualname;
  PyObject *__pyx_n_s_query;
  PyObject *__pyx_n_s_query_2;
  PyObject *__pyx_kp_u_query_cannot_be_executed_with;
  PyObject *__pyx_kp_u_query_executed_via;
  PyObject *__pyx_n_u_query_required_single;
  PyObject *__pyx_n_u_query_required_single_json;
  PyObject *__pyx_n_u_query_single;
  PyObject *__pyx_n_u_query_single_json;
  PyObject *__pyx_kp_u_r_is_out_of_range_for_type_half;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_range_mod;
  PyObject *__pyx_n_u_raw_query;
  PyObject *__pyx_n_s_re_exec;
  PyObject *__pyx_n_s_reduce;
  PyObject *__pyx_n_s_reduce_cython;
  PyObject *__pyx_n_s_reduce_ex;
  PyObject *__pyx_n_s_ref;
  PyObject *__pyx_n_s_reg;
  PyObject *__pyx_n_s_register;
  PyObject *__pyx_n_s_repr;
  PyObject *__pyx_n_s_required;
  PyObject *__pyx_n_s_required_args;
  PyObject *__pyx_n_s_required_one;
  PyObject *__pyx_n_s_res;
  PyObject *__pyx_n_s_restore;
  PyObject *__pyx_n_s_result;
  PyObject *__pyx_kp_u_result_is_not_a_list_but;
  PyObject *__pyx_n_s_ret;
  PyObject *__pyx_kp_u_returned_no_data;
  PyObject *__pyx_n_s_reversed;
  PyObject *__pyx_n_s_rv;
  PyObject *__pyx_kp_s_s_s;
  PyObject *__pyx_kp_s_s_s_d;
  PyObject *__pyx_n_s_salt;
  PyObject *__pyx_n_s_scram;
  PyObject *__pyx_n_s_secret_key;
  PyObject *__pyx_n_u_secret_key;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_n_s_send;
  PyObject *__pyx_kp_u_server_SCRAM_proof_does_not_matc;
  PyObject *__pyx_n_s_server_final;
  PyObject *__pyx_n_s_server_first;
  PyObject *__pyx_n_s_server_nonce;
  PyObject *__pyx_n_s_server_sig;
  PyObject *__pyx_n_s_set_connection;
  PyObject *__pyx_n_s_set_dataclass_fields_func;
  PyObject *__pyx_n_s_set_name;
  PyObject *__pyx_n_s_set_type_codec;
  PyObject *__pyx_n_s_setstate;
  PyObject *__pyx_n_s_setstate_cython;
  PyObject *__pyx_n_s_shape;
  PyObject *__pyx_n_s_size;
  PyObject *__pyx_kp_u_size_of_encoded_multirange_datum;
  PyObject *__pyx_n_s_spec;
  PyObject *__pyx_n_s_start;
  PyObject *__pyx_n_s_state;
  PyObject *__pyx_n_s_status;
  PyObject *__pyx_n_u_std;
  PyObject *__pyx_kp_u_std_bigint;
  PyObject *__pyx_kp_u_std_bool;
  PyObject *__pyx_kp_u_std_bytes;
  PyObject *__pyx_kp_u_std_datetime;
  PyObject *__pyx_kp_u_std_decimal;
  PyObject *__pyx_kp_u_std_duration;
  PyObject *__pyx_kp_u_std_float32;
  PyObject *__pyx_kp_u_std_float64;
  PyObject *__pyx_kp_u_std_int16;
  PyObject *__pyx_kp_u_std_int32;
  PyObject *__pyx_kp_u_std_int64;
  PyObject *__pyx_kp_u_std_json;
  PyObject *__pyx_kp_u_std_pg_date;
  PyObject *__pyx_kp_u_std_pg_interval;
  PyObject *__pyx_kp_u_std_pg_json;
  PyObject *__pyx_kp_u_std_pg_timestamp;
  PyObject *__pyx_kp_u_std_pg_timestamptz;
  PyObject *__pyx_kp_u_std_str;
  PyObject *__pyx_kp_u_std_uuid;
  PyObject *__pyx_n_s_step;
  PyObject *__pyx_n_s_stop;
  PyObject *__pyx_n_s_str;
  PyObject *__pyx_n_s_str_2;
  PyObject *__pyx_kp_s_strided_and_direct;
  PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
  PyObject *__pyx_kp_s_strided_and_indirect;
  PyObject *__pyx_kp_s_stringsource;
  PyObject *__pyx_n_s_strip;
  PyObject *__pyx_n_s_struct;
  PyObject *__pyx_n_u_suggested_pool_concurrency;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_n_s_sync;
  PyObject *__pyx_n_s_sys;
  PyObject *__pyx_n_u_system_config;
  PyObject *__pyx_n_s_terminate;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_kp_u_the_connection_has_been_closed;
  PyObject *__pyx_kp_u_the_connection_has_been_closed_b;
  PyObject *__pyx_kp_u_the_server_offered_the_following;
  PyObject *__pyx_kp_u_the_server_requested_SASL_authen;
  PyObject *__pyx_kp_u_the_server_requested_an_unsuppor;
  PyObject *__pyx_n_s_throw;
  PyObject *__pyx_n_s_tid;
  PyObject *__pyx_n_u_tid;
  PyObject *__pyx_n_s_time;
  PyObject *__pyx_n_s_timedelta;
  PyObject *__pyx_n_u_tname;
  PyObject *__pyx_kp_u_too_many_annotations;
  PyObject *__pyx_kp_u_too_many_elements_for_a_tuple;
  PyObject *__pyx_kp_u_too_many_elements_in_array_value;
  PyObject *__pyx_kp_u_too_many_elements_in_multirange;
  PyObject *__pyx_kp_u_too_many_elements_in_vector_valu;
  PyObject *__pyx_n_s_try_from;
  PyObject *__pyx_n_s_try_recv_eagerly;
  PyObject *__pyx_n_s_type;
  PyObject *__pyx_n_s_type_size;
  PyObject *__pyx_n_s_typeid;
  PyObject *__pyx_kp_u_typeid_must_be_a_UUID;
  PyObject *__pyx_n_s_types;
  PyObject *__pyx_n_s_typing;
  PyObject *__pyx_kp_s_typing_Optional_int;
  PyObject *__pyx_n_u_tzinfo;
  PyObject *__pyx_kp_s_unable_to_allocate_array_data;
  PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
  PyObject *__pyx_kp_u_unable_to_decode_data_to_Python;
  PyObject *__pyx_kp_u_unexpected_NULL_element_in_multi;
  PyObject *__pyx_kp_u_unexpected_NULL_value_in_array_s;
  PyObject *__pyx_kp_u_unexpected_message_type;
  PyObject *__pyx_kp_u_unexpected_query_argument_codec;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff_2;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff_3;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff_4;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff_5;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff_6;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff_7;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff_8;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_buff_9;
  PyObject *__pyx_kp_u_unexpected_trailing_data_in_type;
  PyObject *__pyx_n_s_unpack;
  PyObject *__pyx_kp_u_unsupported_authentication_metho;
  PyObject *__pyx_n_s_update;
  PyObject *__pyx_n_s_upper;
  PyObject *__pyx_n_s_use_setstate;
  PyObject *__pyx_n_s_user;
  PyObject *__pyx_n_u_user;
  PyObject *__pyx_kp_u_utf_8;
  PyObject *__pyx_n_s_uuid;
  PyObject *__pyx_n_s_v;
  PyObject *__pyx_n_s_value;
  PyObject *__pyx_n_s_value_type;
  PyObject *__pyx_n_s_values;
  PyObject *__pyx_n_s_ver_buf;
  PyObject *__pyx_n_s_version_info;
  PyObject *__pyx_n_s_wait_for_connect;
  PyObject *__pyx_n_s_wait_for_disconnect;
  PyObject *__pyx_n_s_wait_for_message;
  PyObject *__pyx_n_u_warnings;
  PyObject *__pyx_n_s_weakref;
  PyObject *__pyx_n_s_wkb;
  PyObject *__pyx_n_u_wkb;
  PyObject *__pyx_n_s_zfill;
  PyObject *__pyx_n_s_zip;
  PyObject *__pyx_float_0_0;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_3;
  PyObject *__pyx_int_4;
  PyObject *__pyx_int_13;
  PyObject *__pyx_int_14;
  PyObject *__pyx_int_40;
  PyObject *__pyx_int_200;
  PyObject *__pyx_int_1000;
  PyObject *__pyx_int_4097;
  PyObject *__pyx_int_10000;
  PyObject *__pyx_int_65281;
  PyObject *__pyx_int_65282;
  PyObject *__pyx_int_65283;
  PyObject *__pyx_int_65284;
  PyObject *__pyx_int_14808274;
  PyObject *__pyx_int_34451156;
  PyObject *__pyx_int_52716380;
  PyObject *__pyx_int_65974055;
  PyObject *__pyx_int_84082689;
  PyObject *__pyx_int_84082690;
  PyObject *__pyx_int_84082945;
  PyObject *__pyx_int_84082946;
  PyObject *__pyx_int_87255255;
  PyObject *__pyx_int_94322648;
  PyObject *__pyx_int_112105877;
  PyObject *__pyx_int_113914406;
  PyObject *__pyx_int_121062814;
  PyObject *__pyx_int_124019026;
  PyObject *__pyx_int_136983863;
  PyObject *__pyx_int_181010524;
  PyObject *__pyx_int_184977713;
  PyObject *__pyx_int_222419149;
  PyObject *__pyx_int_228165448;
  PyObject *__pyx_int_228825662;
  PyObject *__pyx_int_238750788;
  PyObject *__pyx_int_262771094;
  PyObject *__pyx_int_2147483648;
  PyObject *__pyx_int_0xffffffffffffffff;
  PyObject *__pyx_int_neg_1;
  PyObject *__pyx_k__52;
  PyObject *__pyx_k__53;
  PyObject *__pyx_k__84;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_k__85;
  PyObject *__pyx_slice__7;
  PyObject *__pyx_tuple__2;
  PyObject *__pyx_tuple__6;
  PyObject *__pyx_slice__16;
  PyObject *__pyx_tuple__10;
  PyObject *__pyx_tuple__11;
  PyObject *__pyx_tuple__12;
  PyObject *__pyx_tuple__14;
  PyObject *__pyx_tuple__15;
  PyObject *__pyx_tuple__22;
  PyObject *__pyx_tuple__23;
  PyObject *__pyx_tuple__24;
  PyObject *__pyx_tuple__25;
  PyObject *__pyx_tuple__26;
  PyObject *__pyx_tuple__27;
  PyObject *__pyx_tuple__28;
  PyObject *__pyx_tuple__29;
  PyObject *__pyx_tuple__30;
  PyObject *__pyx_tuple__31;
  PyObject *__pyx_tuple__32;
  PyObject *__pyx_tuple__34;
  PyObject *__pyx_tuple__35;
  PyObject *__pyx_tuple__36;
  PyObject *__pyx_tuple__37;
  PyObject *__pyx_tuple__38;
  PyObject *__pyx_tuple__39;
  PyObject *__pyx_tuple__40;
  PyObject *__pyx_tuple__41;
  PyObject *__pyx_tuple__42;
  PyObject *__pyx_tuple__43;
  PyObject *__pyx_tuple__44;
  PyObject *__pyx_tuple__45;
  PyObject *__pyx_tuple__46;
  PyObject *__pyx_tuple__47;
  PyObject *__pyx_tuple__49;
  PyObject *__pyx_tuple__50;
  PyObject *__pyx_tuple__51;
  PyObject *__pyx_tuple__54;
  PyObject *__pyx_tuple__55;
  PyObject *__pyx_tuple__61;
  PyObject *__pyx_tuple__67;
  PyObject *__pyx_tuple__68;
  PyObject *__pyx_tuple__69;
  PyObject *__pyx_tuple__70;
  PyObject *__pyx_tuple__75;
  PyObject *__pyx_tuple__76;
  PyObject *__pyx_tuple__77;
  PyObject *__pyx_tuple__79;
  PyObject *__pyx_tuple__81;
  PyObject *__pyx_tuple__82;
  PyObject *__pyx_tuple__83;
  PyObject *__pyx_tuple__87;
  PyObject *__pyx_tuple__92;
  PyObject *__pyx_tuple__93;
  PyObject *__pyx_tuple__94;
  PyObject *__pyx_tuple__95;
  PyObject *__pyx_tuple__96;
  PyObject *__pyx_tuple__98;
  PyObject *__pyx_tuple__100;
  PyObject *__pyx_tuple__102;
  PyObject *__pyx_tuple__103;
  PyObject *__pyx_tuple__109;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__112;
  PyObject *__pyx_tuple__113;
  PyObject *__pyx_tuple__114;
  PyObject *__pyx_tuple__115;
  PyObject *__pyx_tuple__116;
  PyObject *__pyx_tuple__117;
  PyObject *__pyx_tuple__118;
  PyObject *__pyx_tuple__119;
  PyObject *__pyx_tuple__124;
  PyObject *__pyx_tuple__125;
  PyObject *__pyx_tuple__126;
  PyObject *__pyx_tuple__127;
  PyObject *__pyx_tuple__128;
  PyObject *__pyx_tuple__129;
  PyObject *__pyx_tuple__130;
  PyObject *__pyx_tuple__131;
  PyObject *__pyx_tuple__132;
  PyObject *__pyx_tuple__133;
  PyObject *__pyx_tuple__134;
  PyObject *__pyx_tuple__135;
  PyObject *__pyx_tuple__136;
  PyObject *__pyx_tuple__137;
  PyObject *__pyx_tuple__138;
  PyObject *__pyx_tuple__139;
  PyObject *__pyx_tuple__140;
  PyObject *__pyx_tuple__141;
  PyObject *__pyx_tuple__142;
  PyObject *__pyx_tuple__143;
  PyObject *__pyx_tuple__144;
  PyObject *__pyx_tuple__145;
  PyObject *__pyx_tuple__146;
  PyObject *__pyx_tuple__147;
  PyObject *__pyx_tuple__148;
  PyObject *__pyx_tuple__149;
  PyObject *__pyx_tuple__150;
  PyObject *__pyx_tuple__151;
  PyObject *__pyx_tuple__152;
  PyObject *__pyx_tuple__153;
  PyObject *__pyx_tuple__155;
  PyObject *__pyx_tuple__158;
  PyObject *__pyx_tuple__181;
  PyObject *__pyx_tuple__185;
  PyObject *__pyx_tuple__189;
  PyObject *__pyx_tuple__191;
  PyObject *__pyx_tuple__193;
  PyObject *__pyx_tuple__217;
  PyObject *__pyx_tuple__225;
  PyObject *__pyx_tuple__228;
  PyObject *__pyx_tuple__229;
  PyObject *__pyx_tuple__230;
  PyObject *__pyx_tuple__231;
  PyObject *__pyx_tuple__232;
  PyObject *__pyx_tuple__233;
  PyObject *__pyx_tuple__234;
  PyObject *__pyx_tuple__235;
  PyObject *__pyx_tuple__237;
  PyObject *__pyx_tuple__238;
  PyObject *__pyx_tuple__242;
  PyObject *__pyx_tuple__243;
  PyObject *__pyx_tuple__244;
  PyObject *__pyx_tuple__245;
  PyObject *__pyx_tuple__246;
  PyObject *__pyx_codeobj__56;
  PyObject *__pyx_codeobj__57;
  PyObject *__pyx_codeobj__58;
  PyObject *__pyx_codeobj__59;
  PyObject *__pyx_codeobj__60;
  PyObject *__pyx_codeobj__62;
  PyObject *__pyx_codeobj__63;
  PyObject *__pyx_codeobj__64;
  PyObject *__pyx_codeobj__66;
  PyObject *__pyx_codeobj__71;
  PyObject *__pyx_codeobj__72;
  PyObject *__pyx_codeobj__73;
  PyObject *__pyx_codeobj__74;
  PyObject *__pyx_codeobj__78;
  PyObject *__pyx_codeobj__86;
  PyObject *__pyx_codeobj__88;
  PyObject *__pyx_codeobj__89;
  PyObject *__pyx_codeobj__90;
  PyObject *__pyx_codeobj__91;
  PyObject *__pyx_codeobj__97;
  PyObject *__pyx_codeobj__99;
  PyObject *__pyx_codeobj__101;
  PyObject *__pyx_codeobj__104;
  PyObject *__pyx_codeobj__105;
  PyObject *__pyx_codeobj__106;
  PyObject *__pyx_codeobj__107;
  PyObject *__pyx_codeobj__108;
  PyObject *__pyx_codeobj__110;
  PyObject *__pyx_codeobj__120;
  PyObject *__pyx_codeobj__121;
  PyObject *__pyx_codeobj__122;
  PyObject *__pyx_codeobj__123;
  PyObject *__pyx_codeobj__159;
  PyObject *__pyx_codeobj__160;
  PyObject *__pyx_codeobj__161;
  PyObject *__pyx_codeobj__162;
  PyObject *__pyx_codeobj__163;
  PyObject *__pyx_codeobj__164;
  PyObject *__pyx_codeobj__165;
  PyObject *__pyx_codeobj__166;
  PyObject *__pyx_codeobj__167;
  PyObject *__pyx_codeobj__168;
  PyObject *__pyx_codeobj__169;
  PyObject *__pyx_codeobj__170;
  PyObject *__pyx_codeobj__171;
  PyObject *__pyx_codeobj__172;
  PyObject *__pyx_codeobj__173;
  PyObject *__pyx_codeobj__174;
  PyObject *__pyx_codeobj__175;
  PyObject *__pyx_codeobj__176;
  PyObject *__pyx_codeobj__177;
  PyObject *__pyx_codeobj__178;
  PyObject *__pyx_codeobj__179;
  PyObject *__pyx_codeobj__180;
  PyObject *__pyx_codeobj__182;
  PyObject *__pyx_codeobj__183;
  PyObject *__pyx_codeobj__184;
  PyObject *__pyx_codeobj__186;
  PyObject *__pyx_codeobj__187;
  PyObject *__pyx_codeobj__188;
  PyObject *__pyx_codeobj__190;
  PyObject *__pyx_codeobj__192;
  PyObject *__pyx_codeobj__194;
  PyObject *__pyx_codeobj__195;
  PyObject *__pyx_codeobj__196;
  PyObject *__pyx_codeobj__197;
  PyObject *__pyx_codeobj__198;
  PyObject *__pyx_codeobj__199;
  PyObject *__pyx_codeobj__200;
  PyObject *__pyx_codeobj__201;
  PyObject *__pyx_codeobj__202;
  PyObject *__pyx_codeobj__203;
  PyObject *__pyx_codeobj__204;
  PyObject *__pyx_codeobj__205;
  PyObject *__pyx_codeobj__206;
  PyObject *__pyx_codeobj__207;
  PyObject *__pyx_codeobj__208;
  PyObject *__pyx_codeobj__209;
  PyObject *__pyx_codeobj__210;
  PyObject *__pyx_codeobj__211;
  PyObject *__pyx_codeobj__212;
  PyObject *__pyx_codeobj__213;
  PyObject *__pyx_codeobj__214;
  PyObject *__pyx_codeobj__215;
  PyObject *__pyx_codeobj__216;
  PyObject *__pyx_codeobj__218;
  PyObject *__pyx_codeobj__219;
  PyObject *__pyx_codeobj__220;
  PyObject *__pyx_codeobj__221;
  PyObject *__pyx_codeobj__222;
  PyObject *__pyx_codeobj__223;
  PyObject *__pyx_codeobj__224;
  PyObject *__pyx_codeobj__226;
  PyObject *__pyx_codeobj__227;
  PyObject *__pyx_codeobj__236;
  PyObject *__pyx_codeobj__239;
  PyObject *__pyx_codeobj__240;
  PyObject *__pyx_codeobj__247;
  PyObject *__pyx_codeobj__248;
  PyObject *__pyx_codeobj__249;
  PyObject *__pyx_codeobj__250;
  PyObject *__pyx_codeobj__251;
  PyObject *__pyx_codeobj__252;
  PyObject *__pyx_codeobj__253;
} __pyx_mstate;

#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
  extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))

#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#else
static __pyx_mstate __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_date);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_time);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_datetime);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
  Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_9datatypes_9datatypes_RelativeDuration);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_9datatypes_9datatypes_DateDuration);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_9datatypes_9datatypes_ConfigMemory);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_LRUMapping);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_LRUMapping);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_BaseCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_BaseCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_CodecPythonOverride);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_BaseRecordCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_NullCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_NullCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_ScalarCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_TupleCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_TupleCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_NamedTupleCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_ObjectCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_BaseArrayCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_ArrayCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_RangeCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_RangeCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_MultiRangeCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_SetCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_SetCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_EnumCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_EnumCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_RecordCodec);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_RecordCodec);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_CodecsRegistry);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_ExecuteContext);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_SansIOProtocol);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous);
  Py_CLEAR(clear_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query);
  Py_CLEAR(clear_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query);
  Py_CLEAR(clear_module_state->__pyx_ptype___Pyx_EnumMeta);
  Py_CLEAR(clear_module_state->__Pyx_EnumMeta);
  Py_CLEAR(clear_module_state->__pyx_array_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
  Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
  Py_CLEAR(clear_module_state->__pyx_memoryview_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
  Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
  Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
  Py_CLEAR(clear_module_state->__pyx_kp_b_);
  Py_CLEAR(clear_module_state->__pyx_kp_s_);
  Py_CLEAR(clear_module_state->__pyx_kp_u_);
  Py_CLEAR(clear_module_state->__pyx_kp_u_0000);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_10);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_11);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_12);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_13);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_14);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_15);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_16);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_17);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_18);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_19);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_20);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_21);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_22);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_23);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_24);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_25);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_5);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_6);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_7);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_8);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_9);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100_5);
  Py_CLEAR(clear_module_state->__pyx_kp_u_003e434d_cac2_430a_b238_fb39d734);
  Py_CLEAR(clear_module_state->__pyx_kp_u_44c901c0_d922_4894_83c8_061bd05e);
  Py_CLEAR(clear_module_state->__pyx_kp_u_4ba84534_188e_43b4_a7ce_cea2af0f);
  Py_CLEAR(clear_module_state->__pyx_kp_u_4d738878_3a5f_4821_ab76_9d8e7d6b);
  Py_CLEAR(clear_module_state->__pyx_kp_u_7fae5536_6311_4f60_8eb9_096a5d97);
  Py_CLEAR(clear_module_state->__pyx_kp_u_9565dd88_04f5_11ee_a691_0b6ebe17);
  Py_CLEAR(clear_module_state->__pyx_n_s_ALL);
  Py_CLEAR(clear_module_state->__pyx_n_s_ALL_CAPABILITIES);
  Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
  Py_CLEAR(clear_module_state->__pyx_n_s_AT_LEAST_ONE);
  Py_CLEAR(clear_module_state->__pyx_n_s_AT_MOST_ONE);
  Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
  Py_CLEAR(clear_module_state->__pyx_n_u_Array);
  Py_CLEAR(clear_module_state->__pyx_n_s_ArrayCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_ArrayCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ArrayCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ArrayCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_ArrayType);
  Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
  Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_BINARY);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseArrayCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseArrayCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseArrayCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseNamedRecordCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseNamedRecordCodec___reduce_cy);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseNamedRecordCodec___setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseRecordCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseRecordCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseRecordCodec___setstate_cytho);
  Py_CLEAR(clear_module_state->__pyx_n_s_BaseScalarType);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
  Py_CLEAR(clear_module_state->__pyx_n_s_Capability);
  Py_CLEAR(clear_module_state->__pyx_n_s_Cardinality);
  Py_CLEAR(clear_module_state->__pyx_n_s_ClientConnectionClosedError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ClientConnectionError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ClientError);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecPythonOverride);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecPythonOverride___reduce_cyt);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecPythonOverride___setstate_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecPythonOverride_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecsRegistry);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecsRegistry___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecsRegistry___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecsRegistry_clear_cache);
  Py_CLEAR(clear_module_state->__pyx_n_s_CodecsRegistry_set_type_codec);
  Py_CLEAR(clear_module_state->__pyx_n_s_CompilationFlag);
  Py_CLEAR(clear_module_state->__pyx_n_s_Decimal);
  Py_CLEAR(clear_module_state->__pyx_n_u_DerivedEnumValue);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
  Py_CLEAR(clear_module_state->__pyx_n_s_EDGEQL);
  Py_CLEAR(clear_module_state->__pyx_n_s_EDGE_POINTER_IS_LINKPROP);
  Py_CLEAR(clear_module_state->__pyx_n_s_EMPTY_NULL_DATA);
  Py_CLEAR(clear_module_state->__pyx_n_s_EMPTY_RECORD_DATA);
  Py_CLEAR(clear_module_state->__pyx_n_s_EdegDBCodecContext);
  Py_CLEAR(clear_module_state->__pyx_n_s_EdegDBCodecContext___reduce_cyth);
  Py_CLEAR(clear_module_state->__pyx_n_s_EdegDBCodecContext___setstate_cy);
  Py_CLEAR(clear_module_state->__pyx_n_s_EdegDBCodecContext_get_text_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_EdgeDBError);
  Py_CLEAR(clear_module_state->__pyx_n_s_EdgeDBMessage);
  Py_CLEAR(clear_module_state->__pyx_n_s_Element);
  Py_CLEAR(clear_module_state->__pyx_n_s_ElementKind);
  Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
  Py_CLEAR(clear_module_state->__pyx_n_s_EmptyTupleCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_EmptyTupleCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_EmptyTupleCodec___setstate_cytho);
  Py_CLEAR(clear_module_state->__pyx_n_s_EmptyTupleCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
  Py_CLEAR(clear_module_state->__pyx_n_u_Enum);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnumBase);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnumCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnumCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnumCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnumCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnumMeta);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnumType);
  Py_CLEAR(clear_module_state->__pyx_n_s_EnumValue);
  Py_CLEAR(clear_module_state->__pyx_n_s_ExecuteContext);
  Py_CLEAR(clear_module_state->__pyx_n_s_ExecuteContext___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ExecuteContext___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_FIELD);
  Py_CLEAR(clear_module_state->__pyx_n_u_H);
  Py_CLEAR(clear_module_state->__pyx_n_s_INJECT_OUTPUT_OBJECT_IDS);
  Py_CLEAR(clear_module_state->__pyx_n_s_INJECT_OUTPUT_TYPE_IDS);
  Py_CLEAR(clear_module_state->__pyx_n_s_INJECT_OUTPUT_TYPE_NAMES);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_4);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_5);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_6);
  Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
  Py_CLEAR(clear_module_state->__pyx_n_s_InputLanguage);
  Py_CLEAR(clear_module_state->__pyx_n_s_IntEnum);
  Py_CLEAR(clear_module_state->__pyx_n_s_IntFlag);
  Py_CLEAR(clear_module_state->__pyx_n_s_InterfaceError);
  Py_CLEAR(clear_module_state->__pyx_n_s_InvalidArgumentError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
  Py_CLEAR(clear_module_state->__pyx_n_s_Iterable);
  Py_CLEAR(clear_module_state->__pyx_n_s_IterableABC);
  Py_CLEAR(clear_module_state->__pyx_n_s_JSON);
  Py_CLEAR(clear_module_state->__pyx_n_s_JSON_ELEMENTS);
  Py_CLEAR(clear_module_state->__pyx_n_s_KeyError);
  Py_CLEAR(clear_module_state->__pyx_n_s_LINK);
  Py_CLEAR(clear_module_state->__pyx_n_s_LINK_PROPERTY);
  Py_CLEAR(clear_module_state->__pyx_n_s_LRUMapping);
  Py_CLEAR(clear_module_state->__pyx_n_s_LRUMapping___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_LRUMapping___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_LRUMapping_clear);
  Py_CLEAR(clear_module_state->__pyx_n_s_LookupError);
  Py_CLEAR(clear_module_state->__pyx_n_s_MANY);
  Py_CLEAR(clear_module_state->__pyx_n_s_Mapping);
  Py_CLEAR(clear_module_state->__pyx_n_s_MappingABC);
  Py_CLEAR(clear_module_state->__pyx_n_s_MappingProxyType);
  Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
  Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
  Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
  Py_CLEAR(clear_module_state->__pyx_n_s_MultiRange);
  Py_CLEAR(clear_module_state->__pyx_n_u_MultiRange);
  Py_CLEAR(clear_module_state->__pyx_n_s_MultiRangeCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_MultiRangeCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_MultiRangeCodec___setstate_cytho);
  Py_CLEAR(clear_module_state->__pyx_n_s_MultiRangeCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_MultiRangeType);
  Py_CLEAR(clear_module_state->__pyx_n_s_NONE);
  Py_CLEAR(clear_module_state->__pyx_n_s_NO_RESULT);
  Py_CLEAR(clear_module_state->__pyx_n_u_NamedTuple);
  Py_CLEAR(clear_module_state->__pyx_n_s_NamedTupleCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_NamedTupleCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_NamedTupleCodec___setstate_cytho);
  Py_CLEAR(clear_module_state->__pyx_n_s_NamedTupleCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_NamedTupleType);
  Py_CLEAR(clear_module_state->__pyx_n_s_NoDataError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_None);
  Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError);
  Py_CLEAR(clear_module_state->__pyx_n_s_NullCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_NullCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_NullCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_NullCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_b_O);
  Py_CLEAR(clear_module_state->__pyx_n_s_ONE);
  Py_CLEAR(clear_module_state->__pyx_n_u_Object);
  Py_CLEAR(clear_module_state->__pyx_n_s_ObjectCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_ObjectCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ObjectCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ObjectCodec__make_missing_args_e);
  Py_CLEAR(clear_module_state->__pyx_n_s_ObjectCodec_get_dataclass_fields);
  Py_CLEAR(clear_module_state->__pyx_n_s_ObjectCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_ObjectType);
  Py_CLEAR(clear_module_state->__pyx_n_s_OrderedDict);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
  Py_CLEAR(clear_module_state->__pyx_n_s_OutputFormat);
  Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError);
  Py_CLEAR(clear_module_state->__pyx_n_s_PROPERTY);
  Py_CLEAR(clear_module_state->__pyx_n_s_ParameterTypeMismatchError);
  Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ProtocolError);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Python_override);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_EnumBase);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_EnumBase___new);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_EnumBase___repr);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_EnumBase___str);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_EnumMeta___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_EnumMeta___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_FlagBase);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_FlagBase___new);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_FlagBase___repr);
  Py_CLEAR(clear_module_state->__pyx_n_s_Pyx_FlagBase___str);
  Py_CLEAR(clear_module_state->__pyx_n_s_QUERY_SINGLE_METHOD);
  Py_CLEAR(clear_module_state->__pyx_n_s_QueryArgumentError);
  Py_CLEAR(clear_module_state->__pyx_n_s_Range);
  Py_CLEAR(clear_module_state->__pyx_n_u_Range);
  Py_CLEAR(clear_module_state->__pyx_n_s_RangeCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_RangeCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_RangeCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_RangeCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_RangeType);
  Py_CLEAR(clear_module_state->__pyx_n_u_Record);
  Py_CLEAR(clear_module_state->__pyx_n_s_RecordCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_RecordCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_RecordCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ResultCardinalityMismatchError);
  Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError);
  Py_CLEAR(clear_module_state->__pyx_kp_b_SCRAM_SHA_256);
  Py_CLEAR(clear_module_state->__pyx_n_s_SQL);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_4);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_5);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_6);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_7);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_8);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol__auth_sasl);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol__execute);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol__parse);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol__sync);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_abort);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_connect);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_dump);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_execute);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_get_settings);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_is_in_transaction);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_ping);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_restore);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_set_connection);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_terminate);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_try_recv_eagerly);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_wait_for_connect);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_wait_for_disconne);
  Py_CLEAR(clear_module_state->__pyx_n_s_SansIOProtocol_wait_for_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_ScalarCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_ScalarCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ScalarCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_ScalarCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_ScalarType);
  Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
  Py_CLEAR(clear_module_state->__pyx_n_u_Set);
  Py_CLEAR(clear_module_state->__pyx_n_s_SetCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_SetCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_SetCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_SetCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_Sized);
  Py_CLEAR(clear_module_state->__pyx_n_s_SizedABC);
  Py_CLEAR(clear_module_state->__pyx_n_u_SparseObject);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_TYPE_IDS);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Time_zones_are_not_available_fro);
  Py_CLEAR(clear_module_state->__pyx_n_u_Tuple);
  Py_CLEAR(clear_module_state->__pyx_n_s_TupleCodec);
  Py_CLEAR(clear_module_state->__pyx_n_s_TupleCodec___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_TupleCodec___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_TupleCodec_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_TupleType);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_UUID);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Unknown_enum_value_s);
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
  Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
  Py_CLEAR(clear_module_state->__pyx_kp_u__13);
  Py_CLEAR(clear_module_state->__pyx_kp_b__154);
  Py_CLEAR(clear_module_state->__pyx_kp_b__156);
  Py_CLEAR(clear_module_state->__pyx_kp_b__157);
  Py_CLEAR(clear_module_state->__pyx_kp_u__17);
  Py_CLEAR(clear_module_state->__pyx_kp_u__18);
  Py_CLEAR(clear_module_state->__pyx_kp_u__19);
  Py_CLEAR(clear_module_state->__pyx_kp_u__20);
  Py_CLEAR(clear_module_state->__pyx_kp_u__21);
  Py_CLEAR(clear_module_state->__pyx_n_s__241);
  Py_CLEAR(clear_module_state->__pyx_n_s__254);
  Py_CLEAR(clear_module_state->__pyx_kp_u__3);
  Py_CLEAR(clear_module_state->__pyx_kp_u__33);
  Py_CLEAR(clear_module_state->__pyx_kp_u__4);
  Py_CLEAR(clear_module_state->__pyx_kp_u__48);
  Py_CLEAR(clear_module_state->__pyx_n_s__5);
  Py_CLEAR(clear_module_state->__pyx_kp_u__65);
  Py_CLEAR(clear_module_state->__pyx_kp_u__8);
  Py_CLEAR(clear_module_state->__pyx_kp_u__80);
  Py_CLEAR(clear_module_state->__pyx_kp_u__9);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_datetime_datetime_object_was_e);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_datetime_datetime_object_was_e_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_dict_or_Mapping_expected_got_t);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_naive_date_object_tzinfo_is_No);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_naive_datetime_object_tzinfo_i);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_naive_time_object_tzinfo_is_No);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_scalar_codec_expected_for_base);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_sized_iterable_container_expec);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_sized_iterable_container_expec_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_sized_iterable_container_or_ma);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_str_or_gel_EnumValue___tid);
  Py_CLEAR(clear_module_state->__pyx_kp_u_a_timezone_aware_datetime_object);
  Py_CLEAR(clear_module_state->__pyx_n_s_abc);
  Py_CLEAR(clear_module_state->__pyx_n_s_abort);
  Py_CLEAR(clear_module_state->__pyx_n_u_acceptable);
  Py_CLEAR(clear_module_state->__pyx_n_s_aiter);
  Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
  Py_CLEAR(clear_module_state->__pyx_n_s_allow_capabilities);
  Py_CLEAR(clear_module_state->__pyx_kp_u_already_connected);
  Py_CLEAR(clear_module_state->__pyx_kp_u_and);
  Py_CLEAR(clear_module_state->__pyx_n_s_anext);
  Py_CLEAR(clear_module_state->__pyx_n_s_annotations);
  Py_CLEAR(clear_module_state->__pyx_n_u_anytuple);
  Py_CLEAR(clear_module_state->__pyx_n_u_anytype);
  Py_CLEAR(clear_module_state->__pyx_n_s_append);
  Py_CLEAR(clear_module_state->__pyx_n_s_args);
  Py_CLEAR(clear_module_state->__pyx_kp_u_argument);
  Py_CLEAR(clear_module_state->__pyx_kp_u_argument_tuples_do_not_support_o);
  Py_CLEAR(clear_module_state->__pyx_kp_u_arguments);
  Py_CLEAR(clear_module_state->__pyx_n_s_array);
  Py_CLEAR(clear_module_state->__pyx_kp_u_as_it_does_not_return_any_data);
  Py_CLEAR(clear_module_state->__pyx_kp_u_as_it_may_return_more_than_one);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_tasks);
  Py_CLEAR(clear_module_state->__pyx_kp_u_attribute);
  Py_CLEAR(clear_module_state->__pyx_n_s_attrs);
  Py_CLEAR(clear_module_state->__pyx_n_s_attrs_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_auth_sasl);
  Py_CLEAR(clear_module_state->__pyx_n_s_await);
  Py_CLEAR(clear_module_state->__pyx_kp_u_bad_bigint_sign_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_base);
  Py_CLEAR(clear_module_state->__pyx_kp_u_base_scalar_codec_for);
  Py_CLEAR(clear_module_state->__pyx_n_s_base_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_basecodec);
  Py_CLEAR(clear_module_state->__pyx_n_u_big);
  Py_CLEAR(clear_module_state->__pyx_kp_u_bigint_data_has_fractional_part);
  Py_CLEAR(clear_module_state->__pyx_n_s_bint);
  Py_CLEAR(clear_module_state->__pyx_n_s_block_callback);
  Py_CLEAR(clear_module_state->__pyx_n_s_bool);
  Py_CLEAR(clear_module_state->__pyx_n_s_buf);
  Py_CLEAR(clear_module_state->__pyx_n_s_build_client_final_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_build_client_first_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_bytes);
  Py_CLEAR(clear_module_state->__pyx_kp_u_bytes_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_bytes_3);
  Py_CLEAR(clear_module_state->__pyx_n_s_byteswap);
  Py_CLEAR(clear_module_state->__pyx_n_s_c);
  Py_CLEAR(clear_module_state->__pyx_n_u_c);
  Py_CLEAR(clear_module_state->__pyx_kp_u_c1a50ff8_fded_48b0_85c2_4905a848);
  Py_CLEAR(clear_module_state->__pyx_n_s_cache_size);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cal_date_duration);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cal_local_date);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cal_local_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cal_local_time);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cal_relative_duration);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_decode_NamedTuple_expecte);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_decode_Object_expected);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_decode_Record_expected);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_decode_Tuple_expected);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_decode_empty_Tuple_expect);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_encode_empty_Tuple_expect);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_encode_empty_Tuple_expect_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_find_known_ID_for_type);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_handle_arrays_with_more_t);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cannot_not_build_codec_empty_typ);
  Py_CLEAR(clear_module_state->__pyx_n_s_cap_bytes);
  Py_CLEAR(clear_module_state->__pyx_n_s_capabilities);
  Py_CLEAR(clear_module_state->__pyx_n_s_cardinality);
  Py_CLEAR(clear_module_state->__pyx_n_s_cause);
  Py_CLEAR(clear_module_state->__pyx_kp_u_cfg_memory);
  Py_CLEAR(clear_module_state->__pyx_n_s_chr);
  Py_CLEAR(clear_module_state->__pyx_n_s_class);
  Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_clear);
  Py_CLEAR(clear_module_state->__pyx_n_s_clear_cache);
  Py_CLEAR(clear_module_state->__pyx_n_s_client_final);
  Py_CLEAR(clear_module_state->__pyx_n_s_client_first);
  Py_CLEAR(clear_module_state->__pyx_n_s_client_first_bare);
  Py_CLEAR(clear_module_state->__pyx_n_s_client_nonce);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_close);
  Py_CLEAR(clear_module_state->__pyx_n_s_cls);
  Py_CLEAR(clear_module_state->__pyx_n_s_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_codec);
  Py_CLEAR(clear_module_state->__pyx_n_s_codecs);
  Py_CLEAR(clear_module_state->__pyx_kp_u_codecs_are_not_supposed_to_be_in);
  Py_CLEAR(clear_module_state->__pyx_n_s_collections);
  Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
  Py_CLEAR(clear_module_state->__pyx_n_s_con);
  Py_CLEAR(clear_module_state->__pyx_n_s_con_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_connect);
  Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
  Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
  Py_CLEAR(clear_module_state->__pyx_n_s_count);
  Py_CLEAR(clear_module_state->__pyx_n_s_ctx);
  Py_CLEAR(clear_module_state->__pyx_n_s_data);
  Py_CLEAR(clear_module_state->__pyx_kp_u_data_block_before_header_block);
  Py_CLEAR(clear_module_state->__pyx_n_s_data_gen);
  Py_CLEAR(clear_module_state->__pyx_n_s_data_received);
  Py_CLEAR(clear_module_state->__pyx_n_s_database);
  Py_CLEAR(clear_module_state->__pyx_n_u_database);
  Py_CLEAR(clear_module_state->__pyx_n_s_dataclasses);
  Py_CLEAR(clear_module_state->__pyx_n_s_datatypes);
  Py_CLEAR(clear_module_state->__pyx_kp_u_date_duration_has_non_zero_micro);
  Py_CLEAR(clear_module_state->__pyx_n_s_datetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_days);
  Py_CLEAR(clear_module_state->__pyx_n_s_dct);
  Py_CLEAR(clear_module_state->__pyx_n_s_decimal);
  Py_CLEAR(clear_module_state->__pyx_n_s_decoder);
  Py_CLEAR(clear_module_state->__pyx_n_s_desc_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_describe);
  Py_CLEAR(clear_module_state->__pyx_n_s_describe_context);
  Py_CLEAR(clear_module_state->__pyx_n_s_descriptor);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict_2);
  Py_CLEAR(clear_module_state->__pyx_n_u_dim);
  Py_CLEAR(clear_module_state->__pyx_kp_u_dim_key_is_missing);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  Py_CLEAR(clear_module_state->__pyx_kp_u_does_not_correspond_to_any_know);
  Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
  Py_CLEAR(clear_module_state->__pyx_n_s_dump);
  Py_CLEAR(clear_module_state->__pyx_kp_u_either_positional_or_named_argum);
  Py_CLEAR(clear_module_state->__pyx_n_s_element_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_element_types);
  Py_CLEAR(clear_module_state->__pyx_n_s_elements);
  Py_CLEAR(clear_module_state->__pyx_kp_u_elements_got);
  Py_CLEAR(clear_module_state->__pyx_kp_u_elements_in_a_sparse_vector_cann);
  Py_CLEAR(clear_module_state->__pyx_kp_u_elements_in_the_tuple_got);
  Py_CLEAR(clear_module_state->__pyx_n_s_empty);
  Py_CLEAR(clear_module_state->__pyx_kp_u_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_n_s_encode);
  Py_CLEAR(clear_module_state->__pyx_n_s_encoder);
  Py_CLEAR(clear_module_state->__pyx_n_s_enum);
  Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
  Py_CLEAR(clear_module_state->__pyx_n_s_enums);
  Py_CLEAR(clear_module_state->__pyx_kp_s_enums_Capability);
  Py_CLEAR(clear_module_state->__pyx_n_s_error);
  Py_CLEAR(clear_module_state->__pyx_n_s_error_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_errors);
  Py_CLEAR(clear_module_state->__pyx_n_s_ex);
  Py_CLEAR(clear_module_state->__pyx_n_s_exc);
  Py_CLEAR(clear_module_state->__pyx_n_s_execute);
  Py_CLEAR(clear_module_state->__pyx_n_s_execute_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_expect_one);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected);
  Py_CLEAR(clear_module_state->__pyx_n_u_expected_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_SASLContinue_from_the_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_SASLFinal_from_the_serv);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_a_Decimal_or_an_int);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_a_record_with_a_single);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_a_two_dimensional_array);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_an_int);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_no_named_arguments);
  Py_CLEAR(clear_module_state->__pyx_kp_u_expected_no_positional_arguments);
  Py_CLEAR(clear_module_state->__pyx_n_s_expected_server_sig);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ext_pgvector_halfvec);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ext_pgvector_sparsevec);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ext_pgvector_vector);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ext_postgis_box2d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ext_postgis_box3d);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ext_postgis_geography);
  Py_CLEAR(clear_module_state->__pyx_kp_u_ext_postgis_geometry);
  Py_CLEAR(clear_module_state->__pyx_kp_u_extra);
  Py_CLEAR(clear_module_state->__pyx_n_s_extra_args);
  Py_CLEAR(clear_module_state->__pyx_n_u_f);
  Py_CLEAR(clear_module_state->__pyx_n_s_field);
  Py_CLEAR(clear_module_state->__pyx_n_s_field_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_fields);
  Py_CLEAR(clear_module_state->__pyx_n_u_fields);
  Py_CLEAR(clear_module_state->__pyx_kp_u_first_message_is_not_DataMsg);
  Py_CLEAR(clear_module_state->__pyx_n_s_flags);
  Py_CLEAR(clear_module_state->__pyx_n_s_format);
  Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
  Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_bytes);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_from_json);
  Py_CLEAR(clear_module_state->__pyx_kp_u_fts_language);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_gel);
  Py_CLEAR(clear_module_state->__pyx_n_u_gel);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gel_DerivedEnumValue);
  Py_CLEAR(clear_module_state->__pyx_n_s_gel_datatypes);
  Py_CLEAR(clear_module_state->__pyx_n_s_gel_pgproto);
  Py_CLEAR(clear_module_state->__pyx_n_s_gel_pgproto_pgproto);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_array_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_base_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_codecs_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_enum_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_namedtuple_p);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_object_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_range_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_scalar_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_set_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_codecs_tuple_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_lru_pyx);
  Py_CLEAR(clear_module_state->__pyx_n_s_gel_protocol_protocol);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_protocol_pyx);
  Py_CLEAR(clear_module_state->__pyx_kp_s_gel_protocol_protocol_v0_pyx);
  Py_CLEAR(clear_module_state->__pyx_n_s_generate_nonce);
  Py_CLEAR(clear_module_state->__pyx_n_s_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_get);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_code);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_dataclass_fields);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_pos);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_settings);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_text_codec);
  Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_got);
  Py_CLEAR(clear_module_state->__pyx_kp_u_got_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
  Py_CLEAR(clear_module_state->__pyx_n_s_handshake_buf);
  Py_CLEAR(clear_module_state->__pyx_n_s_header);
  Py_CLEAR(clear_module_state->__pyx_kp_u_header_block_after_data_block);
  Py_CLEAR(clear_module_state->__pyx_kp_u_header_block_was_not_received);
  Py_CLEAR(clear_module_state->__pyx_n_s_header_callback);
  Py_CLEAR(clear_module_state->__pyx_n_s_header_received);
  Py_CLEAR(clear_module_state->__pyx_n_s_headers);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_implicit_limit);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_in_dc);
  Py_CLEAR(clear_module_state->__pyx_n_s_in_type_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_inc_lower);
  Py_CLEAR(clear_module_state->__pyx_n_s_inc_upper);
  Py_CLEAR(clear_module_state->__pyx_n_s_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_index_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_init);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
  Py_CLEAR(clear_module_state->__pyx_n_s_inline_typeids);
  Py_CLEAR(clear_module_state->__pyx_n_s_inline_typenames);
  Py_CLEAR(clear_module_state->__pyx_n_s_input_language);
  Py_CLEAR(clear_module_state->__pyx_n_s_inspect);
  Py_CLEAR(clear_module_state->__pyx_n_s_int);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_array_element);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_array_element_at_index_N);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_array_size_received);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_buffer_length);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_input_for_query_argument);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_input_for_query_argument_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_input_for_state_argument);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_multirange_element);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_number_of_columns_expect);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_range_lower_bound);
  Py_CLEAR(clear_module_state->__pyx_kp_u_invalid_range_upper_bound);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_already_registered);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_empty);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_expected_as_a_valid_enum_arg);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_implicit);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_in_transaction);
  Py_CLEAR(clear_module_state->__pyx_kp_u_is_required_but_received_None);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_items);
  Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
  Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
  Py_CLEAR(clear_module_state->__pyx_n_s_itercount);
  Py_CLEAR(clear_module_state->__pyx_n_s_json);
  Py_CLEAR(clear_module_state->__pyx_n_s_k);
  Py_CLEAR(clear_module_state->__pyx_kp_u_key);
  Py_CLEAR(clear_module_state->__pyx_n_s_keys);
  Py_CLEAR(clear_module_state->__pyx_n_s_kind);
  Py_CLEAR(clear_module_state->__pyx_n_s_kwargs);
  Py_CLEAR(clear_module_state->__pyx_n_u_l);
  Py_CLEAR(clear_module_state->__pyx_n_s_last);
  Py_CLEAR(clear_module_state->__pyx_n_s_legacy_execute);
  Py_CLEAR(clear_module_state->__pyx_n_s_legacy_execute_anonymous);
  Py_CLEAR(clear_module_state->__pyx_n_s_legacy_optimistic_execute);
  Py_CLEAR(clear_module_state->__pyx_n_s_legacy_parse);
  Py_CLEAR(clear_module_state->__pyx_n_s_legacy_simple_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_loads);
  Py_CLEAR(clear_module_state->__pyx_n_s_lookup);
  Py_CLEAR(clear_module_state->__pyx_n_s_lower);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_major);
  Py_CLEAR(clear_module_state->__pyx_n_s_make_missing_args_error_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_make_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_make_type_locals_genexpr);
  Py_CLEAR(clear_module_state->__pyx_n_s_maxsize);
  Py_CLEAR(clear_module_state->__pyx_kp_u_maxsize_is_expected_to_be_greate);
  Py_CLEAR(clear_module_state->__pyx_n_s_member_names);
  Py_CLEAR(clear_module_state->__pyx_n_s_members);
  Py_CLEAR(clear_module_state->__pyx_n_s_members_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_memview);
  Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_methname);
  Py_CLEAR(clear_module_state->__pyx_n_s_method);
  Py_CLEAR(clear_module_state->__pyx_n_s_methods);
  Py_CLEAR(clear_module_state->__pyx_n_s_microseconds);
  Py_CLEAR(clear_module_state->__pyx_n_s_minor);
  Py_CLEAR(clear_module_state->__pyx_kp_u_missed);
  Py_CLEAR(clear_module_state->__pyx_n_s_missed_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_mode);
  Py_CLEAR(clear_module_state->__pyx_n_s_module);
  Py_CLEAR(clear_module_state->__pyx_n_u_module);
  Py_CLEAR(clear_module_state->__pyx_n_s_module_2);
  Py_CLEAR(clear_module_state->__pyx_n_s_months);
  Py_CLEAR(clear_module_state->__pyx_kp_u_more_than_one_header_block);
  Py_CLEAR(clear_module_state->__pyx_n_s_move_to_end);
  Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
  Py_CLEAR(clear_module_state->__pyx_n_s_msg);
  Py_CLEAR(clear_module_state->__pyx_n_s_msg_buf);
  Py_CLEAR(clear_module_state->__pyx_n_s_mtype);
  Py_CLEAR(clear_module_state->__pyx_n_b_n);
  Py_CLEAR(clear_module_state->__pyx_n_s_n);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_named_tuple_dict_is_missing);
  Py_CLEAR(clear_module_state->__pyx_kp_u_named_tuple_is_missing);
  Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
  Py_CLEAR(clear_module_state->__pyx_kp_u_neither_are_supported);
  Py_CLEAR(clear_module_state->__pyx_n_s_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_cardinality);
  Py_CLEAR(clear_module_state->__pyx_kp_u_no_codec_implementation_for_Edge);
  Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
  Py_CLEAR(clear_module_state->__pyx_kp_u_no_input);
  Py_CLEAR(clear_module_state->__pyx_kp_u_non_idle_status_after_connect);
  Py_CLEAR(clear_module_state->__pyx_kp_u_non_zero_reserved_bytes_in_durat);
  Py_CLEAR(clear_module_state->__pyx_kp_u_not_connected);
  Py_CLEAR(clear_module_state->__pyx_n_u_nothing);
  Py_CLEAR(clear_module_state->__pyx_n_u_null);
  Py_CLEAR(clear_module_state->__pyx_kp_u_null_codec);
  Py_CLEAR(clear_module_state->__pyx_n_s_num_methods);
  Py_CLEAR(clear_module_state->__pyx_n_s_obj);
  Py_CLEAR(clear_module_state->__pyx_n_s_object);
  Py_CLEAR(clear_module_state->__pyx_n_s_on_log_message);
  Py_CLEAR(clear_module_state->__pyx_kp_u_only_1_dimensional_arrays_are_su);
  Py_CLEAR(clear_module_state->__pyx_kp_u_only_arrays_of_scalars_are_suppo);
  Py_CLEAR(clear_module_state->__pyx_kp_u_only_scalar_multiranges_are_supp);
  Py_CLEAR(clear_module_state->__pyx_kp_u_only_scalar_ranges_are_supported);
  Py_CLEAR(clear_module_state->__pyx_n_s_out_dc);
  Py_CLEAR(clear_module_state->__pyx_n_s_out_type_id);
  Py_CLEAR(clear_module_state->__pyx_n_s_output_format);
  Py_CLEAR(clear_module_state->__pyx_n_s_pack);
  Py_CLEAR(clear_module_state->__pyx_n_s_packet);
  Py_CLEAR(clear_module_state->__pyx_n_s_params);
  Py_CLEAR(clear_module_state->__pyx_n_s_parents);
  Py_CLEAR(clear_module_state->__pyx_n_s_parse);
  Py_CLEAR(clear_module_state->__pyx_n_s_parse_server_final_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_parse_server_first_message);
  Py_CLEAR(clear_module_state->__pyx_n_s_passed_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_passed_args_repr);
  Py_CLEAR(clear_module_state->__pyx_n_s_password);
  Py_CLEAR(clear_module_state->__pyx_n_s_pgproto);
  Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
  Py_CLEAR(clear_module_state->__pyx_n_s_ping);
  Py_CLEAR(clear_module_state->__pyx_n_s_popitem);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_u_python);
  Py_CLEAR(clear_module_state->__pyx_kp_u_python_is_the_only_valid_format);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_CodecsRegistry);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_ExecuteContext);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_LRUMapping);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_SansIOProtocol);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_SansIOProtocolBac);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle___Pyx_EnumMeta);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
  Py_CLEAR(clear_module_state->__pyx_n_s_qc);
  Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_u_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_s_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_query_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_query_cannot_be_executed_with);
  Py_CLEAR(clear_module_state->__pyx_kp_u_query_executed_via);
  Py_CLEAR(clear_module_state->__pyx_n_u_query_required_single);
  Py_CLEAR(clear_module_state->__pyx_n_u_query_required_single_json);
  Py_CLEAR(clear_module_state->__pyx_n_u_query_single);
  Py_CLEAR(clear_module_state->__pyx_n_u_query_single_json);
  Py_CLEAR(clear_module_state->__pyx_kp_u_r_is_out_of_range_for_type_half);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_range_mod);
  Py_CLEAR(clear_module_state->__pyx_n_u_raw_query);
  Py_CLEAR(clear_module_state->__pyx_n_s_re_exec);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
  Py_CLEAR(clear_module_state->__pyx_n_s_ref);
  Py_CLEAR(clear_module_state->__pyx_n_s_reg);
  Py_CLEAR(clear_module_state->__pyx_n_s_register);
  Py_CLEAR(clear_module_state->__pyx_n_s_repr);
  Py_CLEAR(clear_module_state->__pyx_n_s_required);
  Py_CLEAR(clear_module_state->__pyx_n_s_required_args);
  Py_CLEAR(clear_module_state->__pyx_n_s_required_one);
  Py_CLEAR(clear_module_state->__pyx_n_s_res);
  Py_CLEAR(clear_module_state->__pyx_n_s_restore);
  Py_CLEAR(clear_module_state->__pyx_n_s_result);
  Py_CLEAR(clear_module_state->__pyx_kp_u_result_is_not_a_list_but);
  Py_CLEAR(clear_module_state->__pyx_n_s_ret);
  Py_CLEAR(clear_module_state->__pyx_kp_u_returned_no_data);
  Py_CLEAR(clear_module_state->__pyx_n_s_reversed);
  Py_CLEAR(clear_module_state->__pyx_n_s_rv);
  Py_CLEAR(clear_module_state->__pyx_kp_s_s_s);
  Py_CLEAR(clear_module_state->__pyx_kp_s_s_s_d);
  Py_CLEAR(clear_module_state->__pyx_n_s_salt);
  Py_CLEAR(clear_module_state->__pyx_n_s_scram);
  Py_CLEAR(clear_module_state->__pyx_n_s_secret_key);
  Py_CLEAR(clear_module_state->__pyx_n_u_secret_key);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_n_s_send);
  Py_CLEAR(clear_module_state->__pyx_kp_u_server_SCRAM_proof_does_not_matc);
  Py_CLEAR(clear_module_state->__pyx_n_s_server_final);
  Py_CLEAR(clear_module_state->__pyx_n_s_server_first);
  Py_CLEAR(clear_module_state->__pyx_n_s_server_nonce);
  Py_CLEAR(clear_module_state->__pyx_n_s_server_sig);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_connection);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_dataclass_fields_func);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_type_codec);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_shape);
  Py_CLEAR(clear_module_state->__pyx_n_s_size);
  Py_CLEAR(clear_module_state->__pyx_kp_u_size_of_encoded_multirange_datum);
  Py_CLEAR(clear_module_state->__pyx_n_s_spec);
  Py_CLEAR(clear_module_state->__pyx_n_s_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_status);
  Py_CLEAR(clear_module_state->__pyx_n_u_std);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_bigint);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_bool);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_bytes);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_datetime);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_decimal);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_duration);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_float32);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_float64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_int16);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_int32);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_int64);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_json);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_pg_date);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_pg_interval);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_pg_json);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_pg_timestamp);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_pg_timestamptz);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_str);
  Py_CLEAR(clear_module_state->__pyx_kp_u_std_uuid);
  Py_CLEAR(clear_module_state->__pyx_n_s_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_stop);
  Py_CLEAR(clear_module_state->__pyx_n_s_str);
  Py_CLEAR(clear_module_state->__pyx_n_s_str_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
  Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
  Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
  Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
  Py_CLEAR(clear_module_state->__pyx_n_s_strip);
  Py_CLEAR(clear_module_state->__pyx_n_s_struct);
  Py_CLEAR(clear_module_state->__pyx_n_u_suggested_pool_concurrency);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_n_s_sync);
  Py_CLEAR(clear_module_state->__pyx_n_s_sys);
  Py_CLEAR(clear_module_state->__pyx_n_u_system_config);
  Py_CLEAR(clear_module_state->__pyx_n_s_terminate);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_kp_u_the_connection_has_been_closed);
  Py_CLEAR(clear_module_state->__pyx_kp_u_the_connection_has_been_closed_b);
  Py_CLEAR(clear_module_state->__pyx_kp_u_the_server_offered_the_following);
  Py_CLEAR(clear_module_state->__pyx_kp_u_the_server_requested_SASL_authen);
  Py_CLEAR(clear_module_state->__pyx_kp_u_the_server_requested_an_unsuppor);
  Py_CLEAR(clear_module_state->__pyx_n_s_throw);
  Py_CLEAR(clear_module_state->__pyx_n_s_tid);
  Py_CLEAR(clear_module_state->__pyx_n_u_tid);
  Py_CLEAR(clear_module_state->__pyx_n_s_time);
  Py_CLEAR(clear_module_state->__pyx_n_s_timedelta);
  Py_CLEAR(clear_module_state->__pyx_n_u_tname);
  Py_CLEAR(clear_module_state->__pyx_kp_u_too_many_annotations);
  Py_CLEAR(clear_module_state->__pyx_kp_u_too_many_elements_for_a_tuple);
  Py_CLEAR(clear_module_state->__pyx_kp_u_too_many_elements_in_array_value);
  Py_CLEAR(clear_module_state->__pyx_kp_u_too_many_elements_in_multirange);
  Py_CLEAR(clear_module_state->__pyx_kp_u_too_many_elements_in_vector_valu);
  Py_CLEAR(clear_module_state->__pyx_n_s_try_from);
  Py_CLEAR(clear_module_state->__pyx_n_s_try_recv_eagerly);
  Py_CLEAR(clear_module_state->__pyx_n_s_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_type_size);
  Py_CLEAR(clear_module_state->__pyx_n_s_typeid);
  Py_CLEAR(clear_module_state->__pyx_kp_u_typeid_must_be_a_UUID);
  Py_CLEAR(clear_module_state->__pyx_n_s_types);
  Py_CLEAR(clear_module_state->__pyx_n_s_typing);
  Py_CLEAR(clear_module_state->__pyx_kp_s_typing_Optional_int);
  Py_CLEAR(clear_module_state->__pyx_n_u_tzinfo);
  Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
  Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unable_to_decode_data_to_Python);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_NULL_element_in_multi);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_NULL_value_in_array_s);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_message_type);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_query_argument_codec);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_3);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_4);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_5);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_6);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_7);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_8);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_9);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unexpected_trailing_data_in_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
  Py_CLEAR(clear_module_state->__pyx_kp_u_unsupported_authentication_metho);
  Py_CLEAR(clear_module_state->__pyx_n_s_update);
  Py_CLEAR(clear_module_state->__pyx_n_s_upper);
  Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_user);
  Py_CLEAR(clear_module_state->__pyx_n_u_user);
  Py_CLEAR(clear_module_state->__pyx_kp_u_utf_8);
  Py_CLEAR(clear_module_state->__pyx_n_s_uuid);
  Py_CLEAR(clear_module_state->__pyx_n_s_v);
  Py_CLEAR(clear_module_state->__pyx_n_s_value);
  Py_CLEAR(clear_module_state->__pyx_n_s_value_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_values);
  Py_CLEAR(clear_module_state->__pyx_n_s_ver_buf);
  Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
  Py_CLEAR(clear_module_state->__pyx_n_s_wait_for_connect);
  Py_CLEAR(clear_module_state->__pyx_n_s_wait_for_disconnect);
  Py_CLEAR(clear_module_state->__pyx_n_s_wait_for_message);
  Py_CLEAR(clear_module_state->__pyx_n_u_warnings);
  Py_CLEAR(clear_module_state->__pyx_n_s_weakref);
  Py_CLEAR(clear_module_state->__pyx_n_s_wkb);
  Py_CLEAR(clear_module_state->__pyx_n_u_wkb);
  Py_CLEAR(clear_module_state->__pyx_n_s_zfill);
  Py_CLEAR(clear_module_state->__pyx_n_s_zip);
  Py_CLEAR(clear_module_state->__pyx_float_0_0);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_3);
  Py_CLEAR(clear_module_state->__pyx_int_4);
  Py_CLEAR(clear_module_state->__pyx_int_13);
  Py_CLEAR(clear_module_state->__pyx_int_14);
  Py_CLEAR(clear_module_state->__pyx_int_40);
  Py_CLEAR(clear_module_state->__pyx_int_200);
  Py_CLEAR(clear_module_state->__pyx_int_1000);
  Py_CLEAR(clear_module_state->__pyx_int_4097);
  Py_CLEAR(clear_module_state->__pyx_int_10000);
  Py_CLEAR(clear_module_state->__pyx_int_65281);
  Py_CLEAR(clear_module_state->__pyx_int_65282);
  Py_CLEAR(clear_module_state->__pyx_int_65283);
  Py_CLEAR(clear_module_state->__pyx_int_65284);
  Py_CLEAR(clear_module_state->__pyx_int_14808274);
  Py_CLEAR(clear_module_state->__pyx_int_34451156);
  Py_CLEAR(clear_module_state->__pyx_int_52716380);
  Py_CLEAR(clear_module_state->__pyx_int_65974055);
  Py_CLEAR(clear_module_state->__pyx_int_84082689);
  Py_CLEAR(clear_module_state->__pyx_int_84082690);
  Py_CLEAR(clear_module_state->__pyx_int_84082945);
  Py_CLEAR(clear_module_state->__pyx_int_84082946);
  Py_CLEAR(clear_module_state->__pyx_int_87255255);
  Py_CLEAR(clear_module_state->__pyx_int_94322648);
  Py_CLEAR(clear_module_state->__pyx_int_112105877);
  Py_CLEAR(clear_module_state->__pyx_int_113914406);
  Py_CLEAR(clear_module_state->__pyx_int_121062814);
  Py_CLEAR(clear_module_state->__pyx_int_124019026);
  Py_CLEAR(clear_module_state->__pyx_int_136983863);
  Py_CLEAR(clear_module_state->__pyx_int_181010524);
  Py_CLEAR(clear_module_state->__pyx_int_184977713);
  Py_CLEAR(clear_module_state->__pyx_int_222419149);
  Py_CLEAR(clear_module_state->__pyx_int_228165448);
  Py_CLEAR(clear_module_state->__pyx_int_228825662);
  Py_CLEAR(clear_module_state->__pyx_int_238750788);
  Py_CLEAR(clear_module_state->__pyx_int_262771094);
  Py_CLEAR(clear_module_state->__pyx_int_2147483648);
  Py_CLEAR(clear_module_state->__pyx_int_0xffffffffffffffff);
  Py_CLEAR(clear_module_state->__pyx_int_neg_1);
  Py_CLEAR(clear_module_state->__pyx_k__52);
  Py_CLEAR(clear_module_state->__pyx_k__53);
  Py_CLEAR(clear_module_state->__pyx_k__84);
  Py_CLEAR(clear_module_state->__pyx_slice__7);
  Py_CLEAR(clear_module_state->__pyx_tuple__2);
  Py_CLEAR(clear_module_state->__pyx_tuple__6);
  Py_CLEAR(clear_module_state->__pyx_slice__16);
  Py_CLEAR(clear_module_state->__pyx_tuple__10);
  Py_CLEAR(clear_module_state->__pyx_tuple__11);
  Py_CLEAR(clear_module_state->__pyx_tuple__12);
  Py_CLEAR(clear_module_state->__pyx_tuple__14);
  Py_CLEAR(clear_module_state->__pyx_tuple__15);
  Py_CLEAR(clear_module_state->__pyx_tuple__22);
  Py_CLEAR(clear_module_state->__pyx_tuple__23);
  Py_CLEAR(clear_module_state->__pyx_tuple__24);
  Py_CLEAR(clear_module_state->__pyx_tuple__25);
  Py_CLEAR(clear_module_state->__pyx_tuple__26);
  Py_CLEAR(clear_module_state->__pyx_tuple__27);
  Py_CLEAR(clear_module_state->__pyx_tuple__28);
  Py_CLEAR(clear_module_state->__pyx_tuple__29);
  Py_CLEAR(clear_module_state->__pyx_tuple__30);
  Py_CLEAR(clear_module_state->__pyx_tuple__31);
  Py_CLEAR(clear_module_state->__pyx_tuple__32);
  Py_CLEAR(clear_module_state->__pyx_tuple__34);
  Py_CLEAR(clear_module_state->__pyx_tuple__35);
  Py_CLEAR(clear_module_state->__pyx_tuple__36);
  Py_CLEAR(clear_module_state->__pyx_tuple__37);
  Py_CLEAR(clear_module_state->__pyx_tuple__38);
  Py_CLEAR(clear_module_state->__pyx_tuple__39);
  Py_CLEAR(clear_module_state->__pyx_tuple__40);
  Py_CLEAR(clear_module_state->__pyx_tuple__41);
  Py_CLEAR(clear_module_state->__pyx_tuple__42);
  Py_CLEAR(clear_module_state->__pyx_tuple__43);
  Py_CLEAR(clear_module_state->__pyx_tuple__44);
  Py_CLEAR(clear_module_state->__pyx_tuple__45);
  Py_CLEAR(clear_module_state->__pyx_tuple__46);
  Py_CLEAR(clear_module_state->__pyx_tuple__47);
  Py_CLEAR(clear_module_state->__pyx_tuple__49);
  Py_CLEAR(clear_module_state->__pyx_tuple__50);
  Py_CLEAR(clear_module_state->__pyx_tuple__51);
  Py_CLEAR(clear_module_state->__pyx_tuple__54);
  Py_CLEAR(clear_module_state->__pyx_tuple__55);
  Py_CLEAR(clear_module_state->__pyx_tuple__61);
  Py_CLEAR(clear_module_state->__pyx_tuple__67);
  Py_CLEAR(clear_module_state->__pyx_tuple__68);
  Py_CLEAR(clear_module_state->__pyx_tuple__69);
  Py_CLEAR(clear_module_state->__pyx_tuple__70);
  Py_CLEAR(clear_module_state->__pyx_tuple__75);
  Py_CLEAR(clear_module_state->__pyx_tuple__76);
  Py_CLEAR(clear_module_state->__pyx_tuple__77);
  Py_CLEAR(clear_module_state->__pyx_tuple__79);
  Py_CLEAR(clear_module_state->__pyx_tuple__81);
  Py_CLEAR(clear_module_state->__pyx_tuple__82);
  Py_CLEAR(clear_module_state->__pyx_tuple__83);
  Py_CLEAR(clear_module_state->__pyx_tuple__87);
  Py_CLEAR(clear_module_state->__pyx_tuple__92);
  Py_CLEAR(clear_module_state->__pyx_tuple__93);
  Py_CLEAR(clear_module_state->__pyx_tuple__94);
  Py_CLEAR(clear_module_state->__pyx_tuple__95);
  Py_CLEAR(clear_module_state->__pyx_tuple__96);
  Py_CLEAR(clear_module_state->__pyx_tuple__98);
  Py_CLEAR(clear_module_state->__pyx_tuple__100);
  Py_CLEAR(clear_module_state->__pyx_tuple__102);
  Py_CLEAR(clear_module_state->__pyx_tuple__103);
  Py_CLEAR(clear_module_state->__pyx_tuple__109);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__112);
  Py_CLEAR(clear_module_state->__pyx_tuple__113);
  Py_CLEAR(clear_module_state->__pyx_tuple__114);
  Py_CLEAR(clear_module_state->__pyx_tuple__115);
  Py_CLEAR(clear_module_state->__pyx_tuple__116);
  Py_CLEAR(clear_module_state->__pyx_tuple__117);
  Py_CLEAR(clear_module_state->__pyx_tuple__118);
  Py_CLEAR(clear_module_state->__pyx_tuple__119);
  Py_CLEAR(clear_module_state->__pyx_tuple__124);
  Py_CLEAR(clear_module_state->__pyx_tuple__125);
  Py_CLEAR(clear_module_state->__pyx_tuple__126);
  Py_CLEAR(clear_module_state->__pyx_tuple__127);
  Py_CLEAR(clear_module_state->__pyx_tuple__128);
  Py_CLEAR(clear_module_state->__pyx_tuple__129);
  Py_CLEAR(clear_module_state->__pyx_tuple__130);
  Py_CLEAR(clear_module_state->__pyx_tuple__131);
  Py_CLEAR(clear_module_state->__pyx_tuple__132);
  Py_CLEAR(clear_module_state->__pyx_tuple__133);
  Py_CLEAR(clear_module_state->__pyx_tuple__134);
  Py_CLEAR(clear_module_state->__pyx_tuple__135);
  Py_CLEAR(clear_module_state->__pyx_tuple__136);
  Py_CLEAR(clear_module_state->__pyx_tuple__137);
  Py_CLEAR(clear_module_state->__pyx_tuple__138);
  Py_CLEAR(clear_module_state->__pyx_tuple__139);
  Py_CLEAR(clear_module_state->__pyx_tuple__140);
  Py_CLEAR(clear_module_state->__pyx_tuple__141);
  Py_CLEAR(clear_module_state->__pyx_tuple__142);
  Py_CLEAR(clear_module_state->__pyx_tuple__143);
  Py_CLEAR(clear_module_state->__pyx_tuple__144);
  Py_CLEAR(clear_module_state->__pyx_tuple__145);
  Py_CLEAR(clear_module_state->__pyx_tuple__146);
  Py_CLEAR(clear_module_state->__pyx_tuple__147);
  Py_CLEAR(clear_module_state->__pyx_tuple__148);
  Py_CLEAR(clear_module_state->__pyx_tuple__149);
  Py_CLEAR(clear_module_state->__pyx_tuple__150);
  Py_CLEAR(clear_module_state->__pyx_tuple__151);
  Py_CLEAR(clear_module_state->__pyx_tuple__152);
  Py_CLEAR(clear_module_state->__pyx_tuple__153);
  Py_CLEAR(clear_module_state->__pyx_tuple__155);
  Py_CLEAR(clear_module_state->__pyx_tuple__158);
  Py_CLEAR(clear_module_state->__pyx_tuple__181);
  Py_CLEAR(clear_module_state->__pyx_tuple__185);
  Py_CLEAR(clear_module_state->__pyx_tuple__189);
  Py_CLEAR(clear_module_state->__pyx_tuple__191);
  Py_CLEAR(clear_module_state->__pyx_tuple__193);
  Py_CLEAR(clear_module_state->__pyx_tuple__217);
  Py_CLEAR(clear_module_state->__pyx_tuple__225);
  Py_CLEAR(clear_module_state->__pyx_tuple__228);
  Py_CLEAR(clear_module_state->__pyx_tuple__229);
  Py_CLEAR(clear_module_state->__pyx_tuple__230);
  Py_CLEAR(clear_module_state->__pyx_tuple__231);
  Py_CLEAR(clear_module_state->__pyx_tuple__232);
  Py_CLEAR(clear_module_state->__pyx_tuple__233);
  Py_CLEAR(clear_module_state->__pyx_tuple__234);
  Py_CLEAR(clear_module_state->__pyx_tuple__235);
  Py_CLEAR(clear_module_state->__pyx_tuple__237);
  Py_CLEAR(clear_module_state->__pyx_tuple__238);
  Py_CLEAR(clear_module_state->__pyx_tuple__242);
  Py_CLEAR(clear_module_state->__pyx_tuple__243);
  Py_CLEAR(clear_module_state->__pyx_tuple__244);
  Py_CLEAR(clear_module_state->__pyx_tuple__245);
  Py_CLEAR(clear_module_state->__pyx_tuple__246);
  Py_CLEAR(clear_module_state->__pyx_codeobj__56);
  Py_CLEAR(clear_module_state->__pyx_codeobj__57);
  Py_CLEAR(clear_module_state->__pyx_codeobj__58);
  Py_CLEAR(clear_module_state->__pyx_codeobj__59);
  Py_CLEAR(clear_module_state->__pyx_codeobj__60);
  Py_CLEAR(clear_module_state->__pyx_codeobj__62);
  Py_CLEAR(clear_module_state->__pyx_codeobj__63);
  Py_CLEAR(clear_module_state->__pyx_codeobj__64);
  Py_CLEAR(clear_module_state->__pyx_codeobj__66);
  Py_CLEAR(clear_module_state->__pyx_codeobj__71);
  Py_CLEAR(clear_module_state->__pyx_codeobj__72);
  Py_CLEAR(clear_module_state->__pyx_codeobj__73);
  Py_CLEAR(clear_module_state->__pyx_codeobj__74);
  Py_CLEAR(clear_module_state->__pyx_codeobj__78);
  Py_CLEAR(clear_module_state->__pyx_codeobj__86);
  Py_CLEAR(clear_module_state->__pyx_codeobj__88);
  Py_CLEAR(clear_module_state->__pyx_codeobj__89);
  Py_CLEAR(clear_module_state->__pyx_codeobj__90);
  Py_CLEAR(clear_module_state->__pyx_codeobj__91);
  Py_CLEAR(clear_module_state->__pyx_codeobj__97);
  Py_CLEAR(clear_module_state->__pyx_codeobj__99);
  Py_CLEAR(clear_module_state->__pyx_codeobj__101);
  Py_CLEAR(clear_module_state->__pyx_codeobj__104);
  Py_CLEAR(clear_module_state->__pyx_codeobj__105);
  Py_CLEAR(clear_module_state->__pyx_codeobj__106);
  Py_CLEAR(clear_module_state->__pyx_codeobj__107);
  Py_CLEAR(clear_module_state->__pyx_codeobj__108);
  Py_CLEAR(clear_module_state->__pyx_codeobj__110);
  Py_CLEAR(clear_module_state->__pyx_codeobj__120);
  Py_CLEAR(clear_module_state->__pyx_codeobj__121);
  Py_CLEAR(clear_module_state->__pyx_codeobj__122);
  Py_CLEAR(clear_module_state->__pyx_codeobj__123);
  Py_CLEAR(clear_module_state->__pyx_codeobj__159);
  Py_CLEAR(clear_module_state->__pyx_codeobj__160);
  Py_CLEAR(clear_module_state->__pyx_codeobj__161);
  Py_CLEAR(clear_module_state->__pyx_codeobj__162);
  Py_CLEAR(clear_module_state->__pyx_codeobj__163);
  Py_CLEAR(clear_module_state->__pyx_codeobj__164);
  Py_CLEAR(clear_module_state->__pyx_codeobj__165);
  Py_CLEAR(clear_module_state->__pyx_codeobj__166);
  Py_CLEAR(clear_module_state->__pyx_codeobj__167);
  Py_CLEAR(clear_module_state->__pyx_codeobj__168);
  Py_CLEAR(clear_module_state->__pyx_codeobj__169);
  Py_CLEAR(clear_module_state->__pyx_codeobj__170);
  Py_CLEAR(clear_module_state->__pyx_codeobj__171);
  Py_CLEAR(clear_module_state->__pyx_codeobj__172);
  Py_CLEAR(clear_module_state->__pyx_codeobj__173);
  Py_CLEAR(clear_module_state->__pyx_codeobj__174);
  Py_CLEAR(clear_module_state->__pyx_codeobj__175);
  Py_CLEAR(clear_module_state->__pyx_codeobj__176);
  Py_CLEAR(clear_module_state->__pyx_codeobj__177);
  Py_CLEAR(clear_module_state->__pyx_codeobj__178);
  Py_CLEAR(clear_module_state->__pyx_codeobj__179);
  Py_CLEAR(clear_module_state->__pyx_codeobj__180);
  Py_CLEAR(clear_module_state->__pyx_codeobj__182);
  Py_CLEAR(clear_module_state->__pyx_codeobj__183);
  Py_CLEAR(clear_module_state->__pyx_codeobj__184);
  Py_CLEAR(clear_module_state->__pyx_codeobj__186);
  Py_CLEAR(clear_module_state->__pyx_codeobj__187);
  Py_CLEAR(clear_module_state->__pyx_codeobj__188);
  Py_CLEAR(clear_module_state->__pyx_codeobj__190);
  Py_CLEAR(clear_module_state->__pyx_codeobj__192);
  Py_CLEAR(clear_module_state->__pyx_codeobj__194);
  Py_CLEAR(clear_module_state->__pyx_codeobj__195);
  Py_CLEAR(clear_module_state->__pyx_codeobj__196);
  Py_CLEAR(clear_module_state->__pyx_codeobj__197);
  Py_CLEAR(clear_module_state->__pyx_codeobj__198);
  Py_CLEAR(clear_module_state->__pyx_codeobj__199);
  Py_CLEAR(clear_module_state->__pyx_codeobj__200);
  Py_CLEAR(clear_module_state->__pyx_codeobj__201);
  Py_CLEAR(clear_module_state->__pyx_codeobj__202);
  Py_CLEAR(clear_module_state->__pyx_codeobj__203);
  Py_CLEAR(clear_module_state->__pyx_codeobj__204);
  Py_CLEAR(clear_module_state->__pyx_codeobj__205);
  Py_CLEAR(clear_module_state->__pyx_codeobj__206);
  Py_CLEAR(clear_module_state->__pyx_codeobj__207);
  Py_CLEAR(clear_module_state->__pyx_codeobj__208);
  Py_CLEAR(clear_module_state->__pyx_codeobj__209);
  Py_CLEAR(clear_module_state->__pyx_codeobj__210);
  Py_CLEAR(clear_module_state->__pyx_codeobj__211);
  Py_CLEAR(clear_module_state->__pyx_codeobj__212);
  Py_CLEAR(clear_module_state->__pyx_codeobj__213);
  Py_CLEAR(clear_module_state->__pyx_codeobj__214);
  Py_CLEAR(clear_module_state->__pyx_codeobj__215);
  Py_CLEAR(clear_module_state->__pyx_codeobj__216);
  Py_CLEAR(clear_module_state->__pyx_codeobj__218);
  Py_CLEAR(clear_module_state->__pyx_codeobj__219);
  Py_CLEAR(clear_module_state->__pyx_codeobj__220);
  Py_CLEAR(clear_module_state->__pyx_codeobj__221);
  Py_CLEAR(clear_module_state->__pyx_codeobj__222);
  Py_CLEAR(clear_module_state->__pyx_codeobj__223);
  Py_CLEAR(clear_module_state->__pyx_codeobj__224);
  Py_CLEAR(clear_module_state->__pyx_codeobj__226);
  Py_CLEAR(clear_module_state->__pyx_codeobj__227);
  Py_CLEAR(clear_module_state->__pyx_codeobj__236);
  Py_CLEAR(clear_module_state->__pyx_codeobj__239);
  Py_CLEAR(clear_module_state->__pyx_codeobj__240);
  Py_CLEAR(clear_module_state->__pyx_codeobj__247);
  Py_CLEAR(clear_module_state->__pyx_codeobj__248);
  Py_CLEAR(clear_module_state->__pyx_codeobj__249);
  Py_CLEAR(clear_module_state->__pyx_codeobj__250);
  Py_CLEAR(clear_module_state->__pyx_codeobj__251);
  Py_CLEAR(clear_module_state->__pyx_codeobj__252);
  Py_CLEAR(clear_module_state->__pyx_codeobj__253);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_date);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_time);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_datetime);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
  Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_9datatypes_9datatypes_RelativeDuration);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_9datatypes_9datatypes_DateDuration);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_9datatypes_9datatypes_ConfigMemory);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_LRUMapping);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_LRUMapping);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_BaseCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_BaseCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_CodecPythonOverride);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_BaseRecordCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_NullCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_NullCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_ScalarCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_TupleCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_TupleCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_NamedTupleCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_ObjectCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_BaseArrayCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_ArrayCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_RangeCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_RangeCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_MultiRangeCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_SetCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_SetCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_EnumCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_EnumCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_RecordCodec);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_RecordCodec);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_CodecsRegistry);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_ExecuteContext);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_SansIOProtocol);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous);
  Py_VISIT(traverse_module_state->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query);
  Py_VISIT(traverse_module_state->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query);
  Py_VISIT(traverse_module_state->__pyx_ptype___Pyx_EnumMeta);
  Py_VISIT(traverse_module_state->__Pyx_EnumMeta);
  Py_VISIT(traverse_module_state->__pyx_array_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
  Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
  Py_VISIT(traverse_module_state->__pyx_memoryview_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
  Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
  Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
  Py_VISIT(traverse_module_state->__pyx_kp_b_);
  Py_VISIT(traverse_module_state->__pyx_kp_s_);
  Py_VISIT(traverse_module_state->__pyx_kp_u_);
  Py_VISIT(traverse_module_state->__pyx_kp_u_0000);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_10);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_11);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_12);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_13);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_14);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_15);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_16);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_17);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_18);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_19);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_20);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_21);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_22);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_23);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_24);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_25);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_5);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_6);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_7);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_8);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000000_9);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_00000000_0000_0000_0000_00000100_5);
  Py_VISIT(traverse_module_state->__pyx_kp_u_003e434d_cac2_430a_b238_fb39d734);
  Py_VISIT(traverse_module_state->__pyx_kp_u_44c901c0_d922_4894_83c8_061bd05e);
  Py_VISIT(traverse_module_state->__pyx_kp_u_4ba84534_188e_43b4_a7ce_cea2af0f);
  Py_VISIT(traverse_module_state->__pyx_kp_u_4d738878_3a5f_4821_ab76_9d8e7d6b);
  Py_VISIT(traverse_module_state->__pyx_kp_u_7fae5536_6311_4f60_8eb9_096a5d97);
  Py_VISIT(traverse_module_state->__pyx_kp_u_9565dd88_04f5_11ee_a691_0b6ebe17);
  Py_VISIT(traverse_module_state->__pyx_n_s_ALL);
  Py_VISIT(traverse_module_state->__pyx_n_s_ALL_CAPABILITIES);
  Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
  Py_VISIT(traverse_module_state->__pyx_n_s_AT_LEAST_ONE);
  Py_VISIT(traverse_module_state->__pyx_n_s_AT_MOST_ONE);
  Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
  Py_VISIT(traverse_module_state->__pyx_n_u_Array);
  Py_VISIT(traverse_module_state->__pyx_n_s_ArrayCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_ArrayCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ArrayCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ArrayCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_ArrayType);
  Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
  Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_BINARY);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseArrayCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseArrayCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseArrayCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseNamedRecordCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseNamedRecordCodec___reduce_cy);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseNamedRecordCodec___setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseRecordCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseRecordCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseRecordCodec___setstate_cytho);
  Py_VISIT(traverse_module_state->__pyx_n_s_BaseScalarType);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
  Py_VISIT(traverse_module_state->__pyx_n_s_Capability);
  Py_VISIT(traverse_module_state->__pyx_n_s_Cardinality);
  Py_VISIT(traverse_module_state->__pyx_n_s_ClientConnectionClosedError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ClientConnectionError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ClientError);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecPythonOverride);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecPythonOverride___reduce_cyt);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecPythonOverride___setstate_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecPythonOverride_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecsRegistry);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecsRegistry___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecsRegistry___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecsRegistry_clear_cache);
  Py_VISIT(traverse_module_state->__pyx_n_s_CodecsRegistry_set_type_codec);
  Py_VISIT(traverse_module_state->__pyx_n_s_CompilationFlag);
  Py_VISIT(traverse_module_state->__pyx_n_s_Decimal);
  Py_VISIT(traverse_module_state->__pyx_n_u_DerivedEnumValue);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
  Py_VISIT(traverse_module_state->__pyx_n_s_EDGEQL);
  Py_VISIT(traverse_module_state->__pyx_n_s_EDGE_POINTER_IS_LINKPROP);
  Py_VISIT(traverse_module_state->__pyx_n_s_EMPTY_NULL_DATA);
  Py_VISIT(traverse_module_state->__pyx_n_s_EMPTY_RECORD_DATA);
  Py_VISIT(traverse_module_state->__pyx_n_s_EdegDBCodecContext);
  Py_VISIT(traverse_module_state->__pyx_n_s_EdegDBCodecContext___reduce_cyth);
  Py_VISIT(traverse_module_state->__pyx_n_s_EdegDBCodecContext___setstate_cy);
  Py_VISIT(traverse_module_state->__pyx_n_s_EdegDBCodecContext_get_text_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_EdgeDBError);
  Py_VISIT(traverse_module_state->__pyx_n_s_EdgeDBMessage);
  Py_VISIT(traverse_module_state->__pyx_n_s_Element);
  Py_VISIT(traverse_module_state->__pyx_n_s_ElementKind);
  Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
  Py_VISIT(traverse_module_state->__pyx_n_s_EmptyTupleCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_EmptyTupleCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_EmptyTupleCodec___setstate_cytho);
  Py_VISIT(traverse_module_state->__pyx_n_s_EmptyTupleCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
  Py_VISIT(traverse_module_state->__pyx_n_u_Enum);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnumBase);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnumCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnumCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnumCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnumCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnumMeta);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnumType);
  Py_VISIT(traverse_module_state->__pyx_n_s_EnumValue);
  Py_VISIT(traverse_module_state->__pyx_n_s_ExecuteContext);
  Py_VISIT(traverse_module_state->__pyx_n_s_ExecuteContext___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ExecuteContext___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_FIELD);
  Py_VISIT(traverse_module_state->__pyx_n_u_H);
  Py_VISIT(traverse_module_state->__pyx_n_s_INJECT_OUTPUT_OBJECT_IDS);
  Py_VISIT(traverse_module_state->__pyx_n_s_INJECT_OUTPUT_TYPE_IDS);
  Py_VISIT(traverse_module_state->__pyx_n_s_INJECT_OUTPUT_TYPE_NAMES);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_4);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_5);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_6);
  Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
  Py_VISIT(traverse_module_state->__pyx_n_s_InputLanguage);
  Py_VISIT(traverse_module_state->__pyx_n_s_IntEnum);
  Py_VISIT(traverse_module_state->__pyx_n_s_IntFlag);
  Py_VISIT(traverse_module_state->__pyx_n_s_InterfaceError);
  Py_VISIT(traverse_module_state->__pyx_n_s_InvalidArgumentError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
  Py_VISIT(traverse_module_state->__pyx_n_s_Iterable);
  Py_VISIT(traverse_module_state->__pyx_n_s_IterableABC);
  Py_VISIT(traverse_module_state->__pyx_n_s_JSON);
  Py_VISIT(traverse_module_state->__pyx_n_s_JSON_ELEMENTS);
  Py_VISIT(traverse_module_state->__pyx_n_s_KeyError);
  Py_VISIT(traverse_module_state->__pyx_n_s_LINK);
  Py_VISIT(traverse_module_state->__pyx_n_s_LINK_PROPERTY);
  Py_VISIT(traverse_module_state->__pyx_n_s_LRUMapping);
  Py_VISIT(traverse_module_state->__pyx_n_s_LRUMapping___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_LRUMapping___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_LRUMapping_clear);
  Py_VISIT(traverse_module_state->__pyx_n_s_LookupError);
  Py_VISIT(traverse_module_state->__pyx_n_s_MANY);
  Py_VISIT(traverse_module_state->__pyx_n_s_Mapping);
  Py_VISIT(traverse_module_state->__pyx_n_s_MappingABC);
  Py_VISIT(traverse_module_state->__pyx_n_s_MappingProxyType);
  Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
  Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
  Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
  Py_VISIT(traverse_module_state->__pyx_n_s_MultiRange);
  Py_VISIT(traverse_module_state->__pyx_n_u_MultiRange);
  Py_VISIT(traverse_module_state->__pyx_n_s_MultiRangeCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_MultiRangeCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_MultiRangeCodec___setstate_cytho);
  Py_VISIT(traverse_module_state->__pyx_n_s_MultiRangeCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_MultiRangeType);
  Py_VISIT(traverse_module_state->__pyx_n_s_NONE);
  Py_VISIT(traverse_module_state->__pyx_n_s_NO_RESULT);
  Py_VISIT(traverse_module_state->__pyx_n_u_NamedTuple);
  Py_VISIT(traverse_module_state->__pyx_n_s_NamedTupleCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_NamedTupleCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_NamedTupleCodec___setstate_cytho);
  Py_VISIT(traverse_module_state->__pyx_n_s_NamedTupleCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_NamedTupleType);
  Py_VISIT(traverse_module_state->__pyx_n_s_NoDataError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_None);
  Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError);
  Py_VISIT(traverse_module_state->__pyx_n_s_NullCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_NullCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_NullCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_NullCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_b_O);
  Py_VISIT(traverse_module_state->__pyx_n_s_ONE);
  Py_VISIT(traverse_module_state->__pyx_n_u_Object);
  Py_VISIT(traverse_module_state->__pyx_n_s_ObjectCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_ObjectCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ObjectCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ObjectCodec__make_missing_args_e);
  Py_VISIT(traverse_module_state->__pyx_n_s_ObjectCodec_get_dataclass_fields);
  Py_VISIT(traverse_module_state->__pyx_n_s_ObjectCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_ObjectType);
  Py_VISIT(traverse_module_state->__pyx_n_s_OrderedDict);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
  Py_VISIT(traverse_module_state->__pyx_n_s_OutputFormat);
  Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError);
  Py_VISIT(traverse_module_state->__pyx_n_s_PROPERTY);
  Py_VISIT(traverse_module_state->__pyx_n_s_ParameterTypeMismatchError);
  Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ProtocolError);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Python_override);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_EnumBase);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_EnumBase___new);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_EnumBase___repr);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_EnumBase___str);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_EnumMeta___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_EnumMeta___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_FlagBase);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_FlagBase___new);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_FlagBase___repr);
  Py_VISIT(traverse_module_state->__pyx_n_s_Pyx_FlagBase___str);
  Py_VISIT(traverse_module_state->__pyx_n_s_QUERY_SINGLE_METHOD);
  Py_VISIT(traverse_module_state->__pyx_n_s_QueryArgumentError);
  Py_VISIT(traverse_module_state->__pyx_n_s_Range);
  Py_VISIT(traverse_module_state->__pyx_n_u_Range);
  Py_VISIT(traverse_module_state->__pyx_n_s_RangeCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_RangeCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_RangeCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_RangeCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_RangeType);
  Py_VISIT(traverse_module_state->__pyx_n_u_Record);
  Py_VISIT(traverse_module_state->__pyx_n_s_RecordCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_RecordCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_RecordCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ResultCardinalityMismatchError);
  Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError);
  Py_VISIT(traverse_module_state->__pyx_kp_b_SCRAM_SHA_256);
  Py_VISIT(traverse_module_state->__pyx_n_s_SQL);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_4);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_5);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_6);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_7);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocolBackwardsCompatibl_8);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol__auth_sasl);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol__execute);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol__parse);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol__sync);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_abort);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_connect);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_dump);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_execute);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_get_settings);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_is_in_transaction);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_ping);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_restore);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_set_connection);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_terminate);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_try_recv_eagerly);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_wait_for_connect);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_wait_for_disconne);
  Py_VISIT(traverse_module_state->__pyx_n_s_SansIOProtocol_wait_for_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_ScalarCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_ScalarCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ScalarCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_ScalarCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_ScalarType);
  Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
  Py_VISIT(traverse_module_state->__pyx_n_u_Set);
  Py_VISIT(traverse_module_state->__pyx_n_s_SetCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_SetCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_SetCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_SetCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_Sized);
  Py_VISIT(traverse_module_state->__pyx_n_s_SizedABC);
  Py_VISIT(traverse_module_state->__pyx_n_u_SparseObject);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_TYPE_IDS);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Time_zones_are_not_available_fro);
  Py_VISIT(traverse_module_state->__pyx_n_u_Tuple);
  Py_VISIT(traverse_module_state->__pyx_n_s_TupleCodec);
  Py_VISIT(traverse_module_state->__pyx_n_s_TupleCodec___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_TupleCodec___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_TupleCodec_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_TupleType);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_UUID);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Unknown_enum_value_s);
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
  Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
  Py_VISIT(traverse_module_state->__pyx_kp_u__13);
  Py_VISIT(traverse_module_state->__pyx_kp_b__154);
  Py_VISIT(traverse_module_state->__pyx_kp_b__156);
  Py_VISIT(traverse_module_state->__pyx_kp_b__157);
  Py_VISIT(traverse_module_state->__pyx_kp_u__17);
  Py_VISIT(traverse_module_state->__pyx_kp_u__18);
  Py_VISIT(traverse_module_state->__pyx_kp_u__19);
  Py_VISIT(traverse_module_state->__pyx_kp_u__20);
  Py_VISIT(traverse_module_state->__pyx_kp_u__21);
  Py_VISIT(traverse_module_state->__pyx_n_s__241);
  Py_VISIT(traverse_module_state->__pyx_n_s__254);
  Py_VISIT(traverse_module_state->__pyx_kp_u__3);
  Py_VISIT(traverse_module_state->__pyx_kp_u__33);
  Py_VISIT(traverse_module_state->__pyx_kp_u__4);
  Py_VISIT(traverse_module_state->__pyx_kp_u__48);
  Py_VISIT(traverse_module_state->__pyx_n_s__5);
  Py_VISIT(traverse_module_state->__pyx_kp_u__65);
  Py_VISIT(traverse_module_state->__pyx_kp_u__8);
  Py_VISIT(traverse_module_state->__pyx_kp_u__80);
  Py_VISIT(traverse_module_state->__pyx_kp_u__9);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_datetime_datetime_object_was_e);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_datetime_datetime_object_was_e_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_dict_or_Mapping_expected_got_t);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_naive_date_object_tzinfo_is_No);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_naive_datetime_object_tzinfo_i);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_naive_time_object_tzinfo_is_No);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_scalar_codec_expected_for_base);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_sized_iterable_container_expec);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_sized_iterable_container_expec_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_sized_iterable_container_or_ma);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_str_or_gel_EnumValue___tid);
  Py_VISIT(traverse_module_state->__pyx_kp_u_a_timezone_aware_datetime_object);
  Py_VISIT(traverse_module_state->__pyx_n_s_abc);
  Py_VISIT(traverse_module_state->__pyx_n_s_abort);
  Py_VISIT(traverse_module_state->__pyx_n_u_acceptable);
  Py_VISIT(traverse_module_state->__pyx_n_s_aiter);
  Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
  Py_VISIT(traverse_module_state->__pyx_n_s_allow_capabilities);
  Py_VISIT(traverse_module_state->__pyx_kp_u_already_connected);
  Py_VISIT(traverse_module_state->__pyx_kp_u_and);
  Py_VISIT(traverse_module_state->__pyx_n_s_anext);
  Py_VISIT(traverse_module_state->__pyx_n_s_annotations);
  Py_VISIT(traverse_module_state->__pyx_n_u_anytuple);
  Py_VISIT(traverse_module_state->__pyx_n_u_anytype);
  Py_VISIT(traverse_module_state->__pyx_n_s_append);
  Py_VISIT(traverse_module_state->__pyx_n_s_args);
  Py_VISIT(traverse_module_state->__pyx_kp_u_argument);
  Py_VISIT(traverse_module_state->__pyx_kp_u_argument_tuples_do_not_support_o);
  Py_VISIT(traverse_module_state->__pyx_kp_u_arguments);
  Py_VISIT(traverse_module_state->__pyx_n_s_array);
  Py_VISIT(traverse_module_state->__pyx_kp_u_as_it_does_not_return_any_data);
  Py_VISIT(traverse_module_state->__pyx_kp_u_as_it_may_return_more_than_one);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_tasks);
  Py_VISIT(traverse_module_state->__pyx_kp_u_attribute);
  Py_VISIT(traverse_module_state->__pyx_n_s_attrs);
  Py_VISIT(traverse_module_state->__pyx_n_s_attrs_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_auth_sasl);
  Py_VISIT(traverse_module_state->__pyx_n_s_await);
  Py_VISIT(traverse_module_state->__pyx_kp_u_bad_bigint_sign_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_base);
  Py_VISIT(traverse_module_state->__pyx_kp_u_base_scalar_codec_for);
  Py_VISIT(traverse_module_state->__pyx_n_s_base_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_basecodec);
  Py_VISIT(traverse_module_state->__pyx_n_u_big);
  Py_VISIT(traverse_module_state->__pyx_kp_u_bigint_data_has_fractional_part);
  Py_VISIT(traverse_module_state->__pyx_n_s_bint);
  Py_VISIT(traverse_module_state->__pyx_n_s_block_callback);
  Py_VISIT(traverse_module_state->__pyx_n_s_bool);
  Py_VISIT(traverse_module_state->__pyx_n_s_buf);
  Py_VISIT(traverse_module_state->__pyx_n_s_build_client_final_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_build_client_first_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_bytes);
  Py_VISIT(traverse_module_state->__pyx_kp_u_bytes_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_bytes_3);
  Py_VISIT(traverse_module_state->__pyx_n_s_byteswap);
  Py_VISIT(traverse_module_state->__pyx_n_s_c);
  Py_VISIT(traverse_module_state->__pyx_n_u_c);
  Py_VISIT(traverse_module_state->__pyx_kp_u_c1a50ff8_fded_48b0_85c2_4905a848);
  Py_VISIT(traverse_module_state->__pyx_n_s_cache_size);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cal_date_duration);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cal_local_date);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cal_local_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cal_local_time);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cal_relative_duration);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_decode_NamedTuple_expecte);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_decode_Object_expected);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_decode_Record_expected);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_decode_Tuple_expected);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_decode_empty_Tuple_expect);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_encode_empty_Tuple_expect);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_encode_empty_Tuple_expect_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_find_known_ID_for_type);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_handle_arrays_with_more_t);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cannot_not_build_codec_empty_typ);
  Py_VISIT(traverse_module_state->__pyx_n_s_cap_bytes);
  Py_VISIT(traverse_module_state->__pyx_n_s_capabilities);
  Py_VISIT(traverse_module_state->__pyx_n_s_cardinality);
  Py_VISIT(traverse_module_state->__pyx_n_s_cause);
  Py_VISIT(traverse_module_state->__pyx_kp_u_cfg_memory);
  Py_VISIT(traverse_module_state->__pyx_n_s_chr);
  Py_VISIT(traverse_module_state->__pyx_n_s_class);
  Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_clear);
  Py_VISIT(traverse_module_state->__pyx_n_s_clear_cache);
  Py_VISIT(traverse_module_state->__pyx_n_s_client_final);
  Py_VISIT(traverse_module_state->__pyx_n_s_client_first);
  Py_VISIT(traverse_module_state->__pyx_n_s_client_first_bare);
  Py_VISIT(traverse_module_state->__pyx_n_s_client_nonce);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_close);
  Py_VISIT(traverse_module_state->__pyx_n_s_cls);
  Py_VISIT(traverse_module_state->__pyx_n_s_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_codec);
  Py_VISIT(traverse_module_state->__pyx_n_s_codecs);
  Py_VISIT(traverse_module_state->__pyx_kp_u_codecs_are_not_supposed_to_be_in);
  Py_VISIT(traverse_module_state->__pyx_n_s_collections);
  Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
  Py_VISIT(traverse_module_state->__pyx_n_s_con);
  Py_VISIT(traverse_module_state->__pyx_n_s_con_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_connect);
  Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
  Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
  Py_VISIT(traverse_module_state->__pyx_n_s_count);
  Py_VISIT(traverse_module_state->__pyx_n_s_ctx);
  Py_VISIT(traverse_module_state->__pyx_n_s_data);
  Py_VISIT(traverse_module_state->__pyx_kp_u_data_block_before_header_block);
  Py_VISIT(traverse_module_state->__pyx_n_s_data_gen);
  Py_VISIT(traverse_module_state->__pyx_n_s_data_received);
  Py_VISIT(traverse_module_state->__pyx_n_s_database);
  Py_VISIT(traverse_module_state->__pyx_n_u_database);
  Py_VISIT(traverse_module_state->__pyx_n_s_dataclasses);
  Py_VISIT(traverse_module_state->__pyx_n_s_datatypes);
  Py_VISIT(traverse_module_state->__pyx_kp_u_date_duration_has_non_zero_micro);
  Py_VISIT(traverse_module_state->__pyx_n_s_datetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_days);
  Py_VISIT(traverse_module_state->__pyx_n_s_dct);
  Py_VISIT(traverse_module_state->__pyx_n_s_decimal);
  Py_VISIT(traverse_module_state->__pyx_n_s_decoder);
  Py_VISIT(traverse_module_state->__pyx_n_s_desc_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_describe);
  Py_VISIT(traverse_module_state->__pyx_n_s_describe_context);
  Py_VISIT(traverse_module_state->__pyx_n_s_descriptor);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict_2);
  Py_VISIT(traverse_module_state->__pyx_n_u_dim);
  Py_VISIT(traverse_module_state->__pyx_kp_u_dim_key_is_missing);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  Py_VISIT(traverse_module_state->__pyx_kp_u_does_not_correspond_to_any_know);
  Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
  Py_VISIT(traverse_module_state->__pyx_n_s_dump);
  Py_VISIT(traverse_module_state->__pyx_kp_u_either_positional_or_named_argum);
  Py_VISIT(traverse_module_state->__pyx_n_s_element_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_element_types);
  Py_VISIT(traverse_module_state->__pyx_n_s_elements);
  Py_VISIT(traverse_module_state->__pyx_kp_u_elements_got);
  Py_VISIT(traverse_module_state->__pyx_kp_u_elements_in_a_sparse_vector_cann);
  Py_VISIT(traverse_module_state->__pyx_kp_u_elements_in_the_tuple_got);
  Py_VISIT(traverse_module_state->__pyx_n_s_empty);
  Py_VISIT(traverse_module_state->__pyx_kp_u_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_n_s_encode);
  Py_VISIT(traverse_module_state->__pyx_n_s_encoder);
  Py_VISIT(traverse_module_state->__pyx_n_s_enum);
  Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
  Py_VISIT(traverse_module_state->__pyx_n_s_enums);
  Py_VISIT(traverse_module_state->__pyx_kp_s_enums_Capability);
  Py_VISIT(traverse_module_state->__pyx_n_s_error);
  Py_VISIT(traverse_module_state->__pyx_n_s_error_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_errors);
  Py_VISIT(traverse_module_state->__pyx_n_s_ex);
  Py_VISIT(traverse_module_state->__pyx_n_s_exc);
  Py_VISIT(traverse_module_state->__pyx_n_s_execute);
  Py_VISIT(traverse_module_state->__pyx_n_s_execute_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_expect_one);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected);
  Py_VISIT(traverse_module_state->__pyx_n_u_expected_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_SASLContinue_from_the_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_SASLFinal_from_the_serv);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_a_Decimal_or_an_int);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_a_record_with_a_single);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_a_two_dimensional_array);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_an_int);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_no_named_arguments);
  Py_VISIT(traverse_module_state->__pyx_kp_u_expected_no_positional_arguments);
  Py_VISIT(traverse_module_state->__pyx_n_s_expected_server_sig);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ext_pgvector_halfvec);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ext_pgvector_sparsevec);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ext_pgvector_vector);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ext_postgis_box2d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ext_postgis_box3d);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ext_postgis_geography);
  Py_VISIT(traverse_module_state->__pyx_kp_u_ext_postgis_geometry);
  Py_VISIT(traverse_module_state->__pyx_kp_u_extra);
  Py_VISIT(traverse_module_state->__pyx_n_s_extra_args);
  Py_VISIT(traverse_module_state->__pyx_n_u_f);
  Py_VISIT(traverse_module_state->__pyx_n_s_field);
  Py_VISIT(traverse_module_state->__pyx_n_s_field_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_fields);
  Py_VISIT(traverse_module_state->__pyx_n_u_fields);
  Py_VISIT(traverse_module_state->__pyx_kp_u_first_message_is_not_DataMsg);
  Py_VISIT(traverse_module_state->__pyx_n_s_flags);
  Py_VISIT(traverse_module_state->__pyx_n_s_format);
  Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
  Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_bytes);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_from_json);
  Py_VISIT(traverse_module_state->__pyx_kp_u_fts_language);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_gel);
  Py_VISIT(traverse_module_state->__pyx_n_u_gel);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gel_DerivedEnumValue);
  Py_VISIT(traverse_module_state->__pyx_n_s_gel_datatypes);
  Py_VISIT(traverse_module_state->__pyx_n_s_gel_pgproto);
  Py_VISIT(traverse_module_state->__pyx_n_s_gel_pgproto_pgproto);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_array_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_base_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_codecs_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_enum_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_namedtuple_p);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_object_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_range_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_scalar_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_set_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_codecs_tuple_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_lru_pyx);
  Py_VISIT(traverse_module_state->__pyx_n_s_gel_protocol_protocol);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_protocol_pyx);
  Py_VISIT(traverse_module_state->__pyx_kp_s_gel_protocol_protocol_v0_pyx);
  Py_VISIT(traverse_module_state->__pyx_n_s_generate_nonce);
  Py_VISIT(traverse_module_state->__pyx_n_s_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_get);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_code);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_dataclass_fields);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_pos);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_settings);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_text_codec);
  Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_got);
  Py_VISIT(traverse_module_state->__pyx_kp_u_got_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
  Py_VISIT(traverse_module_state->__pyx_n_s_handshake_buf);
  Py_VISIT(traverse_module_state->__pyx_n_s_header);
  Py_VISIT(traverse_module_state->__pyx_kp_u_header_block_after_data_block);
  Py_VISIT(traverse_module_state->__pyx_kp_u_header_block_was_not_received);
  Py_VISIT(traverse_module_state->__pyx_n_s_header_callback);
  Py_VISIT(traverse_module_state->__pyx_n_s_header_received);
  Py_VISIT(traverse_module_state->__pyx_n_s_headers);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_implicit_limit);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_in_dc);
  Py_VISIT(traverse_module_state->__pyx_n_s_in_type_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_inc_lower);
  Py_VISIT(traverse_module_state->__pyx_n_s_inc_upper);
  Py_VISIT(traverse_module_state->__pyx_n_s_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_index_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_init);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
  Py_VISIT(traverse_module_state->__pyx_n_s_inline_typeids);
  Py_VISIT(traverse_module_state->__pyx_n_s_inline_typenames);
  Py_VISIT(traverse_module_state->__pyx_n_s_input_language);
  Py_VISIT(traverse_module_state->__pyx_n_s_inspect);
  Py_VISIT(traverse_module_state->__pyx_n_s_int);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_array_element);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_array_element_at_index_N);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_array_size_received);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_buffer_length);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_input_for_query_argument);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_input_for_query_argument_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_input_for_state_argument);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_multirange_element);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_number_of_columns_expect);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_range_lower_bound);
  Py_VISIT(traverse_module_state->__pyx_kp_u_invalid_range_upper_bound);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_already_registered);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_empty);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_expected_as_a_valid_enum_arg);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_implicit);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_in_transaction);
  Py_VISIT(traverse_module_state->__pyx_kp_u_is_required_but_received_None);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_items);
  Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
  Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
  Py_VISIT(traverse_module_state->__pyx_n_s_itercount);
  Py_VISIT(traverse_module_state->__pyx_n_s_json);
  Py_VISIT(traverse_module_state->__pyx_n_s_k);
  Py_VISIT(traverse_module_state->__pyx_kp_u_key);
  Py_VISIT(traverse_module_state->__pyx_n_s_keys);
  Py_VISIT(traverse_module_state->__pyx_n_s_kind);
  Py_VISIT(traverse_module_state->__pyx_n_s_kwargs);
  Py_VISIT(traverse_module_state->__pyx_n_u_l);
  Py_VISIT(traverse_module_state->__pyx_n_s_last);
  Py_VISIT(traverse_module_state->__pyx_n_s_legacy_execute);
  Py_VISIT(traverse_module_state->__pyx_n_s_legacy_execute_anonymous);
  Py_VISIT(traverse_module_state->__pyx_n_s_legacy_optimistic_execute);
  Py_VISIT(traverse_module_state->__pyx_n_s_legacy_parse);
  Py_VISIT(traverse_module_state->__pyx_n_s_legacy_simple_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_loads);
  Py_VISIT(traverse_module_state->__pyx_n_s_lookup);
  Py_VISIT(traverse_module_state->__pyx_n_s_lower);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_major);
  Py_VISIT(traverse_module_state->__pyx_n_s_make_missing_args_error_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_make_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_make_type_locals_genexpr);
  Py_VISIT(traverse_module_state->__pyx_n_s_maxsize);
  Py_VISIT(traverse_module_state->__pyx_kp_u_maxsize_is_expected_to_be_greate);
  Py_VISIT(traverse_module_state->__pyx_n_s_member_names);
  Py_VISIT(traverse_module_state->__pyx_n_s_members);
  Py_VISIT(traverse_module_state->__pyx_n_s_members_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_memview);
  Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_methname);
  Py_VISIT(traverse_module_state->__pyx_n_s_method);
  Py_VISIT(traverse_module_state->__pyx_n_s_methods);
  Py_VISIT(traverse_module_state->__pyx_n_s_microseconds);
  Py_VISIT(traverse_module_state->__pyx_n_s_minor);
  Py_VISIT(traverse_module_state->__pyx_kp_u_missed);
  Py_VISIT(traverse_module_state->__pyx_n_s_missed_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_mode);
  Py_VISIT(traverse_module_state->__pyx_n_s_module);
  Py_VISIT(traverse_module_state->__pyx_n_u_module);
  Py_VISIT(traverse_module_state->__pyx_n_s_module_2);
  Py_VISIT(traverse_module_state->__pyx_n_s_months);
  Py_VISIT(traverse_module_state->__pyx_kp_u_more_than_one_header_block);
  Py_VISIT(traverse_module_state->__pyx_n_s_move_to_end);
  Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
  Py_VISIT(traverse_module_state->__pyx_n_s_msg);
  Py_VISIT(traverse_module_state->__pyx_n_s_msg_buf);
  Py_VISIT(traverse_module_state->__pyx_n_s_mtype);
  Py_VISIT(traverse_module_state->__pyx_n_b_n);
  Py_VISIT(traverse_module_state->__pyx_n_s_n);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_named_tuple_dict_is_missing);
  Py_VISIT(traverse_module_state->__pyx_kp_u_named_tuple_is_missing);
  Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
  Py_VISIT(traverse_module_state->__pyx_kp_u_neither_are_supported);
  Py_VISIT(traverse_module_state->__pyx_n_s_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_cardinality);
  Py_VISIT(traverse_module_state->__pyx_kp_u_no_codec_implementation_for_Edge);
  Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
  Py_VISIT(traverse_module_state->__pyx_kp_u_no_input);
  Py_VISIT(traverse_module_state->__pyx_kp_u_non_idle_status_after_connect);
  Py_VISIT(traverse_module_state->__pyx_kp_u_non_zero_reserved_bytes_in_durat);
  Py_VISIT(traverse_module_state->__pyx_kp_u_not_connected);
  Py_VISIT(traverse_module_state->__pyx_n_u_nothing);
  Py_VISIT(traverse_module_state->__pyx_n_u_null);
  Py_VISIT(traverse_module_state->__pyx_kp_u_null_codec);
  Py_VISIT(traverse_module_state->__pyx_n_s_num_methods);
  Py_VISIT(traverse_module_state->__pyx_n_s_obj);
  Py_VISIT(traverse_module_state->__pyx_n_s_object);
  Py_VISIT(traverse_module_state->__pyx_n_s_on_log_message);
  Py_VISIT(traverse_module_state->__pyx_kp_u_only_1_dimensional_arrays_are_su);
  Py_VISIT(traverse_module_state->__pyx_kp_u_only_arrays_of_scalars_are_suppo);
  Py_VISIT(traverse_module_state->__pyx_kp_u_only_scalar_multiranges_are_supp);
  Py_VISIT(traverse_module_state->__pyx_kp_u_only_scalar_ranges_are_supported);
  Py_VISIT(traverse_module_state->__pyx_n_s_out_dc);
  Py_VISIT(traverse_module_state->__pyx_n_s_out_type_id);
  Py_VISIT(traverse_module_state->__pyx_n_s_output_format);
  Py_VISIT(traverse_module_state->__pyx_n_s_pack);
  Py_VISIT(traverse_module_state->__pyx_n_s_packet);
  Py_VISIT(traverse_module_state->__pyx_n_s_params);
  Py_VISIT(traverse_module_state->__pyx_n_s_parents);
  Py_VISIT(traverse_module_state->__pyx_n_s_parse);
  Py_VISIT(traverse_module_state->__pyx_n_s_parse_server_final_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_parse_server_first_message);
  Py_VISIT(traverse_module_state->__pyx_n_s_passed_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_passed_args_repr);
  Py_VISIT(traverse_module_state->__pyx_n_s_password);
  Py_VISIT(traverse_module_state->__pyx_n_s_pgproto);
  Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
  Py_VISIT(traverse_module_state->__pyx_n_s_ping);
  Py_VISIT(traverse_module_state->__pyx_n_s_popitem);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_u_python);
  Py_VISIT(traverse_module_state->__pyx_kp_u_python_is_the_only_valid_format);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_CodecsRegistry);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_ExecuteContext);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_LRUMapping);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_SansIOProtocol);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_SansIOProtocolBac);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle___Pyx_EnumMeta);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
  Py_VISIT(traverse_module_state->__pyx_n_s_qc);
  Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_u_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_s_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_query_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_query_cannot_be_executed_with);
  Py_VISIT(traverse_module_state->__pyx_kp_u_query_executed_via);
  Py_VISIT(traverse_module_state->__pyx_n_u_query_required_single);
  Py_VISIT(traverse_module_state->__pyx_n_u_query_required_single_json);
  Py_VISIT(traverse_module_state->__pyx_n_u_query_single);
  Py_VISIT(traverse_module_state->__pyx_n_u_query_single_json);
  Py_VISIT(traverse_module_state->__pyx_kp_u_r_is_out_of_range_for_type_half);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_range_mod);
  Py_VISIT(traverse_module_state->__pyx_n_u_raw_query);
  Py_VISIT(traverse_module_state->__pyx_n_s_re_exec);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
  Py_VISIT(traverse_module_state->__pyx_n_s_ref);
  Py_VISIT(traverse_module_state->__pyx_n_s_reg);
  Py_VISIT(traverse_module_state->__pyx_n_s_register);
  Py_VISIT(traverse_module_state->__pyx_n_s_repr);
  Py_VISIT(traverse_module_state->__pyx_n_s_required);
  Py_VISIT(traverse_module_state->__pyx_n_s_required_args);
  Py_VISIT(traverse_module_state->__pyx_n_s_required_one);
  Py_VISIT(traverse_module_state->__pyx_n_s_res);
  Py_VISIT(traverse_module_state->__pyx_n_s_restore);
  Py_VISIT(traverse_module_state->__pyx_n_s_result);
  Py_VISIT(traverse_module_state->__pyx_kp_u_result_is_not_a_list_but);
  Py_VISIT(traverse_module_state->__pyx_n_s_ret);
  Py_VISIT(traverse_module_state->__pyx_kp_u_returned_no_data);
  Py_VISIT(traverse_module_state->__pyx_n_s_reversed);
  Py_VISIT(traverse_module_state->__pyx_n_s_rv);
  Py_VISIT(traverse_module_state->__pyx_kp_s_s_s);
  Py_VISIT(traverse_module_state->__pyx_kp_s_s_s_d);
  Py_VISIT(traverse_module_state->__pyx_n_s_salt);
  Py_VISIT(traverse_module_state->__pyx_n_s_scram);
  Py_VISIT(traverse_module_state->__pyx_n_s_secret_key);
  Py_VISIT(traverse_module_state->__pyx_n_u_secret_key);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_n_s_send);
  Py_VISIT(traverse_module_state->__pyx_kp_u_server_SCRAM_proof_does_not_matc);
  Py_VISIT(traverse_module_state->__pyx_n_s_server_final);
  Py_VISIT(traverse_module_state->__pyx_n_s_server_first);
  Py_VISIT(traverse_module_state->__pyx_n_s_server_nonce);
  Py_VISIT(traverse_module_state->__pyx_n_s_server_sig);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_connection);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_dataclass_fields_func);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_type_codec);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_shape);
  Py_VISIT(traverse_module_state->__pyx_n_s_size);
  Py_VISIT(traverse_module_state->__pyx_kp_u_size_of_encoded_multirange_datum);
  Py_VISIT(traverse_module_state->__pyx_n_s_spec);
  Py_VISIT(traverse_module_state->__pyx_n_s_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_status);
  Py_VISIT(traverse_module_state->__pyx_n_u_std);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_bigint);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_bool);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_bytes);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_datetime);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_decimal);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_duration);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_float32);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_float64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_int16);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_int32);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_int64);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_json);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_pg_date);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_pg_interval);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_pg_json);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_pg_timestamp);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_pg_timestamptz);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_str);
  Py_VISIT(traverse_module_state->__pyx_kp_u_std_uuid);
  Py_VISIT(traverse_module_state->__pyx_n_s_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_stop);
  Py_VISIT(traverse_module_state->__pyx_n_s_str);
  Py_VISIT(traverse_module_state->__pyx_n_s_str_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
  Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
  Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
  Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
  Py_VISIT(traverse_module_state->__pyx_n_s_strip);
  Py_VISIT(traverse_module_state->__pyx_n_s_struct);
  Py_VISIT(traverse_module_state->__pyx_n_u_suggested_pool_concurrency);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_n_s_sync);
  Py_VISIT(traverse_module_state->__pyx_n_s_sys);
  Py_VISIT(traverse_module_state->__pyx_n_u_system_config);
  Py_VISIT(traverse_module_state->__pyx_n_s_terminate);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_kp_u_the_connection_has_been_closed);
  Py_VISIT(traverse_module_state->__pyx_kp_u_the_connection_has_been_closed_b);
  Py_VISIT(traverse_module_state->__pyx_kp_u_the_server_offered_the_following);
  Py_VISIT(traverse_module_state->__pyx_kp_u_the_server_requested_SASL_authen);
  Py_VISIT(traverse_module_state->__pyx_kp_u_the_server_requested_an_unsuppor);
  Py_VISIT(traverse_module_state->__pyx_n_s_throw);
  Py_VISIT(traverse_module_state->__pyx_n_s_tid);
  Py_VISIT(traverse_module_state->__pyx_n_u_tid);
  Py_VISIT(traverse_module_state->__pyx_n_s_time);
  Py_VISIT(traverse_module_state->__pyx_n_s_timedelta);
  Py_VISIT(traverse_module_state->__pyx_n_u_tname);
  Py_VISIT(traverse_module_state->__pyx_kp_u_too_many_annotations);
  Py_VISIT(traverse_module_state->__pyx_kp_u_too_many_elements_for_a_tuple);
  Py_VISIT(traverse_module_state->__pyx_kp_u_too_many_elements_in_array_value);
  Py_VISIT(traverse_module_state->__pyx_kp_u_too_many_elements_in_multirange);
  Py_VISIT(traverse_module_state->__pyx_kp_u_too_many_elements_in_vector_valu);
  Py_VISIT(traverse_module_state->__pyx_n_s_try_from);
  Py_VISIT(traverse_module_state->__pyx_n_s_try_recv_eagerly);
  Py_VISIT(traverse_module_state->__pyx_n_s_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_type_size);
  Py_VISIT(traverse_module_state->__pyx_n_s_typeid);
  Py_VISIT(traverse_module_state->__pyx_kp_u_typeid_must_be_a_UUID);
  Py_VISIT(traverse_module_state->__pyx_n_s_types);
  Py_VISIT(traverse_module_state->__pyx_n_s_typing);
  Py_VISIT(traverse_module_state->__pyx_kp_s_typing_Optional_int);
  Py_VISIT(traverse_module_state->__pyx_n_u_tzinfo);
  Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
  Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unable_to_decode_data_to_Python);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_NULL_element_in_multi);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_NULL_value_in_array_s);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_message_type);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_query_argument_codec);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_3);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_4);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_5);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_6);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_7);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_8);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_buff_9);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unexpected_trailing_data_in_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
  Py_VISIT(traverse_module_state->__pyx_kp_u_unsupported_authentication_metho);
  Py_VISIT(traverse_module_state->__pyx_n_s_update);
  Py_VISIT(traverse_module_state->__pyx_n_s_upper);
  Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_user);
  Py_VISIT(traverse_module_state->__pyx_n_u_user);
  Py_VISIT(traverse_module_state->__pyx_kp_u_utf_8);
  Py_VISIT(traverse_module_state->__pyx_n_s_uuid);
  Py_VISIT(traverse_module_state->__pyx_n_s_v);
  Py_VISIT(traverse_module_state->__pyx_n_s_value);
  Py_VISIT(traverse_module_state->__pyx_n_s_value_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_values);
  Py_VISIT(traverse_module_state->__pyx_n_s_ver_buf);
  Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
  Py_VISIT(traverse_module_state->__pyx_n_s_wait_for_connect);
  Py_VISIT(traverse_module_state->__pyx_n_s_wait_for_disconnect);
  Py_VISIT(traverse_module_state->__pyx_n_s_wait_for_message);
  Py_VISIT(traverse_module_state->__pyx_n_u_warnings);
  Py_VISIT(traverse_module_state->__pyx_n_s_weakref);
  Py_VISIT(traverse_module_state->__pyx_n_s_wkb);
  Py_VISIT(traverse_module_state->__pyx_n_u_wkb);
  Py_VISIT(traverse_module_state->__pyx_n_s_zfill);
  Py_VISIT(traverse_module_state->__pyx_n_s_zip);
  Py_VISIT(traverse_module_state->__pyx_float_0_0);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_1);
  Py_VISIT(traverse_module_state->__pyx_int_2);
  Py_VISIT(traverse_module_state->__pyx_int_3);
  Py_VISIT(traverse_module_state->__pyx_int_4);
  Py_VISIT(traverse_module_state->__pyx_int_13);
  Py_VISIT(traverse_module_state->__pyx_int_14);
  Py_VISIT(traverse_module_state->__pyx_int_40);
  Py_VISIT(traverse_module_state->__pyx_int_200);
  Py_VISIT(traverse_module_state->__pyx_int_1000);
  Py_VISIT(traverse_module_state->__pyx_int_4097);
  Py_VISIT(traverse_module_state->__pyx_int_10000);
  Py_VISIT(traverse_module_state->__pyx_int_65281);
  Py_VISIT(traverse_module_state->__pyx_int_65282);
  Py_VISIT(traverse_module_state->__pyx_int_65283);
  Py_VISIT(traverse_module_state->__pyx_int_65284);
  Py_VISIT(traverse_module_state->__pyx_int_14808274);
  Py_VISIT(traverse_module_state->__pyx_int_34451156);
  Py_VISIT(traverse_module_state->__pyx_int_52716380);
  Py_VISIT(traverse_module_state->__pyx_int_65974055);
  Py_VISIT(traverse_module_state->__pyx_int_84082689);
  Py_VISIT(traverse_module_state->__pyx_int_84082690);
  Py_VISIT(traverse_module_state->__pyx_int_84082945);
  Py_VISIT(traverse_module_state->__pyx_int_84082946);
  Py_VISIT(traverse_module_state->__pyx_int_87255255);
  Py_VISIT(traverse_module_state->__pyx_int_94322648);
  Py_VISIT(traverse_module_state->__pyx_int_112105877);
  Py_VISIT(traverse_module_state->__pyx_int_113914406);
  Py_VISIT(traverse_module_state->__pyx_int_121062814);
  Py_VISIT(traverse_module_state->__pyx_int_124019026);
  Py_VISIT(traverse_module_state->__pyx_int_136983863);
  Py_VISIT(traverse_module_state->__pyx_int_181010524);
  Py_VISIT(traverse_module_state->__pyx_int_184977713);
  Py_VISIT(traverse_module_state->__pyx_int_222419149);
  Py_VISIT(traverse_module_state->__pyx_int_228165448);
  Py_VISIT(traverse_module_state->__pyx_int_228825662);
  Py_VISIT(traverse_module_state->__pyx_int_238750788);
  Py_VISIT(traverse_module_state->__pyx_int_262771094);
  Py_VISIT(traverse_module_state->__pyx_int_2147483648);
  Py_VISIT(traverse_module_state->__pyx_int_0xffffffffffffffff);
  Py_VISIT(traverse_module_state->__pyx_int_neg_1);
  Py_VISIT(traverse_module_state->__pyx_k__52);
  Py_VISIT(traverse_module_state->__pyx_k__53);
  Py_VISIT(traverse_module_state->__pyx_k__84);
  Py_VISIT(traverse_module_state->__pyx_slice__7);
  Py_VISIT(traverse_module_state->__pyx_tuple__2);
  Py_VISIT(traverse_module_state->__pyx_tuple__6);
  Py_VISIT(traverse_module_state->__pyx_slice__16);
  Py_VISIT(traverse_module_state->__pyx_tuple__10);
  Py_VISIT(traverse_module_state->__pyx_tuple__11);
  Py_VISIT(traverse_module_state->__pyx_tuple__12);
  Py_VISIT(traverse_module_state->__pyx_tuple__14);
  Py_VISIT(traverse_module_state->__pyx_tuple__15);
  Py_VISIT(traverse_module_state->__pyx_tuple__22);
  Py_VISIT(traverse_module_state->__pyx_tuple__23);
  Py_VISIT(traverse_module_state->__pyx_tuple__24);
  Py_VISIT(traverse_module_state->__pyx_tuple__25);
  Py_VISIT(traverse_module_state->__pyx_tuple__26);
  Py_VISIT(traverse_module_state->__pyx_tuple__27);
  Py_VISIT(traverse_module_state->__pyx_tuple__28);
  Py_VISIT(traverse_module_state->__pyx_tuple__29);
  Py_VISIT(traverse_module_state->__pyx_tuple__30);
  Py_VISIT(traverse_module_state->__pyx_tuple__31);
  Py_VISIT(traverse_module_state->__pyx_tuple__32);
  Py_VISIT(traverse_module_state->__pyx_tuple__34);
  Py_VISIT(traverse_module_state->__pyx_tuple__35);
  Py_VISIT(traverse_module_state->__pyx_tuple__36);
  Py_VISIT(traverse_module_state->__pyx_tuple__37);
  Py_VISIT(traverse_module_state->__pyx_tuple__38);
  Py_VISIT(traverse_module_state->__pyx_tuple__39);
  Py_VISIT(traverse_module_state->__pyx_tuple__40);
  Py_VISIT(traverse_module_state->__pyx_tuple__41);
  Py_VISIT(traverse_module_state->__pyx_tuple__42);
  Py_VISIT(traverse_module_state->__pyx_tuple__43);
  Py_VISIT(traverse_module_state->__pyx_tuple__44);
  Py_VISIT(traverse_module_state->__pyx_tuple__45);
  Py_VISIT(traverse_module_state->__pyx_tuple__46);
  Py_VISIT(traverse_module_state->__pyx_tuple__47);
  Py_VISIT(traverse_module_state->__pyx_tuple__49);
  Py_VISIT(traverse_module_state->__pyx_tuple__50);
  Py_VISIT(traverse_module_state->__pyx_tuple__51);
  Py_VISIT(traverse_module_state->__pyx_tuple__54);
  Py_VISIT(traverse_module_state->__pyx_tuple__55);
  Py_VISIT(traverse_module_state->__pyx_tuple__61);
  Py_VISIT(traverse_module_state->__pyx_tuple__67);
  Py_VISIT(traverse_module_state->__pyx_tuple__68);
  Py_VISIT(traverse_module_state->__pyx_tuple__69);
  Py_VISIT(traverse_module_state->__pyx_tuple__70);
  Py_VISIT(traverse_module_state->__pyx_tuple__75);
  Py_VISIT(traverse_module_state->__pyx_tuple__76);
  Py_VISIT(traverse_module_state->__pyx_tuple__77);
  Py_VISIT(traverse_module_state->__pyx_tuple__79);
  Py_VISIT(traverse_module_state->__pyx_tuple__81);
  Py_VISIT(traverse_module_state->__pyx_tuple__82);
  Py_VISIT(traverse_module_state->__pyx_tuple__83);
  Py_VISIT(traverse_module_state->__pyx_tuple__87);
  Py_VISIT(traverse_module_state->__pyx_tuple__92);
  Py_VISIT(traverse_module_state->__pyx_tuple__93);
  Py_VISIT(traverse_module_state->__pyx_tuple__94);
  Py_VISIT(traverse_module_state->__pyx_tuple__95);
  Py_VISIT(traverse_module_state->__pyx_tuple__96);
  Py_VISIT(traverse_module_state->__pyx_tuple__98);
  Py_VISIT(traverse_module_state->__pyx_tuple__100);
  Py_VISIT(traverse_module_state->__pyx_tuple__102);
  Py_VISIT(traverse_module_state->__pyx_tuple__103);
  Py_VISIT(traverse_module_state->__pyx_tuple__109);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__112);
  Py_VISIT(traverse_module_state->__pyx_tuple__113);
  Py_VISIT(traverse_module_state->__pyx_tuple__114);
  Py_VISIT(traverse_module_state->__pyx_tuple__115);
  Py_VISIT(traverse_module_state->__pyx_tuple__116);
  Py_VISIT(traverse_module_state->__pyx_tuple__117);
  Py_VISIT(traverse_module_state->__pyx_tuple__118);
  Py_VISIT(traverse_module_state->__pyx_tuple__119);
  Py_VISIT(traverse_module_state->__pyx_tuple__124);
  Py_VISIT(traverse_module_state->__pyx_tuple__125);
  Py_VISIT(traverse_module_state->__pyx_tuple__126);
  Py_VISIT(traverse_module_state->__pyx_tuple__127);
  Py_VISIT(traverse_module_state->__pyx_tuple__128);
  Py_VISIT(traverse_module_state->__pyx_tuple__129);
  Py_VISIT(traverse_module_state->__pyx_tuple__130);
  Py_VISIT(traverse_module_state->__pyx_tuple__131);
  Py_VISIT(traverse_module_state->__pyx_tuple__132);
  Py_VISIT(traverse_module_state->__pyx_tuple__133);
  Py_VISIT(traverse_module_state->__pyx_tuple__134);
  Py_VISIT(traverse_module_state->__pyx_tuple__135);
  Py_VISIT(traverse_module_state->__pyx_tuple__136);
  Py_VISIT(traverse_module_state->__pyx_tuple__137);
  Py_VISIT(traverse_module_state->__pyx_tuple__138);
  Py_VISIT(traverse_module_state->__pyx_tuple__139);
  Py_VISIT(traverse_module_state->__pyx_tuple__140);
  Py_VISIT(traverse_module_state->__pyx_tuple__141);
  Py_VISIT(traverse_module_state->__pyx_tuple__142);
  Py_VISIT(traverse_module_state->__pyx_tuple__143);
  Py_VISIT(traverse_module_state->__pyx_tuple__144);
  Py_VISIT(traverse_module_state->__pyx_tuple__145);
  Py_VISIT(traverse_module_state->__pyx_tuple__146);
  Py_VISIT(traverse_module_state->__pyx_tuple__147);
  Py_VISIT(traverse_module_state->__pyx_tuple__148);
  Py_VISIT(traverse_module_state->__pyx_tuple__149);
  Py_VISIT(traverse_module_state->__pyx_tuple__150);
  Py_VISIT(traverse_module_state->__pyx_tuple__151);
  Py_VISIT(traverse_module_state->__pyx_tuple__152);
  Py_VISIT(traverse_module_state->__pyx_tuple__153);
  Py_VISIT(traverse_module_state->__pyx_tuple__155);
  Py_VISIT(traverse_module_state->__pyx_tuple__158);
  Py_VISIT(traverse_module_state->__pyx_tuple__181);
  Py_VISIT(traverse_module_state->__pyx_tuple__185);
  Py_VISIT(traverse_module_state->__pyx_tuple__189);
  Py_VISIT(traverse_module_state->__pyx_tuple__191);
  Py_VISIT(traverse_module_state->__pyx_tuple__193);
  Py_VISIT(traverse_module_state->__pyx_tuple__217);
  Py_VISIT(traverse_module_state->__pyx_tuple__225);
  Py_VISIT(traverse_module_state->__pyx_tuple__228);
  Py_VISIT(traverse_module_state->__pyx_tuple__229);
  Py_VISIT(traverse_module_state->__pyx_tuple__230);
  Py_VISIT(traverse_module_state->__pyx_tuple__231);
  Py_VISIT(traverse_module_state->__pyx_tuple__232);
  Py_VISIT(traverse_module_state->__pyx_tuple__233);
  Py_VISIT(traverse_module_state->__pyx_tuple__234);
  Py_VISIT(traverse_module_state->__pyx_tuple__235);
  Py_VISIT(traverse_module_state->__pyx_tuple__237);
  Py_VISIT(traverse_module_state->__pyx_tuple__238);
  Py_VISIT(traverse_module_state->__pyx_tuple__242);
  Py_VISIT(traverse_module_state->__pyx_tuple__243);
  Py_VISIT(traverse_module_state->__pyx_tuple__244);
  Py_VISIT(traverse_module_state->__pyx_tuple__245);
  Py_VISIT(traverse_module_state->__pyx_tuple__246);
  Py_VISIT(traverse_module_state->__pyx_codeobj__56);
  Py_VISIT(traverse_module_state->__pyx_codeobj__57);
  Py_VISIT(traverse_module_state->__pyx_codeobj__58);
  Py_VISIT(traverse_module_state->__pyx_codeobj__59);
  Py_VISIT(traverse_module_state->__pyx_codeobj__60);
  Py_VISIT(traverse_module_state->__pyx_codeobj__62);
  Py_VISIT(traverse_module_state->__pyx_codeobj__63);
  Py_VISIT(traverse_module_state->__pyx_codeobj__64);
  Py_VISIT(traverse_module_state->__pyx_codeobj__66);
  Py_VISIT(traverse_module_state->__pyx_codeobj__71);
  Py_VISIT(traverse_module_state->__pyx_codeobj__72);
  Py_VISIT(traverse_module_state->__pyx_codeobj__73);
  Py_VISIT(traverse_module_state->__pyx_codeobj__74);
  Py_VISIT(traverse_module_state->__pyx_codeobj__78);
  Py_VISIT(traverse_module_state->__pyx_codeobj__86);
  Py_VISIT(traverse_module_state->__pyx_codeobj__88);
  Py_VISIT(traverse_module_state->__pyx_codeobj__89);
  Py_VISIT(traverse_module_state->__pyx_codeobj__90);
  Py_VISIT(traverse_module_state->__pyx_codeobj__91);
  Py_VISIT(traverse_module_state->__pyx_codeobj__97);
  Py_VISIT(traverse_module_state->__pyx_codeobj__99);
  Py_VISIT(traverse_module_state->__pyx_codeobj__101);
  Py_VISIT(traverse_module_state->__pyx_codeobj__104);
  Py_VISIT(traverse_module_state->__pyx_codeobj__105);
  Py_VISIT(traverse_module_state->__pyx_codeobj__106);
  Py_VISIT(traverse_module_state->__pyx_codeobj__107);
  Py_VISIT(traverse_module_state->__pyx_codeobj__108);
  Py_VISIT(traverse_module_state->__pyx_codeobj__110);
  Py_VISIT(traverse_module_state->__pyx_codeobj__120);
  Py_VISIT(traverse_module_state->__pyx_codeobj__121);
  Py_VISIT(traverse_module_state->__pyx_codeobj__122);
  Py_VISIT(traverse_module_state->__pyx_codeobj__123);
  Py_VISIT(traverse_module_state->__pyx_codeobj__159);
  Py_VISIT(traverse_module_state->__pyx_codeobj__160);
  Py_VISIT(traverse_module_state->__pyx_codeobj__161);
  Py_VISIT(traverse_module_state->__pyx_codeobj__162);
  Py_VISIT(traverse_module_state->__pyx_codeobj__163);
  Py_VISIT(traverse_module_state->__pyx_codeobj__164);
  Py_VISIT(traverse_module_state->__pyx_codeobj__165);
  Py_VISIT(traverse_module_state->__pyx_codeobj__166);
  Py_VISIT(traverse_module_state->__pyx_codeobj__167);
  Py_VISIT(traverse_module_state->__pyx_codeobj__168);
  Py_VISIT(traverse_module_state->__pyx_codeobj__169);
  Py_VISIT(traverse_module_state->__pyx_codeobj__170);
  Py_VISIT(traverse_module_state->__pyx_codeobj__171);
  Py_VISIT(traverse_module_state->__pyx_codeobj__172);
  Py_VISIT(traverse_module_state->__pyx_codeobj__173);
  Py_VISIT(traverse_module_state->__pyx_codeobj__174);
  Py_VISIT(traverse_module_state->__pyx_codeobj__175);
  Py_VISIT(traverse_module_state->__pyx_codeobj__176);
  Py_VISIT(traverse_module_state->__pyx_codeobj__177);
  Py_VISIT(traverse_module_state->__pyx_codeobj__178);
  Py_VISIT(traverse_module_state->__pyx_codeobj__179);
  Py_VISIT(traverse_module_state->__pyx_codeobj__180);
  Py_VISIT(traverse_module_state->__pyx_codeobj__182);
  Py_VISIT(traverse_module_state->__pyx_codeobj__183);
  Py_VISIT(traverse_module_state->__pyx_codeobj__184);
  Py_VISIT(traverse_module_state->__pyx_codeobj__186);
  Py_VISIT(traverse_module_state->__pyx_codeobj__187);
  Py_VISIT(traverse_module_state->__pyx_codeobj__188);
  Py_VISIT(traverse_module_state->__pyx_codeobj__190);
  Py_VISIT(traverse_module_state->__pyx_codeobj__192);
  Py_VISIT(traverse_module_state->__pyx_codeobj__194);
  Py_VISIT(traverse_module_state->__pyx_codeobj__195);
  Py_VISIT(traverse_module_state->__pyx_codeobj__196);
  Py_VISIT(traverse_module_state->__pyx_codeobj__197);
  Py_VISIT(traverse_module_state->__pyx_codeobj__198);
  Py_VISIT(traverse_module_state->__pyx_codeobj__199);
  Py_VISIT(traverse_module_state->__pyx_codeobj__200);
  Py_VISIT(traverse_module_state->__pyx_codeobj__201);
  Py_VISIT(traverse_module_state->__pyx_codeobj__202);
  Py_VISIT(traverse_module_state->__pyx_codeobj__203);
  Py_VISIT(traverse_module_state->__pyx_codeobj__204);
  Py_VISIT(traverse_module_state->__pyx_codeobj__205);
  Py_VISIT(traverse_module_state->__pyx_codeobj__206);
  Py_VISIT(traverse_module_state->__pyx_codeobj__207);
  Py_VISIT(traverse_module_state->__pyx_codeobj__208);
  Py_VISIT(traverse_module_state->__pyx_codeobj__209);
  Py_VISIT(traverse_module_state->__pyx_codeobj__210);
  Py_VISIT(traverse_module_state->__pyx_codeobj__211);
  Py_VISIT(traverse_module_state->__pyx_codeobj__212);
  Py_VISIT(traverse_module_state->__pyx_codeobj__213);
  Py_VISIT(traverse_module_state->__pyx_codeobj__214);
  Py_VISIT(traverse_module_state->__pyx_codeobj__215);
  Py_VISIT(traverse_module_state->__pyx_codeobj__216);
  Py_VISIT(traverse_module_state->__pyx_codeobj__218);
  Py_VISIT(traverse_module_state->__pyx_codeobj__219);
  Py_VISIT(traverse_module_state->__pyx_codeobj__220);
  Py_VISIT(traverse_module_state->__pyx_codeobj__221);
  Py_VISIT(traverse_module_state->__pyx_codeobj__222);
  Py_VISIT(traverse_module_state->__pyx_codeobj__223);
  Py_VISIT(traverse_module_state->__pyx_codeobj__224);
  Py_VISIT(traverse_module_state->__pyx_codeobj__226);
  Py_VISIT(traverse_module_state->__pyx_codeobj__227);
  Py_VISIT(traverse_module_state->__pyx_codeobj__236);
  Py_VISIT(traverse_module_state->__pyx_codeobj__239);
  Py_VISIT(traverse_module_state->__pyx_codeobj__240);
  Py_VISIT(traverse_module_state->__pyx_codeobj__247);
  Py_VISIT(traverse_module_state->__pyx_codeobj__248);
  Py_VISIT(traverse_module_state->__pyx_codeobj__249);
  Py_VISIT(traverse_module_state->__pyx_codeobj__250);
  Py_VISIT(traverse_module_state->__pyx_codeobj__251);
  Py_VISIT(traverse_module_state->__pyx_codeobj__252);
  Py_VISIT(traverse_module_state->__pyx_codeobj__253);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#ifdef __Pyx_Generator_USED
#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
#endif
#ifdef __Pyx_IterableCoroutine_USED
#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
#endif
#ifdef __Pyx_Coroutine_USED
#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_7cpython_8datetime_date __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_date
#define __pyx_ptype_7cpython_8datetime_time __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_time
#define __pyx_ptype_7cpython_8datetime_datetime __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_datetime
#define __pyx_ptype_7cpython_8datetime_timedelta __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_timedelta
#define __pyx_ptype_7cpython_8datetime_tzinfo __pyx_mstate_global->__pyx_ptype_7cpython_8datetime_tzinfo
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer __pyx_mstate_global->__pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer
#define __pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer __pyx_mstate_global->__pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer
#define __pyx_ptype_3gel_7pgproto_7pgproto_CodecContext __pyx_mstate_global->__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#define __pyx_ptype_3gel_9datatypes_9datatypes_RelativeDuration __pyx_mstate_global->__pyx_ptype_3gel_9datatypes_9datatypes_RelativeDuration
#define __pyx_ptype_3gel_9datatypes_9datatypes_DateDuration __pyx_mstate_global->__pyx_ptype_3gel_9datatypes_9datatypes_DateDuration
#define __pyx_ptype_3gel_9datatypes_9datatypes_ConfigMemory __pyx_mstate_global->__pyx_ptype_3gel_9datatypes_9datatypes_ConfigMemory
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#endif
#if CYTHON_USE_MODULE_STATE
#define __pyx_type_3gel_8protocol_8protocol_LRUMapping __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_LRUMapping
#define __pyx_type_3gel_8protocol_8protocol_BaseCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_BaseCodec
#define __pyx_type_3gel_8protocol_8protocol_CodecPythonOverride __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_CodecPythonOverride
#define __pyx_type_3gel_8protocol_8protocol_BaseRecordCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_BaseRecordCodec
#define __pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec
#define __pyx_type_3gel_8protocol_8protocol_NullCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_NullCodec
#define __pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec
#define __pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext
#define __pyx_type_3gel_8protocol_8protocol_ScalarCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_ScalarCodec
#define __pyx_type_3gel_8protocol_8protocol_TupleCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_TupleCodec
#define __pyx_type_3gel_8protocol_8protocol_NamedTupleCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_NamedTupleCodec
#define __pyx_type_3gel_8protocol_8protocol_ObjectCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_ObjectCodec
#define __pyx_type_3gel_8protocol_8protocol_BaseArrayCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_BaseArrayCodec
#define __pyx_type_3gel_8protocol_8protocol_ArrayCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_ArrayCodec
#define __pyx_type_3gel_8protocol_8protocol_RangeCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_RangeCodec
#define __pyx_type_3gel_8protocol_8protocol_MultiRangeCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_MultiRangeCodec
#define __pyx_type_3gel_8protocol_8protocol_SetCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_SetCodec
#define __pyx_type_3gel_8protocol_8protocol_EnumCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_EnumCodec
#define __pyx_type_3gel_8protocol_8protocol_RecordCodec __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_RecordCodec
#define __pyx_type_3gel_8protocol_8protocol_CodecsRegistry __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_CodecsRegistry
#define __pyx_type_3gel_8protocol_8protocol_ExecuteContext __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_ExecuteContext
#define __pyx_type_3gel_8protocol_8protocol_SansIOProtocol __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_SansIOProtocol
#define __pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous
#define __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query __pyx_mstate_global->__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query
#define __Pyx_EnumMeta __pyx_mstate_global->__Pyx_EnumMeta
#define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
#define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
#define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
#define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
#endif
#define __pyx_ptype_3gel_8protocol_8protocol_LRUMapping __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_LRUMapping
#define __pyx_ptype_3gel_8protocol_8protocol_BaseCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_BaseCodec
#define __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride
#define __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec
#define __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec
#define __pyx_ptype_3gel_8protocol_8protocol_NullCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_NullCodec
#define __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec
#define __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext
#define __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec
#define __pyx_ptype_3gel_8protocol_8protocol_TupleCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_TupleCodec
#define __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec
#define __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec
#define __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec
#define __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec
#define __pyx_ptype_3gel_8protocol_8protocol_RangeCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_RangeCodec
#define __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec
#define __pyx_ptype_3gel_8protocol_8protocol_SetCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_SetCodec
#define __pyx_ptype_3gel_8protocol_8protocol_EnumCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_EnumCodec
#define __pyx_ptype_3gel_8protocol_8protocol_RecordCodec __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_RecordCodec
#define __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry
#define __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext
#define __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol
#define __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous
#define __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query __pyx_mstate_global->__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query
#define __pyx_ptype___Pyx_EnumMeta __pyx_mstate_global->__pyx_ptype___Pyx_EnumMeta
#define __pyx_array_type __pyx_mstate_global->__pyx_array_type
#define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
#define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
#define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
#define __pyx_kp_b_ __pyx_mstate_global->__pyx_kp_b_
#define __pyx_kp_s_ __pyx_mstate_global->__pyx_kp_s_
#define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
#define __pyx_kp_u_0000 __pyx_mstate_global->__pyx_kp_u_0000
#define __pyx_kp_u_00000000_0000_0000_0000_00000000 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_10 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_10
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_11 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_11
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_12 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_12
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_13 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_13
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_14 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_14
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_15 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_15
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_16 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_16
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_17 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_17
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_18 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_18
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_19 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_19
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_2 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_2
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_20 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_20
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_21 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_21
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_22 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_22
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_23 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_23
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_24 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_24
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_25 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_25
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_3 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_3
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_4 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_4
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_5 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_5
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_6 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_6
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_7 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_7
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_8 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_8
#define __pyx_kp_u_00000000_0000_0000_0000_00000000_9 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000000_9
#define __pyx_kp_u_00000000_0000_0000_0000_00000100 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000100
#define __pyx_kp_u_00000000_0000_0000_0000_00000100_2 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000100_2
#define __pyx_kp_u_00000000_0000_0000_0000_00000100_3 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000100_3
#define __pyx_kp_u_00000000_0000_0000_0000_00000100_4 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000100_4
#define __pyx_kp_u_00000000_0000_0000_0000_00000100_5 __pyx_mstate_global->__pyx_kp_u_00000000_0000_0000_0000_00000100_5
#define __pyx_kp_u_003e434d_cac2_430a_b238_fb39d734 __pyx_mstate_global->__pyx_kp_u_003e434d_cac2_430a_b238_fb39d734
#define __pyx_kp_u_44c901c0_d922_4894_83c8_061bd05e __pyx_mstate_global->__pyx_kp_u_44c901c0_d922_4894_83c8_061bd05e
#define __pyx_kp_u_4ba84534_188e_43b4_a7ce_cea2af0f __pyx_mstate_global->__pyx_kp_u_4ba84534_188e_43b4_a7ce_cea2af0f
#define __pyx_kp_u_4d738878_3a5f_4821_ab76_9d8e7d6b __pyx_mstate_global->__pyx_kp_u_4d738878_3a5f_4821_ab76_9d8e7d6b
#define __pyx_kp_u_7fae5536_6311_4f60_8eb9_096a5d97 __pyx_mstate_global->__pyx_kp_u_7fae5536_6311_4f60_8eb9_096a5d97
#define __pyx_kp_u_9565dd88_04f5_11ee_a691_0b6ebe17 __pyx_mstate_global->__pyx_kp_u_9565dd88_04f5_11ee_a691_0b6ebe17
#define __pyx_n_s_ALL __pyx_mstate_global->__pyx_n_s_ALL
#define __pyx_n_s_ALL_CAPABILITIES __pyx_mstate_global->__pyx_n_s_ALL_CAPABILITIES
#define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
#define __pyx_n_s_AT_LEAST_ONE __pyx_mstate_global->__pyx_n_s_AT_LEAST_ONE
#define __pyx_n_s_AT_MOST_ONE __pyx_mstate_global->__pyx_n_s_AT_MOST_ONE
#define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
#define __pyx_n_u_Array __pyx_mstate_global->__pyx_n_u_Array
#define __pyx_n_s_ArrayCodec __pyx_mstate_global->__pyx_n_s_ArrayCodec
#define __pyx_n_s_ArrayCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_ArrayCodec___reduce_cython
#define __pyx_n_s_ArrayCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_ArrayCodec___setstate_cython
#define __pyx_n_s_ArrayCodec_make_type __pyx_mstate_global->__pyx_n_s_ArrayCodec_make_type
#define __pyx_n_s_ArrayType __pyx_mstate_global->__pyx_n_s_ArrayType
#define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
#define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError
#define __pyx_n_s_BINARY __pyx_mstate_global->__pyx_n_s_BINARY
#define __pyx_n_s_BaseArrayCodec __pyx_mstate_global->__pyx_n_s_BaseArrayCodec
#define __pyx_n_s_BaseArrayCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_BaseArrayCodec___reduce_cython
#define __pyx_n_s_BaseArrayCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_BaseArrayCodec___setstate_cython
#define __pyx_n_s_BaseCodec __pyx_mstate_global->__pyx_n_s_BaseCodec
#define __pyx_n_s_BaseCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_BaseCodec___reduce_cython
#define __pyx_n_s_BaseCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_BaseCodec___setstate_cython
#define __pyx_n_s_BaseCodec_make_type __pyx_mstate_global->__pyx_n_s_BaseCodec_make_type
#define __pyx_n_s_BaseNamedRecordCodec __pyx_mstate_global->__pyx_n_s_BaseNamedRecordCodec
#define __pyx_n_s_BaseNamedRecordCodec___reduce_cy __pyx_mstate_global->__pyx_n_s_BaseNamedRecordCodec___reduce_cy
#define __pyx_n_s_BaseNamedRecordCodec___setstate __pyx_mstate_global->__pyx_n_s_BaseNamedRecordCodec___setstate
#define __pyx_n_s_BaseRecordCodec __pyx_mstate_global->__pyx_n_s_BaseRecordCodec
#define __pyx_n_s_BaseRecordCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_BaseRecordCodec___reduce_cython
#define __pyx_n_s_BaseRecordCodec___setstate_cytho __pyx_mstate_global->__pyx_n_s_BaseRecordCodec___setstate_cytho
#define __pyx_n_s_BaseScalarType __pyx_mstate_global->__pyx_n_s_BaseScalarType
#define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
#define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
#define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
#define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
#define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
#define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
#define __pyx_n_s_Capability __pyx_mstate_global->__pyx_n_s_Capability
#define __pyx_n_s_Cardinality __pyx_mstate_global->__pyx_n_s_Cardinality
#define __pyx_n_s_ClientConnectionClosedError __pyx_mstate_global->__pyx_n_s_ClientConnectionClosedError
#define __pyx_n_s_ClientConnectionError __pyx_mstate_global->__pyx_n_s_ClientConnectionError
#define __pyx_n_s_ClientError __pyx_mstate_global->__pyx_n_s_ClientError
#define __pyx_n_s_CodecPythonOverride __pyx_mstate_global->__pyx_n_s_CodecPythonOverride
#define __pyx_n_s_CodecPythonOverride___reduce_cyt __pyx_mstate_global->__pyx_n_s_CodecPythonOverride___reduce_cyt
#define __pyx_n_s_CodecPythonOverride___setstate_c __pyx_mstate_global->__pyx_n_s_CodecPythonOverride___setstate_c
#define __pyx_n_s_CodecPythonOverride_make_type __pyx_mstate_global->__pyx_n_s_CodecPythonOverride_make_type
#define __pyx_n_s_CodecsRegistry __pyx_mstate_global->__pyx_n_s_CodecsRegistry
#define __pyx_n_s_CodecsRegistry___reduce_cython __pyx_mstate_global->__pyx_n_s_CodecsRegistry___reduce_cython
#define __pyx_n_s_CodecsRegistry___setstate_cython __pyx_mstate_global->__pyx_n_s_CodecsRegistry___setstate_cython
#define __pyx_n_s_CodecsRegistry_clear_cache __pyx_mstate_global->__pyx_n_s_CodecsRegistry_clear_cache
#define __pyx_n_s_CodecsRegistry_set_type_codec __pyx_mstate_global->__pyx_n_s_CodecsRegistry_set_type_codec
#define __pyx_n_s_CompilationFlag __pyx_mstate_global->__pyx_n_s_CompilationFlag
#define __pyx_n_s_Decimal __pyx_mstate_global->__pyx_n_s_Decimal
#define __pyx_n_u_DerivedEnumValue __pyx_mstate_global->__pyx_n_u_DerivedEnumValue
#define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
#define __pyx_n_s_EDGEQL __pyx_mstate_global->__pyx_n_s_EDGEQL
#define __pyx_n_s_EDGE_POINTER_IS_LINKPROP __pyx_mstate_global->__pyx_n_s_EDGE_POINTER_IS_LINKPROP
#define __pyx_n_s_EMPTY_NULL_DATA __pyx_mstate_global->__pyx_n_s_EMPTY_NULL_DATA
#define __pyx_n_s_EMPTY_RECORD_DATA __pyx_mstate_global->__pyx_n_s_EMPTY_RECORD_DATA
#define __pyx_n_s_EdegDBCodecContext __pyx_mstate_global->__pyx_n_s_EdegDBCodecContext
#define __pyx_n_s_EdegDBCodecContext___reduce_cyth __pyx_mstate_global->__pyx_n_s_EdegDBCodecContext___reduce_cyth
#define __pyx_n_s_EdegDBCodecContext___setstate_cy __pyx_mstate_global->__pyx_n_s_EdegDBCodecContext___setstate_cy
#define __pyx_n_s_EdegDBCodecContext_get_text_code __pyx_mstate_global->__pyx_n_s_EdegDBCodecContext_get_text_code
#define __pyx_n_s_EdgeDBError __pyx_mstate_global->__pyx_n_s_EdgeDBError
#define __pyx_n_s_EdgeDBMessage __pyx_mstate_global->__pyx_n_s_EdgeDBMessage
#define __pyx_n_s_Element __pyx_mstate_global->__pyx_n_s_Element
#define __pyx_n_s_ElementKind __pyx_mstate_global->__pyx_n_s_ElementKind
#define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
#define __pyx_n_s_EmptyTupleCodec __pyx_mstate_global->__pyx_n_s_EmptyTupleCodec
#define __pyx_n_s_EmptyTupleCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_EmptyTupleCodec___reduce_cython
#define __pyx_n_s_EmptyTupleCodec___setstate_cytho __pyx_mstate_global->__pyx_n_s_EmptyTupleCodec___setstate_cytho
#define __pyx_n_s_EmptyTupleCodec_make_type __pyx_mstate_global->__pyx_n_s_EmptyTupleCodec_make_type
#define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
#define __pyx_n_u_Enum __pyx_mstate_global->__pyx_n_u_Enum
#define __pyx_n_s_EnumBase __pyx_mstate_global->__pyx_n_s_EnumBase
#define __pyx_n_s_EnumCodec __pyx_mstate_global->__pyx_n_s_EnumCodec
#define __pyx_n_s_EnumCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_EnumCodec___reduce_cython
#define __pyx_n_s_EnumCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_EnumCodec___setstate_cython
#define __pyx_n_s_EnumCodec_make_type __pyx_mstate_global->__pyx_n_s_EnumCodec_make_type
#define __pyx_n_s_EnumMeta __pyx_mstate_global->__pyx_n_s_EnumMeta
#define __pyx_n_s_EnumType __pyx_mstate_global->__pyx_n_s_EnumType
#define __pyx_n_s_EnumValue __pyx_mstate_global->__pyx_n_s_EnumValue
#define __pyx_n_s_ExecuteContext __pyx_mstate_global->__pyx_n_s_ExecuteContext
#define __pyx_n_s_ExecuteContext___reduce_cython __pyx_mstate_global->__pyx_n_s_ExecuteContext___reduce_cython
#define __pyx_n_s_ExecuteContext___setstate_cython __pyx_mstate_global->__pyx_n_s_ExecuteContext___setstate_cython
#define __pyx_n_s_FIELD __pyx_mstate_global->__pyx_n_s_FIELD
#define __pyx_n_u_H __pyx_mstate_global->__pyx_n_u_H
#define __pyx_n_s_INJECT_OUTPUT_OBJECT_IDS __pyx_mstate_global->__pyx_n_s_INJECT_OUTPUT_OBJECT_IDS
#define __pyx_n_s_INJECT_OUTPUT_TYPE_IDS __pyx_mstate_global->__pyx_n_s_INJECT_OUTPUT_TYPE_IDS
#define __pyx_n_s_INJECT_OUTPUT_TYPE_NAMES __pyx_mstate_global->__pyx_n_s_INJECT_OUTPUT_TYPE_NAMES
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_4 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_4
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_5 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_5
#define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0_6 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_6
#define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
#define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
#define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
#define __pyx_n_s_InputLanguage __pyx_mstate_global->__pyx_n_s_InputLanguage
#define __pyx_n_s_IntEnum __pyx_mstate_global->__pyx_n_s_IntEnum
#define __pyx_n_s_IntFlag __pyx_mstate_global->__pyx_n_s_IntFlag
#define __pyx_n_s_InterfaceError __pyx_mstate_global->__pyx_n_s_InterfaceError
#define __pyx_n_s_InvalidArgumentError __pyx_mstate_global->__pyx_n_s_InvalidArgumentError
#define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
#define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
#define __pyx_n_s_Iterable __pyx_mstate_global->__pyx_n_s_Iterable
#define __pyx_n_s_IterableABC __pyx_mstate_global->__pyx_n_s_IterableABC
#define __pyx_n_s_JSON __pyx_mstate_global->__pyx_n_s_JSON
#define __pyx_n_s_JSON_ELEMENTS __pyx_mstate_global->__pyx_n_s_JSON_ELEMENTS
#define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError
#define __pyx_n_s_LINK __pyx_mstate_global->__pyx_n_s_LINK
#define __pyx_n_s_LINK_PROPERTY __pyx_mstate_global->__pyx_n_s_LINK_PROPERTY
#define __pyx_n_s_LRUMapping __pyx_mstate_global->__pyx_n_s_LRUMapping
#define __pyx_n_s_LRUMapping___reduce_cython __pyx_mstate_global->__pyx_n_s_LRUMapping___reduce_cython
#define __pyx_n_s_LRUMapping___setstate_cython __pyx_mstate_global->__pyx_n_s_LRUMapping___setstate_cython
#define __pyx_n_s_LRUMapping_clear __pyx_mstate_global->__pyx_n_s_LRUMapping_clear
#define __pyx_n_s_LookupError __pyx_mstate_global->__pyx_n_s_LookupError
#define __pyx_n_s_MANY __pyx_mstate_global->__pyx_n_s_MANY
#define __pyx_n_s_Mapping __pyx_mstate_global->__pyx_n_s_Mapping
#define __pyx_n_s_MappingABC __pyx_mstate_global->__pyx_n_s_MappingABC
#define __pyx_n_s_MappingProxyType __pyx_mstate_global->__pyx_n_s_MappingProxyType
#define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
#define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
#define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
#define __pyx_n_s_MultiRange __pyx_mstate_global->__pyx_n_s_MultiRange
#define __pyx_n_u_MultiRange __pyx_mstate_global->__pyx_n_u_MultiRange
#define __pyx_n_s_MultiRangeCodec __pyx_mstate_global->__pyx_n_s_MultiRangeCodec
#define __pyx_n_s_MultiRangeCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_MultiRangeCodec___reduce_cython
#define __pyx_n_s_MultiRangeCodec___setstate_cytho __pyx_mstate_global->__pyx_n_s_MultiRangeCodec___setstate_cytho
#define __pyx_n_s_MultiRangeCodec_make_type __pyx_mstate_global->__pyx_n_s_MultiRangeCodec_make_type
#define __pyx_n_s_MultiRangeType __pyx_mstate_global->__pyx_n_s_MultiRangeType
#define __pyx_n_s_NONE __pyx_mstate_global->__pyx_n_s_NONE
#define __pyx_n_s_NO_RESULT __pyx_mstate_global->__pyx_n_s_NO_RESULT
#define __pyx_n_u_NamedTuple __pyx_mstate_global->__pyx_n_u_NamedTuple
#define __pyx_n_s_NamedTupleCodec __pyx_mstate_global->__pyx_n_s_NamedTupleCodec
#define __pyx_n_s_NamedTupleCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_NamedTupleCodec___reduce_cython
#define __pyx_n_s_NamedTupleCodec___setstate_cytho __pyx_mstate_global->__pyx_n_s_NamedTupleCodec___setstate_cytho
#define __pyx_n_s_NamedTupleCodec_make_type __pyx_mstate_global->__pyx_n_s_NamedTupleCodec_make_type
#define __pyx_n_s_NamedTupleType __pyx_mstate_global->__pyx_n_s_NamedTupleType
#define __pyx_n_s_NoDataError __pyx_mstate_global->__pyx_n_s_NoDataError
#define __pyx_kp_u_None __pyx_mstate_global->__pyx_kp_u_None
#define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError
#define __pyx_n_s_NullCodec __pyx_mstate_global->__pyx_n_s_NullCodec
#define __pyx_n_s_NullCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_NullCodec___reduce_cython
#define __pyx_n_s_NullCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_NullCodec___setstate_cython
#define __pyx_n_s_NullCodec_make_type __pyx_mstate_global->__pyx_n_s_NullCodec_make_type
#define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
#define __pyx_n_s_ONE __pyx_mstate_global->__pyx_n_s_ONE
#define __pyx_n_u_Object __pyx_mstate_global->__pyx_n_u_Object
#define __pyx_n_s_ObjectCodec __pyx_mstate_global->__pyx_n_s_ObjectCodec
#define __pyx_n_s_ObjectCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_ObjectCodec___reduce_cython
#define __pyx_n_s_ObjectCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_ObjectCodec___setstate_cython
#define __pyx_n_s_ObjectCodec__make_missing_args_e __pyx_mstate_global->__pyx_n_s_ObjectCodec__make_missing_args_e
#define __pyx_n_s_ObjectCodec_get_dataclass_fields __pyx_mstate_global->__pyx_n_s_ObjectCodec_get_dataclass_fields
#define __pyx_n_s_ObjectCodec_make_type __pyx_mstate_global->__pyx_n_s_ObjectCodec_make_type
#define __pyx_n_s_ObjectType __pyx_mstate_global->__pyx_n_s_ObjectType
#define __pyx_n_s_OrderedDict __pyx_mstate_global->__pyx_n_s_OrderedDict
#define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
#define __pyx_n_s_OutputFormat __pyx_mstate_global->__pyx_n_s_OutputFormat
#define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError
#define __pyx_n_s_PROPERTY __pyx_mstate_global->__pyx_n_s_PROPERTY
#define __pyx_n_s_ParameterTypeMismatchError __pyx_mstate_global->__pyx_n_s_ParameterTypeMismatchError
#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
#define __pyx_n_s_ProtocolError __pyx_mstate_global->__pyx_n_s_ProtocolError
#define __pyx_kp_u_Python_override __pyx_mstate_global->__pyx_kp_u_Python_override
#define __pyx_n_s_Pyx_EnumBase __pyx_mstate_global->__pyx_n_s_Pyx_EnumBase
#define __pyx_n_s_Pyx_EnumBase___new __pyx_mstate_global->__pyx_n_s_Pyx_EnumBase___new
#define __pyx_n_s_Pyx_EnumBase___repr __pyx_mstate_global->__pyx_n_s_Pyx_EnumBase___repr
#define __pyx_n_s_Pyx_EnumBase___str __pyx_mstate_global->__pyx_n_s_Pyx_EnumBase___str
#define __pyx_n_s_Pyx_EnumMeta___reduce_cython __pyx_mstate_global->__pyx_n_s_Pyx_EnumMeta___reduce_cython
#define __pyx_n_s_Pyx_EnumMeta___setstate_cython __pyx_mstate_global->__pyx_n_s_Pyx_EnumMeta___setstate_cython
#define __pyx_n_s_Pyx_FlagBase __pyx_mstate_global->__pyx_n_s_Pyx_FlagBase
#define __pyx_n_s_Pyx_FlagBase___new __pyx_mstate_global->__pyx_n_s_Pyx_FlagBase___new
#define __pyx_n_s_Pyx_FlagBase___repr __pyx_mstate_global->__pyx_n_s_Pyx_FlagBase___repr
#define __pyx_n_s_Pyx_FlagBase___str __pyx_mstate_global->__pyx_n_s_Pyx_FlagBase___str
#define __pyx_n_s_QUERY_SINGLE_METHOD __pyx_mstate_global->__pyx_n_s_QUERY_SINGLE_METHOD
#define __pyx_n_s_QueryArgumentError __pyx_mstate_global->__pyx_n_s_QueryArgumentError
#define __pyx_n_s_Range __pyx_mstate_global->__pyx_n_s_Range
#define __pyx_n_u_Range __pyx_mstate_global->__pyx_n_u_Range
#define __pyx_n_s_RangeCodec __pyx_mstate_global->__pyx_n_s_RangeCodec
#define __pyx_n_s_RangeCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_RangeCodec___reduce_cython
#define __pyx_n_s_RangeCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_RangeCodec___setstate_cython
#define __pyx_n_s_RangeCodec_make_type __pyx_mstate_global->__pyx_n_s_RangeCodec_make_type
#define __pyx_n_s_RangeType __pyx_mstate_global->__pyx_n_s_RangeType
#define __pyx_n_u_Record __pyx_mstate_global->__pyx_n_u_Record
#define __pyx_n_s_RecordCodec __pyx_mstate_global->__pyx_n_s_RecordCodec
#define __pyx_n_s_RecordCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_RecordCodec___reduce_cython
#define __pyx_n_s_RecordCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_RecordCodec___setstate_cython
#define __pyx_n_s_ResultCardinalityMismatchError __pyx_mstate_global->__pyx_n_s_ResultCardinalityMismatchError
#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError
#define __pyx_kp_b_SCRAM_SHA_256 __pyx_mstate_global->__pyx_kp_b_SCRAM_SHA_256
#define __pyx_n_s_SQL __pyx_mstate_global->__pyx_n_s_SQL
#define __pyx_n_s_SansIOProtocol __pyx_mstate_global->__pyx_n_s_SansIOProtocol
#define __pyx_n_s_SansIOProtocolBackwardsCompatibl __pyx_mstate_global->__pyx_n_s_SansIOProtocolBackwardsCompatibl
#define __pyx_n_s_SansIOProtocolBackwardsCompatibl_2 __pyx_mstate_global->__pyx_n_s_SansIOProtocolBackwardsCompatibl_2
#define __pyx_n_s_SansIOProtocolBackwardsCompatibl_3 __pyx_mstate_global->__pyx_n_s_SansIOProtocolBackwardsCompatibl_3
#define __pyx_n_s_SansIOProtocolBackwardsCompatibl_4 __pyx_mstate_global->__pyx_n_s_SansIOProtocolBackwardsCompatibl_4
#define __pyx_n_s_SansIOProtocolBackwardsCompatibl_5 __pyx_mstate_global->__pyx_n_s_SansIOProtocolBackwardsCompatibl_5
#define __pyx_n_s_SansIOProtocolBackwardsCompatibl_6 __pyx_mstate_global->__pyx_n_s_SansIOProtocolBackwardsCompatibl_6
#define __pyx_n_s_SansIOProtocolBackwardsCompatibl_7 __pyx_mstate_global->__pyx_n_s_SansIOProtocolBackwardsCompatibl_7
#define __pyx_n_s_SansIOProtocolBackwardsCompatibl_8 __pyx_mstate_global->__pyx_n_s_SansIOProtocolBackwardsCompatibl_8
#define __pyx_n_s_SansIOProtocol___reduce_cython __pyx_mstate_global->__pyx_n_s_SansIOProtocol___reduce_cython
#define __pyx_n_s_SansIOProtocol___setstate_cython __pyx_mstate_global->__pyx_n_s_SansIOProtocol___setstate_cython
#define __pyx_n_s_SansIOProtocol__auth_sasl __pyx_mstate_global->__pyx_n_s_SansIOProtocol__auth_sasl
#define __pyx_n_s_SansIOProtocol__execute __pyx_mstate_global->__pyx_n_s_SansIOProtocol__execute
#define __pyx_n_s_SansIOProtocol__parse __pyx_mstate_global->__pyx_n_s_SansIOProtocol__parse
#define __pyx_n_s_SansIOProtocol__sync __pyx_mstate_global->__pyx_n_s_SansIOProtocol__sync
#define __pyx_n_s_SansIOProtocol_abort __pyx_mstate_global->__pyx_n_s_SansIOProtocol_abort
#define __pyx_n_s_SansIOProtocol_connect __pyx_mstate_global->__pyx_n_s_SansIOProtocol_connect
#define __pyx_n_s_SansIOProtocol_dump __pyx_mstate_global->__pyx_n_s_SansIOProtocol_dump
#define __pyx_n_s_SansIOProtocol_execute __pyx_mstate_global->__pyx_n_s_SansIOProtocol_execute
#define __pyx_n_s_SansIOProtocol_get_settings __pyx_mstate_global->__pyx_n_s_SansIOProtocol_get_settings
#define __pyx_n_s_SansIOProtocol_is_in_transaction __pyx_mstate_global->__pyx_n_s_SansIOProtocol_is_in_transaction
#define __pyx_n_s_SansIOProtocol_ping __pyx_mstate_global->__pyx_n_s_SansIOProtocol_ping
#define __pyx_n_s_SansIOProtocol_query __pyx_mstate_global->__pyx_n_s_SansIOProtocol_query
#define __pyx_n_s_SansIOProtocol_restore __pyx_mstate_global->__pyx_n_s_SansIOProtocol_restore
#define __pyx_n_s_SansIOProtocol_set_connection __pyx_mstate_global->__pyx_n_s_SansIOProtocol_set_connection
#define __pyx_n_s_SansIOProtocol_terminate __pyx_mstate_global->__pyx_n_s_SansIOProtocol_terminate
#define __pyx_n_s_SansIOProtocol_try_recv_eagerly __pyx_mstate_global->__pyx_n_s_SansIOProtocol_try_recv_eagerly
#define __pyx_n_s_SansIOProtocol_wait_for_connect __pyx_mstate_global->__pyx_n_s_SansIOProtocol_wait_for_connect
#define __pyx_n_s_SansIOProtocol_wait_for_disconne __pyx_mstate_global->__pyx_n_s_SansIOProtocol_wait_for_disconne
#define __pyx_n_s_SansIOProtocol_wait_for_message __pyx_mstate_global->__pyx_n_s_SansIOProtocol_wait_for_message
#define __pyx_n_s_ScalarCodec __pyx_mstate_global->__pyx_n_s_ScalarCodec
#define __pyx_n_s_ScalarCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_ScalarCodec___reduce_cython
#define __pyx_n_s_ScalarCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_ScalarCodec___setstate_cython
#define __pyx_n_s_ScalarCodec_make_type __pyx_mstate_global->__pyx_n_s_ScalarCodec_make_type
#define __pyx_n_s_ScalarType __pyx_mstate_global->__pyx_n_s_ScalarType
#define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
#define __pyx_n_u_Set __pyx_mstate_global->__pyx_n_u_Set
#define __pyx_n_s_SetCodec __pyx_mstate_global->__pyx_n_s_SetCodec
#define __pyx_n_s_SetCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_SetCodec___reduce_cython
#define __pyx_n_s_SetCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_SetCodec___setstate_cython
#define __pyx_n_s_SetCodec_make_type __pyx_mstate_global->__pyx_n_s_SetCodec_make_type
#define __pyx_n_s_Sized __pyx_mstate_global->__pyx_n_s_Sized
#define __pyx_n_s_SizedABC __pyx_mstate_global->__pyx_n_s_SizedABC
#define __pyx_n_u_SparseObject __pyx_mstate_global->__pyx_n_u_SparseObject
#define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
#define __pyx_n_s_TYPE_IDS __pyx_mstate_global->__pyx_n_s_TYPE_IDS
#define __pyx_kp_u_Time_zones_are_not_available_fro __pyx_mstate_global->__pyx_kp_u_Time_zones_are_not_available_fro
#define __pyx_n_u_Tuple __pyx_mstate_global->__pyx_n_u_Tuple
#define __pyx_n_s_TupleCodec __pyx_mstate_global->__pyx_n_s_TupleCodec
#define __pyx_n_s_TupleCodec___reduce_cython __pyx_mstate_global->__pyx_n_s_TupleCodec___reduce_cython
#define __pyx_n_s_TupleCodec___setstate_cython __pyx_mstate_global->__pyx_n_s_TupleCodec___setstate_cython
#define __pyx_n_s_TupleCodec_make_type __pyx_mstate_global->__pyx_n_s_TupleCodec_make_type
#define __pyx_n_s_TupleType __pyx_mstate_global->__pyx_n_s_TupleType
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_n_s_UUID __pyx_mstate_global->__pyx_n_s_UUID
#define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
#define __pyx_kp_s_Unknown_enum_value_s __pyx_mstate_global->__pyx_kp_s_Unknown_enum_value_s
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
#define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
#define __pyx_kp_u__13 __pyx_mstate_global->__pyx_kp_u__13
#define __pyx_kp_b__154 __pyx_mstate_global->__pyx_kp_b__154
#define __pyx_kp_b__156 __pyx_mstate_global->__pyx_kp_b__156
#define __pyx_kp_b__157 __pyx_mstate_global->__pyx_kp_b__157
#define __pyx_kp_u__17 __pyx_mstate_global->__pyx_kp_u__17
#define __pyx_kp_u__18 __pyx_mstate_global->__pyx_kp_u__18
#define __pyx_kp_u__19 __pyx_mstate_global->__pyx_kp_u__19
#define __pyx_kp_u__20 __pyx_mstate_global->__pyx_kp_u__20
#define __pyx_kp_u__21 __pyx_mstate_global->__pyx_kp_u__21
#define __pyx_n_s__241 __pyx_mstate_global->__pyx_n_s__241
#define __pyx_n_s__254 __pyx_mstate_global->__pyx_n_s__254
#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3
#define __pyx_kp_u__33 __pyx_mstate_global->__pyx_kp_u__33
#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4
#define __pyx_kp_u__48 __pyx_mstate_global->__pyx_kp_u__48
#define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5
#define __pyx_kp_u__65 __pyx_mstate_global->__pyx_kp_u__65
#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8
#define __pyx_kp_u__80 __pyx_mstate_global->__pyx_kp_u__80
#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9
#define __pyx_kp_u_a_datetime_datetime_object_was_e __pyx_mstate_global->__pyx_kp_u_a_datetime_datetime_object_was_e
#define __pyx_kp_u_a_datetime_datetime_object_was_e_2 __pyx_mstate_global->__pyx_kp_u_a_datetime_datetime_object_was_e_2
#define __pyx_kp_u_a_dict_or_Mapping_expected_got_t __pyx_mstate_global->__pyx_kp_u_a_dict_or_Mapping_expected_got_t
#define __pyx_kp_u_a_naive_date_object_tzinfo_is_No __pyx_mstate_global->__pyx_kp_u_a_naive_date_object_tzinfo_is_No
#define __pyx_kp_u_a_naive_datetime_object_tzinfo_i __pyx_mstate_global->__pyx_kp_u_a_naive_datetime_object_tzinfo_i
#define __pyx_kp_u_a_naive_time_object_tzinfo_is_No __pyx_mstate_global->__pyx_kp_u_a_naive_time_object_tzinfo_is_No
#define __pyx_kp_u_a_scalar_codec_expected_for_base __pyx_mstate_global->__pyx_kp_u_a_scalar_codec_expected_for_base
#define __pyx_kp_u_a_sized_iterable_container_expec __pyx_mstate_global->__pyx_kp_u_a_sized_iterable_container_expec
#define __pyx_kp_u_a_sized_iterable_container_expec_2 __pyx_mstate_global->__pyx_kp_u_a_sized_iterable_container_expec_2
#define __pyx_kp_u_a_sized_iterable_container_or_ma __pyx_mstate_global->__pyx_kp_u_a_sized_iterable_container_or_ma
#define __pyx_kp_u_a_str_or_gel_EnumValue___tid __pyx_mstate_global->__pyx_kp_u_a_str_or_gel_EnumValue___tid
#define __pyx_kp_u_a_timezone_aware_datetime_object __pyx_mstate_global->__pyx_kp_u_a_timezone_aware_datetime_object
#define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
#define __pyx_n_s_abort __pyx_mstate_global->__pyx_n_s_abort
#define __pyx_n_u_acceptable __pyx_mstate_global->__pyx_n_u_acceptable
#define __pyx_n_s_aiter __pyx_mstate_global->__pyx_n_s_aiter
#define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
#define __pyx_n_s_allow_capabilities __pyx_mstate_global->__pyx_n_s_allow_capabilities
#define __pyx_kp_u_already_connected __pyx_mstate_global->__pyx_kp_u_already_connected
#define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
#define __pyx_n_s_anext __pyx_mstate_global->__pyx_n_s_anext
#define __pyx_n_s_annotations __pyx_mstate_global->__pyx_n_s_annotations
#define __pyx_n_u_anytuple __pyx_mstate_global->__pyx_n_u_anytuple
#define __pyx_n_u_anytype __pyx_mstate_global->__pyx_n_u_anytype
#define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append
#define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args
#define __pyx_kp_u_argument __pyx_mstate_global->__pyx_kp_u_argument
#define __pyx_kp_u_argument_tuples_do_not_support_o __pyx_mstate_global->__pyx_kp_u_argument_tuples_do_not_support_o
#define __pyx_kp_u_arguments __pyx_mstate_global->__pyx_kp_u_arguments
#define __pyx_n_s_array __pyx_mstate_global->__pyx_n_s_array
#define __pyx_kp_u_as_it_does_not_return_any_data __pyx_mstate_global->__pyx_kp_u_as_it_does_not_return_any_data
#define __pyx_kp_u_as_it_may_return_more_than_one __pyx_mstate_global->__pyx_kp_u_as_it_may_return_more_than_one
#define __pyx_n_s_asyncio __pyx_mstate_global->__pyx_n_s_asyncio
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_n_s_asyncio_tasks __pyx_mstate_global->__pyx_n_s_asyncio_tasks
#define __pyx_kp_u_attribute __pyx_mstate_global->__pyx_kp_u_attribute
#define __pyx_n_s_attrs __pyx_mstate_global->__pyx_n_s_attrs
#define __pyx_n_s_attrs_2 __pyx_mstate_global->__pyx_n_s_attrs_2
#define __pyx_n_s_auth_sasl __pyx_mstate_global->__pyx_n_s_auth_sasl
#define __pyx_n_s_await __pyx_mstate_global->__pyx_n_s_await
#define __pyx_kp_u_bad_bigint_sign_data __pyx_mstate_global->__pyx_kp_u_bad_bigint_sign_data
#define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
#define __pyx_kp_u_base_scalar_codec_for __pyx_mstate_global->__pyx_kp_u_base_scalar_codec_for
#define __pyx_n_s_base_type __pyx_mstate_global->__pyx_n_s_base_type
#define __pyx_n_s_basecodec __pyx_mstate_global->__pyx_n_s_basecodec
#define __pyx_n_u_big __pyx_mstate_global->__pyx_n_u_big
#define __pyx_kp_u_bigint_data_has_fractional_part __pyx_mstate_global->__pyx_kp_u_bigint_data_has_fractional_part
#define __pyx_n_s_bint __pyx_mstate_global->__pyx_n_s_bint
#define __pyx_n_s_block_callback __pyx_mstate_global->__pyx_n_s_block_callback
#define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool
#define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf
#define __pyx_n_s_build_client_final_message __pyx_mstate_global->__pyx_n_s_build_client_final_message
#define __pyx_n_s_build_client_first_message __pyx_mstate_global->__pyx_n_s_build_client_first_message
#define __pyx_n_s_bytes __pyx_mstate_global->__pyx_n_s_bytes
#define __pyx_kp_u_bytes_2 __pyx_mstate_global->__pyx_kp_u_bytes_2
#define __pyx_n_s_bytes_3 __pyx_mstate_global->__pyx_n_s_bytes_3
#define __pyx_n_s_byteswap __pyx_mstate_global->__pyx_n_s_byteswap
#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
#define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
#define __pyx_kp_u_c1a50ff8_fded_48b0_85c2_4905a848 __pyx_mstate_global->__pyx_kp_u_c1a50ff8_fded_48b0_85c2_4905a848
#define __pyx_n_s_cache_size __pyx_mstate_global->__pyx_n_s_cache_size
#define __pyx_kp_u_cal_date_duration __pyx_mstate_global->__pyx_kp_u_cal_date_duration
#define __pyx_kp_u_cal_local_date __pyx_mstate_global->__pyx_kp_u_cal_local_date
#define __pyx_kp_u_cal_local_datetime __pyx_mstate_global->__pyx_kp_u_cal_local_datetime
#define __pyx_kp_u_cal_local_time __pyx_mstate_global->__pyx_kp_u_cal_local_time
#define __pyx_kp_u_cal_relative_duration __pyx_mstate_global->__pyx_kp_u_cal_relative_duration
#define __pyx_kp_u_cannot_decode_NamedTuple_expecte __pyx_mstate_global->__pyx_kp_u_cannot_decode_NamedTuple_expecte
#define __pyx_kp_u_cannot_decode_Object_expected __pyx_mstate_global->__pyx_kp_u_cannot_decode_Object_expected
#define __pyx_kp_u_cannot_decode_Record_expected __pyx_mstate_global->__pyx_kp_u_cannot_decode_Record_expected
#define __pyx_kp_u_cannot_decode_Tuple_expected __pyx_mstate_global->__pyx_kp_u_cannot_decode_Tuple_expected
#define __pyx_kp_u_cannot_decode_empty_Tuple_expect __pyx_mstate_global->__pyx_kp_u_cannot_decode_empty_Tuple_expect
#define __pyx_kp_u_cannot_encode_empty_Tuple_expect __pyx_mstate_global->__pyx_kp_u_cannot_encode_empty_Tuple_expect
#define __pyx_kp_u_cannot_encode_empty_Tuple_expect_2 __pyx_mstate_global->__pyx_kp_u_cannot_encode_empty_Tuple_expect_2
#define __pyx_kp_u_cannot_find_known_ID_for_type __pyx_mstate_global->__pyx_kp_u_cannot_find_known_ID_for_type
#define __pyx_kp_u_cannot_handle_arrays_with_more_t __pyx_mstate_global->__pyx_kp_u_cannot_handle_arrays_with_more_t
#define __pyx_kp_u_cannot_not_build_codec_empty_typ __pyx_mstate_global->__pyx_kp_u_cannot_not_build_codec_empty_typ
#define __pyx_n_s_cap_bytes __pyx_mstate_global->__pyx_n_s_cap_bytes
#define __pyx_n_s_capabilities __pyx_mstate_global->__pyx_n_s_capabilities
#define __pyx_n_s_cardinality __pyx_mstate_global->__pyx_n_s_cardinality
#define __pyx_n_s_cause __pyx_mstate_global->__pyx_n_s_cause
#define __pyx_kp_u_cfg_memory __pyx_mstate_global->__pyx_kp_u_cfg_memory
#define __pyx_n_s_chr __pyx_mstate_global->__pyx_n_s_chr
#define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
#define __pyx_n_s_clear __pyx_mstate_global->__pyx_n_s_clear
#define __pyx_n_s_clear_cache __pyx_mstate_global->__pyx_n_s_clear_cache
#define __pyx_n_s_client_final __pyx_mstate_global->__pyx_n_s_client_final
#define __pyx_n_s_client_first __pyx_mstate_global->__pyx_n_s_client_first
#define __pyx_n_s_client_first_bare __pyx_mstate_global->__pyx_n_s_client_first_bare
#define __pyx_n_s_client_nonce __pyx_mstate_global->__pyx_n_s_client_nonce
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_close __pyx_mstate_global->__pyx_n_s_close
#define __pyx_n_s_cls __pyx_mstate_global->__pyx_n_s_cls
#define __pyx_n_s_code __pyx_mstate_global->__pyx_n_s_code
#define __pyx_n_s_codec __pyx_mstate_global->__pyx_n_s_codec
#define __pyx_n_s_codecs __pyx_mstate_global->__pyx_n_s_codecs
#define __pyx_kp_u_codecs_are_not_supposed_to_be_in __pyx_mstate_global->__pyx_kp_u_codecs_are_not_supposed_to_be_in
#define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
#define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
#define __pyx_n_s_con __pyx_mstate_global->__pyx_n_s_con
#define __pyx_n_s_con_params __pyx_mstate_global->__pyx_n_s_con_params
#define __pyx_n_s_connect __pyx_mstate_global->__pyx_n_s_connect
#define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
#define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
#define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
#define __pyx_n_s_ctx __pyx_mstate_global->__pyx_n_s_ctx
#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
#define __pyx_kp_u_data_block_before_header_block __pyx_mstate_global->__pyx_kp_u_data_block_before_header_block
#define __pyx_n_s_data_gen __pyx_mstate_global->__pyx_n_s_data_gen
#define __pyx_n_s_data_received __pyx_mstate_global->__pyx_n_s_data_received
#define __pyx_n_s_database __pyx_mstate_global->__pyx_n_s_database
#define __pyx_n_u_database __pyx_mstate_global->__pyx_n_u_database
#define __pyx_n_s_dataclasses __pyx_mstate_global->__pyx_n_s_dataclasses
#define __pyx_n_s_datatypes __pyx_mstate_global->__pyx_n_s_datatypes
#define __pyx_kp_u_date_duration_has_non_zero_micro __pyx_mstate_global->__pyx_kp_u_date_duration_has_non_zero_micro
#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime
#define __pyx_n_s_days __pyx_mstate_global->__pyx_n_s_days
#define __pyx_n_s_dct __pyx_mstate_global->__pyx_n_s_dct
#define __pyx_n_s_decimal __pyx_mstate_global->__pyx_n_s_decimal
#define __pyx_n_s_decoder __pyx_mstate_global->__pyx_n_s_decoder
#define __pyx_n_s_desc_id __pyx_mstate_global->__pyx_n_s_desc_id
#define __pyx_n_s_describe __pyx_mstate_global->__pyx_n_s_describe
#define __pyx_n_s_describe_context __pyx_mstate_global->__pyx_n_s_describe_context
#define __pyx_n_s_descriptor __pyx_mstate_global->__pyx_n_s_descriptor
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2
#define __pyx_n_u_dim __pyx_mstate_global->__pyx_n_u_dim
#define __pyx_kp_u_dim_key_is_missing __pyx_mstate_global->__pyx_kp_u_dim_key_is_missing
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
#define __pyx_kp_u_does_not_correspond_to_any_know __pyx_mstate_global->__pyx_kp_u_does_not_correspond_to_any_know
#define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
#define __pyx_n_s_dump __pyx_mstate_global->__pyx_n_s_dump
#define __pyx_kp_u_either_positional_or_named_argum __pyx_mstate_global->__pyx_kp_u_either_positional_or_named_argum
#define __pyx_n_s_element_type __pyx_mstate_global->__pyx_n_s_element_type
#define __pyx_n_s_element_types __pyx_mstate_global->__pyx_n_s_element_types
#define __pyx_n_s_elements __pyx_mstate_global->__pyx_n_s_elements
#define __pyx_kp_u_elements_got __pyx_mstate_global->__pyx_kp_u_elements_got
#define __pyx_kp_u_elements_in_a_sparse_vector_cann __pyx_mstate_global->__pyx_kp_u_elements_in_a_sparse_vector_cann
#define __pyx_kp_u_elements_in_the_tuple_got __pyx_mstate_global->__pyx_kp_u_elements_in_the_tuple_got
#define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty
#define __pyx_kp_u_empty_tuple __pyx_mstate_global->__pyx_kp_u_empty_tuple
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
#define __pyx_n_s_encoder __pyx_mstate_global->__pyx_n_s_encoder
#define __pyx_n_s_enum __pyx_mstate_global->__pyx_n_s_enum
#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
#define __pyx_n_s_enums __pyx_mstate_global->__pyx_n_s_enums
#define __pyx_kp_s_enums_Capability __pyx_mstate_global->__pyx_kp_s_enums_Capability
#define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
#define __pyx_n_s_error_message __pyx_mstate_global->__pyx_n_s_error_message
#define __pyx_n_s_errors __pyx_mstate_global->__pyx_n_s_errors
#define __pyx_n_s_ex __pyx_mstate_global->__pyx_n_s_ex
#define __pyx_n_s_exc __pyx_mstate_global->__pyx_n_s_exc
#define __pyx_n_s_execute __pyx_mstate_global->__pyx_n_s_execute
#define __pyx_n_s_execute_2 __pyx_mstate_global->__pyx_n_s_execute_2
#define __pyx_n_s_expect_one __pyx_mstate_global->__pyx_n_s_expect_one
#define __pyx_kp_u_expected __pyx_mstate_global->__pyx_kp_u_expected
#define __pyx_n_u_expected_2 __pyx_mstate_global->__pyx_n_u_expected_2
#define __pyx_kp_u_expected_3 __pyx_mstate_global->__pyx_kp_u_expected_3
#define __pyx_kp_u_expected_SASLContinue_from_the_s __pyx_mstate_global->__pyx_kp_u_expected_SASLContinue_from_the_s
#define __pyx_kp_u_expected_SASLFinal_from_the_serv __pyx_mstate_global->__pyx_kp_u_expected_SASLFinal_from_the_serv
#define __pyx_kp_u_expected_a_Decimal_or_an_int __pyx_mstate_global->__pyx_kp_u_expected_a_Decimal_or_an_int
#define __pyx_kp_u_expected_a_record_with_a_single __pyx_mstate_global->__pyx_kp_u_expected_a_record_with_a_single
#define __pyx_kp_u_expected_a_two_dimensional_array __pyx_mstate_global->__pyx_kp_u_expected_a_two_dimensional_array
#define __pyx_kp_u_expected_an_int __pyx_mstate_global->__pyx_kp_u_expected_an_int
#define __pyx_kp_u_expected_no_named_arguments __pyx_mstate_global->__pyx_kp_u_expected_no_named_arguments
#define __pyx_kp_u_expected_no_positional_arguments __pyx_mstate_global->__pyx_kp_u_expected_no_positional_arguments
#define __pyx_n_s_expected_server_sig __pyx_mstate_global->__pyx_n_s_expected_server_sig
#define __pyx_kp_u_ext_pgvector_halfvec __pyx_mstate_global->__pyx_kp_u_ext_pgvector_halfvec
#define __pyx_kp_u_ext_pgvector_sparsevec __pyx_mstate_global->__pyx_kp_u_ext_pgvector_sparsevec
#define __pyx_kp_u_ext_pgvector_vector __pyx_mstate_global->__pyx_kp_u_ext_pgvector_vector
#define __pyx_kp_u_ext_postgis_box2d __pyx_mstate_global->__pyx_kp_u_ext_postgis_box2d
#define __pyx_kp_u_ext_postgis_box3d __pyx_mstate_global->__pyx_kp_u_ext_postgis_box3d
#define __pyx_kp_u_ext_postgis_geography __pyx_mstate_global->__pyx_kp_u_ext_postgis_geography
#define __pyx_kp_u_ext_postgis_geometry __pyx_mstate_global->__pyx_kp_u_ext_postgis_geometry
#define __pyx_kp_u_extra __pyx_mstate_global->__pyx_kp_u_extra
#define __pyx_n_s_extra_args __pyx_mstate_global->__pyx_n_s_extra_args
#define __pyx_n_u_f __pyx_mstate_global->__pyx_n_u_f
#define __pyx_n_s_field __pyx_mstate_global->__pyx_n_s_field
#define __pyx_n_s_field_type __pyx_mstate_global->__pyx_n_s_field_type
#define __pyx_n_s_fields __pyx_mstate_global->__pyx_n_s_fields
#define __pyx_n_u_fields __pyx_mstate_global->__pyx_n_u_fields
#define __pyx_kp_u_first_message_is_not_DataMsg __pyx_mstate_global->__pyx_kp_u_first_message_is_not_DataMsg
#define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
#define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
#define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
#define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
#define __pyx_n_s_from_bytes __pyx_mstate_global->__pyx_n_s_from_bytes
#define __pyx_n_s_from_code __pyx_mstate_global->__pyx_n_s_from_code
#define __pyx_n_s_from_json __pyx_mstate_global->__pyx_n_s_from_json
#define __pyx_kp_u_fts_language __pyx_mstate_global->__pyx_kp_u_fts_language
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_gel __pyx_mstate_global->__pyx_n_s_gel
#define __pyx_n_u_gel __pyx_mstate_global->__pyx_n_u_gel
#define __pyx_kp_u_gel_DerivedEnumValue __pyx_mstate_global->__pyx_kp_u_gel_DerivedEnumValue
#define __pyx_n_s_gel_datatypes __pyx_mstate_global->__pyx_n_s_gel_datatypes
#define __pyx_n_s_gel_pgproto __pyx_mstate_global->__pyx_n_s_gel_pgproto
#define __pyx_n_s_gel_pgproto_pgproto __pyx_mstate_global->__pyx_n_s_gel_pgproto_pgproto
#define __pyx_kp_s_gel_protocol_codecs_array_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_array_pyx
#define __pyx_kp_s_gel_protocol_codecs_base_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_base_pyx
#define __pyx_kp_s_gel_protocol_codecs_codecs_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_codecs_pyx
#define __pyx_kp_s_gel_protocol_codecs_enum_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_enum_pyx
#define __pyx_kp_s_gel_protocol_codecs_namedtuple_p __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_namedtuple_p
#define __pyx_kp_s_gel_protocol_codecs_object_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_object_pyx
#define __pyx_kp_s_gel_protocol_codecs_range_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_range_pyx
#define __pyx_kp_s_gel_protocol_codecs_scalar_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_scalar_pyx
#define __pyx_kp_s_gel_protocol_codecs_set_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_set_pyx
#define __pyx_kp_s_gel_protocol_codecs_tuple_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_codecs_tuple_pyx
#define __pyx_kp_s_gel_protocol_lru_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_lru_pyx
#define __pyx_n_s_gel_protocol_protocol __pyx_mstate_global->__pyx_n_s_gel_protocol_protocol
#define __pyx_kp_s_gel_protocol_protocol_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_protocol_pyx
#define __pyx_kp_s_gel_protocol_protocol_v0_pyx __pyx_mstate_global->__pyx_kp_s_gel_protocol_protocol_v0_pyx
#define __pyx_n_s_generate_nonce __pyx_mstate_global->__pyx_n_s_generate_nonce
#define __pyx_n_s_genexpr __pyx_mstate_global->__pyx_n_s_genexpr
#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
#define __pyx_n_s_get_code __pyx_mstate_global->__pyx_n_s_get_code
#define __pyx_n_s_get_dataclass_fields __pyx_mstate_global->__pyx_n_s_get_dataclass_fields
#define __pyx_n_s_get_pos __pyx_mstate_global->__pyx_n_s_get_pos
#define __pyx_n_s_get_settings __pyx_mstate_global->__pyx_n_s_get_settings
#define __pyx_n_s_get_text_codec __pyx_mstate_global->__pyx_n_s_get_text_codec
#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
#define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
#define __pyx_kp_u_got_2 __pyx_mstate_global->__pyx_kp_u_got_2
#define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
#define __pyx_n_s_handshake_buf __pyx_mstate_global->__pyx_n_s_handshake_buf
#define __pyx_n_s_header __pyx_mstate_global->__pyx_n_s_header
#define __pyx_kp_u_header_block_after_data_block __pyx_mstate_global->__pyx_kp_u_header_block_after_data_block
#define __pyx_kp_u_header_block_was_not_received __pyx_mstate_global->__pyx_kp_u_header_block_was_not_received
#define __pyx_n_s_header_callback __pyx_mstate_global->__pyx_n_s_header_callback
#define __pyx_n_s_header_received __pyx_mstate_global->__pyx_n_s_header_received
#define __pyx_n_s_headers __pyx_mstate_global->__pyx_n_s_headers
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
#define __pyx_n_s_implicit_limit __pyx_mstate_global->__pyx_n_s_implicit_limit
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_in_dc __pyx_mstate_global->__pyx_n_s_in_dc
#define __pyx_n_s_in_type_id __pyx_mstate_global->__pyx_n_s_in_type_id
#define __pyx_n_s_inc_lower __pyx_mstate_global->__pyx_n_s_inc_lower
#define __pyx_n_s_inc_upper __pyx_mstate_global->__pyx_n_s_inc_upper
#define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
#define __pyx_n_s_index_2 __pyx_mstate_global->__pyx_n_s_index_2
#define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init
#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
#define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
#define __pyx_n_s_inline_typeids __pyx_mstate_global->__pyx_n_s_inline_typeids
#define __pyx_n_s_inline_typenames __pyx_mstate_global->__pyx_n_s_inline_typenames
#define __pyx_n_s_input_language __pyx_mstate_global->__pyx_n_s_input_language
#define __pyx_n_s_inspect __pyx_mstate_global->__pyx_n_s_inspect
#define __pyx_n_s_int __pyx_mstate_global->__pyx_n_s_int
#define __pyx_kp_u_invalid_array_element __pyx_mstate_global->__pyx_kp_u_invalid_array_element
#define __pyx_kp_u_invalid_array_element_at_index_N __pyx_mstate_global->__pyx_kp_u_invalid_array_element_at_index_N
#define __pyx_kp_u_invalid_array_size_received __pyx_mstate_global->__pyx_kp_u_invalid_array_size_received
#define __pyx_kp_u_invalid_buffer_length __pyx_mstate_global->__pyx_kp_u_invalid_buffer_length
#define __pyx_kp_u_invalid_input_for_query_argument __pyx_mstate_global->__pyx_kp_u_invalid_input_for_query_argument
#define __pyx_kp_u_invalid_input_for_query_argument_2 __pyx_mstate_global->__pyx_kp_u_invalid_input_for_query_argument_2
#define __pyx_kp_u_invalid_input_for_state_argument __pyx_mstate_global->__pyx_kp_u_invalid_input_for_state_argument
#define __pyx_kp_u_invalid_multirange_element __pyx_mstate_global->__pyx_kp_u_invalid_multirange_element
#define __pyx_kp_u_invalid_number_of_columns_expect __pyx_mstate_global->__pyx_kp_u_invalid_number_of_columns_expect
#define __pyx_kp_u_invalid_range_lower_bound __pyx_mstate_global->__pyx_kp_u_invalid_range_lower_bound
#define __pyx_kp_u_invalid_range_upper_bound __pyx_mstate_global->__pyx_kp_u_invalid_range_upper_bound
#define __pyx_kp_u_is_already_registered __pyx_mstate_global->__pyx_kp_u_is_already_registered
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_n_s_is_empty __pyx_mstate_global->__pyx_n_s_is_empty
#define __pyx_kp_u_is_expected_as_a_valid_enum_arg __pyx_mstate_global->__pyx_kp_u_is_expected_as_a_valid_enum_arg
#define __pyx_n_s_is_implicit __pyx_mstate_global->__pyx_n_s_is_implicit
#define __pyx_n_s_is_in_transaction __pyx_mstate_global->__pyx_n_s_is_in_transaction
#define __pyx_kp_u_is_required_but_received_None __pyx_mstate_global->__pyx_kp_u_is_required_but_received_None
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items
#define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
#define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
#define __pyx_n_s_itercount __pyx_mstate_global->__pyx_n_s_itercount
#define __pyx_n_s_json __pyx_mstate_global->__pyx_n_s_json
#define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k
#define __pyx_kp_u_key __pyx_mstate_global->__pyx_kp_u_key
#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys
#define __pyx_n_s_kind __pyx_mstate_global->__pyx_n_s_kind
#define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs
#define __pyx_n_u_l __pyx_mstate_global->__pyx_n_u_l
#define __pyx_n_s_last __pyx_mstate_global->__pyx_n_s_last
#define __pyx_n_s_legacy_execute __pyx_mstate_global->__pyx_n_s_legacy_execute
#define __pyx_n_s_legacy_execute_anonymous __pyx_mstate_global->__pyx_n_s_legacy_execute_anonymous
#define __pyx_n_s_legacy_optimistic_execute __pyx_mstate_global->__pyx_n_s_legacy_optimistic_execute
#define __pyx_n_s_legacy_parse __pyx_mstate_global->__pyx_n_s_legacy_parse
#define __pyx_n_s_legacy_simple_query __pyx_mstate_global->__pyx_n_s_legacy_simple_query
#define __pyx_n_s_loads __pyx_mstate_global->__pyx_n_s_loads
#define __pyx_n_s_lookup __pyx_mstate_global->__pyx_n_s_lookup
#define __pyx_n_s_lower __pyx_mstate_global->__pyx_n_s_lower
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_major __pyx_mstate_global->__pyx_n_s_major
#define __pyx_n_s_make_missing_args_error_message __pyx_mstate_global->__pyx_n_s_make_missing_args_error_message
#define __pyx_n_s_make_type __pyx_mstate_global->__pyx_n_s_make_type
#define __pyx_n_s_make_type_locals_genexpr __pyx_mstate_global->__pyx_n_s_make_type_locals_genexpr
#define __pyx_n_s_maxsize __pyx_mstate_global->__pyx_n_s_maxsize
#define __pyx_kp_u_maxsize_is_expected_to_be_greate __pyx_mstate_global->__pyx_kp_u_maxsize_is_expected_to_be_greate
#define __pyx_n_s_member_names __pyx_mstate_global->__pyx_n_s_member_names
#define __pyx_n_s_members __pyx_mstate_global->__pyx_n_s_members
#define __pyx_n_s_members_2 __pyx_mstate_global->__pyx_n_s_members_2
#define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
#define __pyx_n_s_methname __pyx_mstate_global->__pyx_n_s_methname
#define __pyx_n_s_method __pyx_mstate_global->__pyx_n_s_method
#define __pyx_n_s_methods __pyx_mstate_global->__pyx_n_s_methods
#define __pyx_n_s_microseconds __pyx_mstate_global->__pyx_n_s_microseconds
#define __pyx_n_s_minor __pyx_mstate_global->__pyx_n_s_minor
#define __pyx_kp_u_missed __pyx_mstate_global->__pyx_kp_u_missed
#define __pyx_n_s_missed_args __pyx_mstate_global->__pyx_n_s_missed_args
#define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
#define __pyx_n_u_module __pyx_mstate_global->__pyx_n_u_module
#define __pyx_n_s_module_2 __pyx_mstate_global->__pyx_n_s_module_2
#define __pyx_n_s_months __pyx_mstate_global->__pyx_n_s_months
#define __pyx_kp_u_more_than_one_header_block __pyx_mstate_global->__pyx_kp_u_more_than_one_header_block
#define __pyx_n_s_move_to_end __pyx_mstate_global->__pyx_n_s_move_to_end
#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
#define __pyx_n_s_msg __pyx_mstate_global->__pyx_n_s_msg
#define __pyx_n_s_msg_buf __pyx_mstate_global->__pyx_n_s_msg_buf
#define __pyx_n_s_mtype __pyx_mstate_global->__pyx_n_s_mtype
#define __pyx_n_b_n __pyx_mstate_global->__pyx_n_b_n
#define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
#define __pyx_kp_u_named_tuple_dict_is_missing __pyx_mstate_global->__pyx_kp_u_named_tuple_dict_is_missing
#define __pyx_kp_u_named_tuple_is_missing __pyx_mstate_global->__pyx_kp_u_named_tuple_is_missing
#define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
#define __pyx_kp_u_neither_are_supported __pyx_mstate_global->__pyx_kp_u_neither_are_supported
#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
#define __pyx_n_s_new_cardinality __pyx_mstate_global->__pyx_n_s_new_cardinality
#define __pyx_kp_u_no_codec_implementation_for_Edge __pyx_mstate_global->__pyx_kp_u_no_codec_implementation_for_Edge
#define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
#define __pyx_kp_u_no_input __pyx_mstate_global->__pyx_kp_u_no_input
#define __pyx_kp_u_non_idle_status_after_connect __pyx_mstate_global->__pyx_kp_u_non_idle_status_after_connect
#define __pyx_kp_u_non_zero_reserved_bytes_in_durat __pyx_mstate_global->__pyx_kp_u_non_zero_reserved_bytes_in_durat
#define __pyx_kp_u_not_connected __pyx_mstate_global->__pyx_kp_u_not_connected
#define __pyx_n_u_nothing __pyx_mstate_global->__pyx_n_u_nothing
#define __pyx_n_u_null __pyx_mstate_global->__pyx_n_u_null
#define __pyx_kp_u_null_codec __pyx_mstate_global->__pyx_kp_u_null_codec
#define __pyx_n_s_num_methods __pyx_mstate_global->__pyx_n_s_num_methods
#define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
#define __pyx_n_s_object __pyx_mstate_global->__pyx_n_s_object
#define __pyx_n_s_on_log_message __pyx_mstate_global->__pyx_n_s_on_log_message
#define __pyx_kp_u_only_1_dimensional_arrays_are_su __pyx_mstate_global->__pyx_kp_u_only_1_dimensional_arrays_are_su
#define __pyx_kp_u_only_arrays_of_scalars_are_suppo __pyx_mstate_global->__pyx_kp_u_only_arrays_of_scalars_are_suppo
#define __pyx_kp_u_only_scalar_multiranges_are_supp __pyx_mstate_global->__pyx_kp_u_only_scalar_multiranges_are_supp
#define __pyx_kp_u_only_scalar_ranges_are_supported __pyx_mstate_global->__pyx_kp_u_only_scalar_ranges_are_supported
#define __pyx_n_s_out_dc __pyx_mstate_global->__pyx_n_s_out_dc
#define __pyx_n_s_out_type_id __pyx_mstate_global->__pyx_n_s_out_type_id
#define __pyx_n_s_output_format __pyx_mstate_global->__pyx_n_s_output_format
#define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
#define __pyx_n_s_packet __pyx_mstate_global->__pyx_n_s_packet
#define __pyx_n_s_params __pyx_mstate_global->__pyx_n_s_params
#define __pyx_n_s_parents __pyx_mstate_global->__pyx_n_s_parents
#define __pyx_n_s_parse __pyx_mstate_global->__pyx_n_s_parse
#define __pyx_n_s_parse_server_final_message __pyx_mstate_global->__pyx_n_s_parse_server_final_message
#define __pyx_n_s_parse_server_first_message __pyx_mstate_global->__pyx_n_s_parse_server_first_message
#define __pyx_n_s_passed_args __pyx_mstate_global->__pyx_n_s_passed_args
#define __pyx_n_s_passed_args_repr __pyx_mstate_global->__pyx_n_s_passed_args_repr
#define __pyx_n_s_password __pyx_mstate_global->__pyx_n_s_password
#define __pyx_n_s_pgproto __pyx_mstate_global->__pyx_n_s_pgproto
#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
#define __pyx_n_s_ping __pyx_mstate_global->__pyx_n_s_ping
#define __pyx_n_s_popitem __pyx_mstate_global->__pyx_n_s_popitem
#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
#define __pyx_n_u_python __pyx_mstate_global->__pyx_n_u_python
#define __pyx_kp_u_python_is_the_only_valid_format __pyx_mstate_global->__pyx_kp_u_python_is_the_only_valid_format
#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
#define __pyx_n_s_pyx_unpickle_CodecsRegistry __pyx_mstate_global->__pyx_n_s_pyx_unpickle_CodecsRegistry
#define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
#define __pyx_n_s_pyx_unpickle_ExecuteContext __pyx_mstate_global->__pyx_n_s_pyx_unpickle_ExecuteContext
#define __pyx_n_s_pyx_unpickle_LRUMapping __pyx_mstate_global->__pyx_n_s_pyx_unpickle_LRUMapping
#define __pyx_n_s_pyx_unpickle_SansIOProtocol __pyx_mstate_global->__pyx_n_s_pyx_unpickle_SansIOProtocol
#define __pyx_n_s_pyx_unpickle_SansIOProtocolBac __pyx_mstate_global->__pyx_n_s_pyx_unpickle_SansIOProtocolBac
#define __pyx_n_s_pyx_unpickle___Pyx_EnumMeta __pyx_mstate_global->__pyx_n_s_pyx_unpickle___Pyx_EnumMeta
#define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
#define __pyx_n_s_qc __pyx_mstate_global->__pyx_n_s_qc
#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
#define __pyx_n_u_qualname __pyx_mstate_global->__pyx_n_u_qualname
#define __pyx_n_s_query __pyx_mstate_global->__pyx_n_s_query
#define __pyx_n_s_query_2 __pyx_mstate_global->__pyx_n_s_query_2
#define __pyx_kp_u_query_cannot_be_executed_with __pyx_mstate_global->__pyx_kp_u_query_cannot_be_executed_with
#define __pyx_kp_u_query_executed_via __pyx_mstate_global->__pyx_kp_u_query_executed_via
#define __pyx_n_u_query_required_single __pyx_mstate_global->__pyx_n_u_query_required_single
#define __pyx_n_u_query_required_single_json __pyx_mstate_global->__pyx_n_u_query_required_single_json
#define __pyx_n_u_query_single __pyx_mstate_global->__pyx_n_u_query_single
#define __pyx_n_u_query_single_json __pyx_mstate_global->__pyx_n_u_query_single_json
#define __pyx_kp_u_r_is_out_of_range_for_type_half __pyx_mstate_global->__pyx_kp_u_r_is_out_of_range_for_type_half
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_s_range_mod __pyx_mstate_global->__pyx_n_s_range_mod
#define __pyx_n_u_raw_query __pyx_mstate_global->__pyx_n_u_raw_query
#define __pyx_n_s_re_exec __pyx_mstate_global->__pyx_n_s_re_exec
#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
#define __pyx_n_s_ref __pyx_mstate_global->__pyx_n_s_ref
#define __pyx_n_s_reg __pyx_mstate_global->__pyx_n_s_reg
#define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
#define __pyx_n_s_repr __pyx_mstate_global->__pyx_n_s_repr
#define __pyx_n_s_required __pyx_mstate_global->__pyx_n_s_required
#define __pyx_n_s_required_args __pyx_mstate_global->__pyx_n_s_required_args
#define __pyx_n_s_required_one __pyx_mstate_global->__pyx_n_s_required_one
#define __pyx_n_s_res __pyx_mstate_global->__pyx_n_s_res
#define __pyx_n_s_restore __pyx_mstate_global->__pyx_n_s_restore
#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result
#define __pyx_kp_u_result_is_not_a_list_but __pyx_mstate_global->__pyx_kp_u_result_is_not_a_list_but
#define __pyx_n_s_ret __pyx_mstate_global->__pyx_n_s_ret
#define __pyx_kp_u_returned_no_data __pyx_mstate_global->__pyx_kp_u_returned_no_data
#define __pyx_n_s_reversed __pyx_mstate_global->__pyx_n_s_reversed
#define __pyx_n_s_rv __pyx_mstate_global->__pyx_n_s_rv
#define __pyx_kp_s_s_s __pyx_mstate_global->__pyx_kp_s_s_s
#define __pyx_kp_s_s_s_d __pyx_mstate_global->__pyx_kp_s_s_s_d
#define __pyx_n_s_salt __pyx_mstate_global->__pyx_n_s_salt
#define __pyx_n_s_scram __pyx_mstate_global->__pyx_n_s_scram
#define __pyx_n_s_secret_key __pyx_mstate_global->__pyx_n_s_secret_key
#define __pyx_n_u_secret_key __pyx_mstate_global->__pyx_n_u_secret_key
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_n_s_send __pyx_mstate_global->__pyx_n_s_send
#define __pyx_kp_u_server_SCRAM_proof_does_not_matc __pyx_mstate_global->__pyx_kp_u_server_SCRAM_proof_does_not_matc
#define __pyx_n_s_server_final __pyx_mstate_global->__pyx_n_s_server_final
#define __pyx_n_s_server_first __pyx_mstate_global->__pyx_n_s_server_first
#define __pyx_n_s_server_nonce __pyx_mstate_global->__pyx_n_s_server_nonce
#define __pyx_n_s_server_sig __pyx_mstate_global->__pyx_n_s_server_sig
#define __pyx_n_s_set_connection __pyx_mstate_global->__pyx_n_s_set_connection
#define __pyx_n_s_set_dataclass_fields_func __pyx_mstate_global->__pyx_n_s_set_dataclass_fields_func
#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
#define __pyx_n_s_set_type_codec __pyx_mstate_global->__pyx_n_s_set_type_codec
#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
#define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
#define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
#define __pyx_kp_u_size_of_encoded_multirange_datum __pyx_mstate_global->__pyx_kp_u_size_of_encoded_multirange_datum
#define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state
#define __pyx_n_s_status __pyx_mstate_global->__pyx_n_s_status
#define __pyx_n_u_std __pyx_mstate_global->__pyx_n_u_std
#define __pyx_kp_u_std_bigint __pyx_mstate_global->__pyx_kp_u_std_bigint
#define __pyx_kp_u_std_bool __pyx_mstate_global->__pyx_kp_u_std_bool
#define __pyx_kp_u_std_bytes __pyx_mstate_global->__pyx_kp_u_std_bytes
#define __pyx_kp_u_std_datetime __pyx_mstate_global->__pyx_kp_u_std_datetime
#define __pyx_kp_u_std_decimal __pyx_mstate_global->__pyx_kp_u_std_decimal
#define __pyx_kp_u_std_duration __pyx_mstate_global->__pyx_kp_u_std_duration
#define __pyx_kp_u_std_float32 __pyx_mstate_global->__pyx_kp_u_std_float32
#define __pyx_kp_u_std_float64 __pyx_mstate_global->__pyx_kp_u_std_float64
#define __pyx_kp_u_std_int16 __pyx_mstate_global->__pyx_kp_u_std_int16
#define __pyx_kp_u_std_int32 __pyx_mstate_global->__pyx_kp_u_std_int32
#define __pyx_kp_u_std_int64 __pyx_mstate_global->__pyx_kp_u_std_int64
#define __pyx_kp_u_std_json __pyx_mstate_global->__pyx_kp_u_std_json
#define __pyx_kp_u_std_pg_date __pyx_mstate_global->__pyx_kp_u_std_pg_date
#define __pyx_kp_u_std_pg_interval __pyx_mstate_global->__pyx_kp_u_std_pg_interval
#define __pyx_kp_u_std_pg_json __pyx_mstate_global->__pyx_kp_u_std_pg_json
#define __pyx_kp_u_std_pg_timestamp __pyx_mstate_global->__pyx_kp_u_std_pg_timestamp
#define __pyx_kp_u_std_pg_timestamptz __pyx_mstate_global->__pyx_kp_u_std_pg_timestamptz
#define __pyx_kp_u_std_str __pyx_mstate_global->__pyx_kp_u_std_str
#define __pyx_kp_u_std_uuid __pyx_mstate_global->__pyx_kp_u_std_uuid
#define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
#define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
#define __pyx_n_s_str __pyx_mstate_global->__pyx_n_s_str
#define __pyx_n_s_str_2 __pyx_mstate_global->__pyx_n_s_str_2
#define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
#define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
#define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
#define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip
#define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
#define __pyx_n_u_suggested_pool_concurrency __pyx_mstate_global->__pyx_n_u_suggested_pool_concurrency
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_n_s_sync __pyx_mstate_global->__pyx_n_s_sync
#define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
#define __pyx_n_u_system_config __pyx_mstate_global->__pyx_n_u_system_config
#define __pyx_n_s_terminate __pyx_mstate_global->__pyx_n_s_terminate
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_kp_u_the_connection_has_been_closed __pyx_mstate_global->__pyx_kp_u_the_connection_has_been_closed
#define __pyx_kp_u_the_connection_has_been_closed_b __pyx_mstate_global->__pyx_kp_u_the_connection_has_been_closed_b
#define __pyx_kp_u_the_server_offered_the_following __pyx_mstate_global->__pyx_kp_u_the_server_offered_the_following
#define __pyx_kp_u_the_server_requested_SASL_authen __pyx_mstate_global->__pyx_kp_u_the_server_requested_SASL_authen
#define __pyx_kp_u_the_server_requested_an_unsuppor __pyx_mstate_global->__pyx_kp_u_the_server_requested_an_unsuppor
#define __pyx_n_s_throw __pyx_mstate_global->__pyx_n_s_throw
#define __pyx_n_s_tid __pyx_mstate_global->__pyx_n_s_tid
#define __pyx_n_u_tid __pyx_mstate_global->__pyx_n_u_tid
#define __pyx_n_s_time __pyx_mstate_global->__pyx_n_s_time
#define __pyx_n_s_timedelta __pyx_mstate_global->__pyx_n_s_timedelta
#define __pyx_n_u_tname __pyx_mstate_global->__pyx_n_u_tname
#define __pyx_kp_u_too_many_annotations __pyx_mstate_global->__pyx_kp_u_too_many_annotations
#define __pyx_kp_u_too_many_elements_for_a_tuple __pyx_mstate_global->__pyx_kp_u_too_many_elements_for_a_tuple
#define __pyx_kp_u_too_many_elements_in_array_value __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_array_value
#define __pyx_kp_u_too_many_elements_in_multirange __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_multirange
#define __pyx_kp_u_too_many_elements_in_vector_valu __pyx_mstate_global->__pyx_kp_u_too_many_elements_in_vector_valu
#define __pyx_n_s_try_from __pyx_mstate_global->__pyx_n_s_try_from
#define __pyx_n_s_try_recv_eagerly __pyx_mstate_global->__pyx_n_s_try_recv_eagerly
#define __pyx_n_s_type __pyx_mstate_global->__pyx_n_s_type
#define __pyx_n_s_type_size __pyx_mstate_global->__pyx_n_s_type_size
#define __pyx_n_s_typeid __pyx_mstate_global->__pyx_n_s_typeid
#define __pyx_kp_u_typeid_must_be_a_UUID __pyx_mstate_global->__pyx_kp_u_typeid_must_be_a_UUID
#define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types
#define __pyx_n_s_typing __pyx_mstate_global->__pyx_n_s_typing
#define __pyx_kp_s_typing_Optional_int __pyx_mstate_global->__pyx_kp_s_typing_Optional_int
#define __pyx_n_u_tzinfo __pyx_mstate_global->__pyx_n_u_tzinfo
#define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
#define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
#define __pyx_kp_u_unable_to_decode_data_to_Python __pyx_mstate_global->__pyx_kp_u_unable_to_decode_data_to_Python
#define __pyx_kp_u_unexpected_NULL_element_in_multi __pyx_mstate_global->__pyx_kp_u_unexpected_NULL_element_in_multi
#define __pyx_kp_u_unexpected_NULL_value_in_array_s __pyx_mstate_global->__pyx_kp_u_unexpected_NULL_value_in_array_s
#define __pyx_kp_u_unexpected_message_type __pyx_mstate_global->__pyx_kp_u_unexpected_message_type
#define __pyx_kp_u_unexpected_query_argument_codec __pyx_mstate_global->__pyx_kp_u_unexpected_query_argument_codec
#define __pyx_kp_u_unexpected_trailing_data_in_buff __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff
#define __pyx_kp_u_unexpected_trailing_data_in_buff_2 __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff_2
#define __pyx_kp_u_unexpected_trailing_data_in_buff_3 __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff_3
#define __pyx_kp_u_unexpected_trailing_data_in_buff_4 __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff_4
#define __pyx_kp_u_unexpected_trailing_data_in_buff_5 __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff_5
#define __pyx_kp_u_unexpected_trailing_data_in_buff_6 __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff_6
#define __pyx_kp_u_unexpected_trailing_data_in_buff_7 __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff_7
#define __pyx_kp_u_unexpected_trailing_data_in_buff_8 __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff_8
#define __pyx_kp_u_unexpected_trailing_data_in_buff_9 __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_buff_9
#define __pyx_kp_u_unexpected_trailing_data_in_type __pyx_mstate_global->__pyx_kp_u_unexpected_trailing_data_in_type
#define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
#define __pyx_kp_u_unsupported_authentication_metho __pyx_mstate_global->__pyx_kp_u_unsupported_authentication_metho
#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
#define __pyx_n_s_upper __pyx_mstate_global->__pyx_n_s_upper
#define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate
#define __pyx_n_s_user __pyx_mstate_global->__pyx_n_s_user
#define __pyx_n_u_user __pyx_mstate_global->__pyx_n_u_user
#define __pyx_kp_u_utf_8 __pyx_mstate_global->__pyx_kp_u_utf_8
#define __pyx_n_s_uuid __pyx_mstate_global->__pyx_n_s_uuid
#define __pyx_n_s_v __pyx_mstate_global->__pyx_n_s_v
#define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value
#define __pyx_n_s_value_type __pyx_mstate_global->__pyx_n_s_value_type
#define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
#define __pyx_n_s_ver_buf __pyx_mstate_global->__pyx_n_s_ver_buf
#define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
#define __pyx_n_s_wait_for_connect __pyx_mstate_global->__pyx_n_s_wait_for_connect
#define __pyx_n_s_wait_for_disconnect __pyx_mstate_global->__pyx_n_s_wait_for_disconnect
#define __pyx_n_s_wait_for_message __pyx_mstate_global->__pyx_n_s_wait_for_message
#define __pyx_n_u_warnings __pyx_mstate_global->__pyx_n_u_warnings
#define __pyx_n_s_weakref __pyx_mstate_global->__pyx_n_s_weakref
#define __pyx_n_s_wkb __pyx_mstate_global->__pyx_n_s_wkb
#define __pyx_n_u_wkb __pyx_mstate_global->__pyx_n_u_wkb
#define __pyx_n_s_zfill __pyx_mstate_global->__pyx_n_s_zfill
#define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip
#define __pyx_float_0_0 __pyx_mstate_global->__pyx_float_0_0
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
#define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
#define __pyx_int_4 __pyx_mstate_global->__pyx_int_4
#define __pyx_int_13 __pyx_mstate_global->__pyx_int_13
#define __pyx_int_14 __pyx_mstate_global->__pyx_int_14
#define __pyx_int_40 __pyx_mstate_global->__pyx_int_40
#define __pyx_int_200 __pyx_mstate_global->__pyx_int_200
#define __pyx_int_1000 __pyx_mstate_global->__pyx_int_1000
#define __pyx_int_4097 __pyx_mstate_global->__pyx_int_4097
#define __pyx_int_10000 __pyx_mstate_global->__pyx_int_10000
#define __pyx_int_65281 __pyx_mstate_global->__pyx_int_65281
#define __pyx_int_65282 __pyx_mstate_global->__pyx_int_65282
#define __pyx_int_65283 __pyx_mstate_global->__pyx_int_65283
#define __pyx_int_65284 __pyx_mstate_global->__pyx_int_65284
#define __pyx_int_14808274 __pyx_mstate_global->__pyx_int_14808274
#define __pyx_int_34451156 __pyx_mstate_global->__pyx_int_34451156
#define __pyx_int_52716380 __pyx_mstate_global->__pyx_int_52716380
#define __pyx_int_65974055 __pyx_mstate_global->__pyx_int_65974055
#define __pyx_int_84082689 __pyx_mstate_global->__pyx_int_84082689
#define __pyx_int_84082690 __pyx_mstate_global->__pyx_int_84082690
#define __pyx_int_84082945 __pyx_mstate_global->__pyx_int_84082945
#define __pyx_int_84082946 __pyx_mstate_global->__pyx_int_84082946
#define __pyx_int_87255255 __pyx_mstate_global->__pyx_int_87255255
#define __pyx_int_94322648 __pyx_mstate_global->__pyx_int_94322648
#define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
#define __pyx_int_113914406 __pyx_mstate_global->__pyx_int_113914406
#define __pyx_int_121062814 __pyx_mstate_global->__pyx_int_121062814
#define __pyx_int_124019026 __pyx_mstate_global->__pyx_int_124019026
#define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
#define __pyx_int_181010524 __pyx_mstate_global->__pyx_int_181010524
#define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
#define __pyx_int_222419149 __pyx_mstate_global->__pyx_int_222419149
#define __pyx_int_228165448 __pyx_mstate_global->__pyx_int_228165448
#define __pyx_int_228825662 __pyx_mstate_global->__pyx_int_228825662
#define __pyx_int_238750788 __pyx_mstate_global->__pyx_int_238750788
#define __pyx_int_262771094 __pyx_mstate_global->__pyx_int_262771094
#define __pyx_int_2147483648 __pyx_mstate_global->__pyx_int_2147483648
#define __pyx_int_0xffffffffffffffff __pyx_mstate_global->__pyx_int_0xffffffffffffffff
#define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
#define __pyx_k__52 __pyx_mstate_global->__pyx_k__52
#define __pyx_k__53 __pyx_mstate_global->__pyx_k__53
#define __pyx_k__84 __pyx_mstate_global->__pyx_k__84
#define __pyx_k__85 __pyx_mstate_global->__pyx_k__85
#define __pyx_slice__7 __pyx_mstate_global->__pyx_slice__7
#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
#define __pyx_slice__16 __pyx_mstate_global->__pyx_slice__16
#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32
#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35
#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37
#define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38
#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39
#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40
#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41
#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42
#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43
#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45
#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47
#define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49
#define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50
#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51
#define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54
#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55
#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61
#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67
#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68
#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69
#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70
#define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75
#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76
#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77
#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79
#define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81
#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82
#define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83
#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87
#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92
#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93
#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94
#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95
#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98
#define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100
#define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102
#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103
#define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112
#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113
#define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114
#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115
#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116
#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117
#define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118
#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119
#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124
#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125
#define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126
#define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127
#define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128
#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129
#define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130
#define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131
#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132
#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133
#define __pyx_tuple__134 __pyx_mstate_global->__pyx_tuple__134
#define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135
#define __pyx_tuple__136 __pyx_mstate_global->__pyx_tuple__136
#define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137
#define __pyx_tuple__138 __pyx_mstate_global->__pyx_tuple__138
#define __pyx_tuple__139 __pyx_mstate_global->__pyx_tuple__139
#define __pyx_tuple__140 __pyx_mstate_global->__pyx_tuple__140
#define __pyx_tuple__141 __pyx_mstate_global->__pyx_tuple__141
#define __pyx_tuple__142 __pyx_mstate_global->__pyx_tuple__142
#define __pyx_tuple__143 __pyx_mstate_global->__pyx_tuple__143
#define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144
#define __pyx_tuple__145 __pyx_mstate_global->__pyx_tuple__145
#define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146
#define __pyx_tuple__147 __pyx_mstate_global->__pyx_tuple__147
#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148
#define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149
#define __pyx_tuple__150 __pyx_mstate_global->__pyx_tuple__150
#define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151
#define __pyx_tuple__152 __pyx_mstate_global->__pyx_tuple__152
#define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153
#define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155
#define __pyx_tuple__158 __pyx_mstate_global->__pyx_tuple__158
#define __pyx_tuple__181 __pyx_mstate_global->__pyx_tuple__181
#define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185
#define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189
#define __pyx_tuple__191 __pyx_mstate_global->__pyx_tuple__191
#define __pyx_tuple__193 __pyx_mstate_global->__pyx_tuple__193
#define __pyx_tuple__217 __pyx_mstate_global->__pyx_tuple__217
#define __pyx_tuple__225 __pyx_mstate_global->__pyx_tuple__225
#define __pyx_tuple__228 __pyx_mstate_global->__pyx_tuple__228
#define __pyx_tuple__229 __pyx_mstate_global->__pyx_tuple__229
#define __pyx_tuple__230 __pyx_mstate_global->__pyx_tuple__230
#define __pyx_tuple__231 __pyx_mstate_global->__pyx_tuple__231
#define __pyx_tuple__232 __pyx_mstate_global->__pyx_tuple__232
#define __pyx_tuple__233 __pyx_mstate_global->__pyx_tuple__233
#define __pyx_tuple__234 __pyx_mstate_global->__pyx_tuple__234
#define __pyx_tuple__235 __pyx_mstate_global->__pyx_tuple__235
#define __pyx_tuple__237 __pyx_mstate_global->__pyx_tuple__237
#define __pyx_tuple__238 __pyx_mstate_global->__pyx_tuple__238
#define __pyx_tuple__242 __pyx_mstate_global->__pyx_tuple__242
#define __pyx_tuple__243 __pyx_mstate_global->__pyx_tuple__243
#define __pyx_tuple__244 __pyx_mstate_global->__pyx_tuple__244
#define __pyx_tuple__245 __pyx_mstate_global->__pyx_tuple__245
#define __pyx_tuple__246 __pyx_mstate_global->__pyx_tuple__246
#define __pyx_codeobj__56 __pyx_mstate_global->__pyx_codeobj__56
#define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57
#define __pyx_codeobj__58 __pyx_mstate_global->__pyx_codeobj__58
#define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59
#define __pyx_codeobj__60 __pyx_mstate_global->__pyx_codeobj__60
#define __pyx_codeobj__62 __pyx_mstate_global->__pyx_codeobj__62
#define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63
#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64
#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66
#define __pyx_codeobj__71 __pyx_mstate_global->__pyx_codeobj__71
#define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72
#define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73
#define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74
#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78
#define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86
#define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88
#define __pyx_codeobj__89 __pyx_mstate_global->__pyx_codeobj__89
#define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90
#define __pyx_codeobj__91 __pyx_mstate_global->__pyx_codeobj__91
#define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97
#define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99
#define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101
#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104
#define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105
#define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106
#define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107
#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108
#define __pyx_codeobj__110 __pyx_mstate_global->__pyx_codeobj__110
#define __pyx_codeobj__120 __pyx_mstate_global->__pyx_codeobj__120
#define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121
#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122
#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123
#define __pyx_codeobj__159 __pyx_mstate_global->__pyx_codeobj__159
#define __pyx_codeobj__160 __pyx_mstate_global->__pyx_codeobj__160
#define __pyx_codeobj__161 __pyx_mstate_global->__pyx_codeobj__161
#define __pyx_codeobj__162 __pyx_mstate_global->__pyx_codeobj__162
#define __pyx_codeobj__163 __pyx_mstate_global->__pyx_codeobj__163
#define __pyx_codeobj__164 __pyx_mstate_global->__pyx_codeobj__164
#define __pyx_codeobj__165 __pyx_mstate_global->__pyx_codeobj__165
#define __pyx_codeobj__166 __pyx_mstate_global->__pyx_codeobj__166
#define __pyx_codeobj__167 __pyx_mstate_global->__pyx_codeobj__167
#define __pyx_codeobj__168 __pyx_mstate_global->__pyx_codeobj__168
#define __pyx_codeobj__169 __pyx_mstate_global->__pyx_codeobj__169
#define __pyx_codeobj__170 __pyx_mstate_global->__pyx_codeobj__170
#define __pyx_codeobj__171 __pyx_mstate_global->__pyx_codeobj__171
#define __pyx_codeobj__172 __pyx_mstate_global->__pyx_codeobj__172
#define __pyx_codeobj__173 __pyx_mstate_global->__pyx_codeobj__173
#define __pyx_codeobj__174 __pyx_mstate_global->__pyx_codeobj__174
#define __pyx_codeobj__175 __pyx_mstate_global->__pyx_codeobj__175
#define __pyx_codeobj__176 __pyx_mstate_global->__pyx_codeobj__176
#define __pyx_codeobj__177 __pyx_mstate_global->__pyx_codeobj__177
#define __pyx_codeobj__178 __pyx_mstate_global->__pyx_codeobj__178
#define __pyx_codeobj__179 __pyx_mstate_global->__pyx_codeobj__179
#define __pyx_codeobj__180 __pyx_mstate_global->__pyx_codeobj__180
#define __pyx_codeobj__182 __pyx_mstate_global->__pyx_codeobj__182
#define __pyx_codeobj__183 __pyx_mstate_global->__pyx_codeobj__183
#define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184
#define __pyx_codeobj__186 __pyx_mstate_global->__pyx_codeobj__186
#define __pyx_codeobj__187 __pyx_mstate_global->__pyx_codeobj__187
#define __pyx_codeobj__188 __pyx_mstate_global->__pyx_codeobj__188
#define __pyx_codeobj__190 __pyx_mstate_global->__pyx_codeobj__190
#define __pyx_codeobj__192 __pyx_mstate_global->__pyx_codeobj__192
#define __pyx_codeobj__194 __pyx_mstate_global->__pyx_codeobj__194
#define __pyx_codeobj__195 __pyx_mstate_global->__pyx_codeobj__195
#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196
#define __pyx_codeobj__197 __pyx_mstate_global->__pyx_codeobj__197
#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198
#define __pyx_codeobj__199 __pyx_mstate_global->__pyx_codeobj__199
#define __pyx_codeobj__200 __pyx_mstate_global->__pyx_codeobj__200
#define __pyx_codeobj__201 __pyx_mstate_global->__pyx_codeobj__201
#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202
#define __pyx_codeobj__203 __pyx_mstate_global->__pyx_codeobj__203
#define __pyx_codeobj__204 __pyx_mstate_global->__pyx_codeobj__204
#define __pyx_codeobj__205 __pyx_mstate_global->__pyx_codeobj__205
#define __pyx_codeobj__206 __pyx_mstate_global->__pyx_codeobj__206
#define __pyx_codeobj__207 __pyx_mstate_global->__pyx_codeobj__207
#define __pyx_codeobj__208 __pyx_mstate_global->__pyx_codeobj__208
#define __pyx_codeobj__209 __pyx_mstate_global->__pyx_codeobj__209
#define __pyx_codeobj__210 __pyx_mstate_global->__pyx_codeobj__210
#define __pyx_codeobj__211 __pyx_mstate_global->__pyx_codeobj__211
#define __pyx_codeobj__212 __pyx_mstate_global->__pyx_codeobj__212
#define __pyx_codeobj__213 __pyx_mstate_global->__pyx_codeobj__213
#define __pyx_codeobj__214 __pyx_mstate_global->__pyx_codeobj__214
#define __pyx_codeobj__215 __pyx_mstate_global->__pyx_codeobj__215
#define __pyx_codeobj__216 __pyx_mstate_global->__pyx_codeobj__216
#define __pyx_codeobj__218 __pyx_mstate_global->__pyx_codeobj__218
#define __pyx_codeobj__219 __pyx_mstate_global->__pyx_codeobj__219
#define __pyx_codeobj__220 __pyx_mstate_global->__pyx_codeobj__220
#define __pyx_codeobj__221 __pyx_mstate_global->__pyx_codeobj__221
#define __pyx_codeobj__222 __pyx_mstate_global->__pyx_codeobj__222
#define __pyx_codeobj__223 __pyx_mstate_global->__pyx_codeobj__223
#define __pyx_codeobj__224 __pyx_mstate_global->__pyx_codeobj__224
#define __pyx_codeobj__226 __pyx_mstate_global->__pyx_codeobj__226
#define __pyx_codeobj__227 __pyx_mstate_global->__pyx_codeobj__227
#define __pyx_codeobj__236 __pyx_mstate_global->__pyx_codeobj__236
#define __pyx_codeobj__239 __pyx_mstate_global->__pyx_codeobj__239
#define __pyx_codeobj__240 __pyx_mstate_global->__pyx_codeobj__240
#define __pyx_codeobj__247 __pyx_mstate_global->__pyx_codeobj__247
#define __pyx_codeobj__248 __pyx_mstate_global->__pyx_codeobj__248
#define __pyx_codeobj__249 __pyx_mstate_global->__pyx_codeobj__249
#define __pyx_codeobj__250 __pyx_mstate_global->__pyx_codeobj__250
#define __pyx_codeobj__251 __pyx_mstate_global->__pyx_codeobj__251
#define __pyx_codeobj__252 __pyx_mstate_global->__pyx_codeobj__252
#define __pyx_codeobj__253 __pyx_mstate_global->__pyx_codeobj__253
/* #### Code section: module_code ### */

/* "EnumTypeToPy":3
 * 
 * @cname("__Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py")
 * cdef __Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(InputLanguage c_val):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_enum
 *     __pyx_enum = InputLanguage
 */

static PyObject *__Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage __pyx_v_c_val) {
  PyObject *__pyx_v___pyx_enum = 0;
  int __pyx_v_underlying_c_val;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py", 1);

  /* "EnumTypeToPy":5
 * cdef __Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(InputLanguage c_val):
 *     cdef object __pyx_enum
 *     __pyx_enum = InputLanguage             # <<<<<<<<<<<<<<
 * 
 *     if 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_InputLanguage); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v___pyx_enum = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "EnumTypeToPy":7
 *     __pyx_enum = InputLanguage
 * 
 *     if 0:             # <<<<<<<<<<<<<<
 *         pass
 *     elif c_val == InputLanguage.EDGEQL:
 */
  switch (__pyx_v_c_val) {
    case __pyx_e_3gel_8protocol_8protocol_EDGEQL:

    /* "EnumTypeToPy":10
 *         pass
 *     elif c_val == InputLanguage.EDGEQL:
 *         return __pyx_enum.EDGEQL             # <<<<<<<<<<<<<<
 *     elif c_val == InputLanguage.SQL:
 *         return __pyx_enum.SQL
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v___pyx_enum, __pyx_n_s_EDGEQL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "EnumTypeToPy":9
 *     if 0:
 *         pass
 *     elif c_val == InputLanguage.EDGEQL:             # <<<<<<<<<<<<<<
 *         return __pyx_enum.EDGEQL
 *     elif c_val == InputLanguage.SQL:
 */
    break;
    case __pyx_e_3gel_8protocol_8protocol_SQL:

    /* "EnumTypeToPy":12
 *         return __pyx_enum.EDGEQL
 *     elif c_val == InputLanguage.SQL:
 *         return __pyx_enum.SQL             # <<<<<<<<<<<<<<
 *     else:
 *         underlying_c_val = <int>c_val
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v___pyx_enum, __pyx_n_s_SQL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "EnumTypeToPy":11
 *     elif c_val == InputLanguage.EDGEQL:
 *         return __pyx_enum.EDGEQL
 *     elif c_val == InputLanguage.SQL:             # <<<<<<<<<<<<<<
 *         return __pyx_enum.SQL
 *     else:
 */
    break;
    default:

    /* "EnumTypeToPy":14
 *         return __pyx_enum.SQL
 *     else:
 *         underlying_c_val = <int>c_val             # <<<<<<<<<<<<<<
 *         return __pyx_enum(underlying_c_val)
 * 
 */
    __pyx_v_underlying_c_val = ((int)__pyx_v_c_val);

    /* "EnumTypeToPy":15
 *     else:
 *         underlying_c_val = <int>c_val
 *         return __pyx_enum(underlying_c_val)             # <<<<<<<<<<<<<<
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_underlying_c_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v___pyx_enum);
    __pyx_t_3 = __pyx_v___pyx_enum; __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
  }

  /* "EnumTypeToPy":3
 * 
 * @cname("__Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py")
 * cdef __Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(InputLanguage c_val):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_enum
 *     __pyx_enum = InputLanguage
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("EnumTypeToPy.__Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_enum);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_c_val) {
  PyObject *__pyx_v___pyx_enum = 0;
  int __pyx_v_underlying_c_val;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py", 1);

  /* "EnumTypeToPy":5
 * cdef __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(OutputFormat c_val):
 *     cdef object __pyx_enum
 *     __pyx_enum = OutputFormat             # <<<<<<<<<<<<<<
 * 
 *     if 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v___pyx_enum = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "EnumTypeToPy":7
 *     __pyx_enum = OutputFormat
 * 
 *     if 0:             # <<<<<<<<<<<<<<
 *         pass
 *     elif c_val == OutputFormat.BINARY:
 */
  switch (__pyx_v_c_val) {
    case __pyx_e_3gel_8protocol_8protocol_BINARY:

    /* "EnumTypeToPy":10
 *         pass
 *     elif c_val == OutputFormat.BINARY:
 *         return __pyx_enum.BINARY             # <<<<<<<<<<<<<<
 *     elif c_val == OutputFormat.JSON:
 *         return __pyx_enum.JSON
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v___pyx_enum, __pyx_n_s_BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 10, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "EnumTypeToPy":9
 *     if 0:
 *         pass
 *     elif c_val == OutputFormat.BINARY:             # <<<<<<<<<<<<<<
 *         return __pyx_enum.BINARY
 *     elif c_val == OutputFormat.JSON:
 */
    break;
    case __pyx_e_3gel_8protocol_8protocol_JSON:

    /* "EnumTypeToPy":12
 *         return __pyx_enum.BINARY
 *     elif c_val == OutputFormat.JSON:
 *         return __pyx_enum.JSON             # <<<<<<<<<<<<<<
 *     elif c_val == OutputFormat.JSON_ELEMENTS:
 *         return __pyx_enum.JSON_ELEMENTS
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v___pyx_enum, __pyx_n_s_JSON); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "EnumTypeToPy":11
 *     elif c_val == OutputFormat.BINARY:
 *         return __pyx_enum.BINARY
 *     elif c_val == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *         return __pyx_enum.JSON
 *     elif c_val == OutputFormat.JSON_ELEMENTS:
 */
    break;
    case __pyx_e_3gel_8protocol_8protocol_JSON_ELEMENTS:

    /* "EnumTypeToPy":14
 *         return __pyx_enum.JSON
 *     elif c_val == OutputFormat.JSON_ELEMENTS:
 *         return __pyx_enum.JSON_ELEMENTS             # <<<<<<<<<<<<<<
 *     elif c_val == OutputFormat.NONE:
 *         return __pyx_enum.NONE
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v___pyx_enum, __pyx_n_s_JSON_ELEMENTS); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "EnumTypeToPy":13
 *     elif c_val == OutputFormat.JSON:
 *         return __pyx_enum.JSON
 *     elif c_val == OutputFormat.JSON_ELEMENTS:             # <<<<<<<<<<<<<<
 *         return __pyx_enum.JSON_ELEMENTS
 *     elif c_val == OutputFormat.NONE:
 */
    break;
    case __pyx_e_3gel_8protocol_8protocol_NONE:

    /* "EnumTypeToPy":16
 *         return __pyx_enum.JSON_ELEMENTS
 *     elif c_val == OutputFormat.NONE:
 *         return __pyx_enum.NONE             # <<<<<<<<<<<<<<
 *     else:
 *         underlying_c_val = <int>c_val
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v___pyx_enum, __pyx_n_s_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 16, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "EnumTypeToPy":15
 *     elif c_val == OutputFormat.JSON_ELEMENTS:
 *         return __pyx_enum.JSON_ELEMENTS
 *     elif c_val == OutputFormat.NONE:             # <<<<<<<<<<<<<<
 *         return __pyx_enum.NONE
 *     else:
 */
    break;
    default:

    /* "EnumTypeToPy":18
 *         return __pyx_enum.NONE
 *     else:
 *         underlying_c_val = <int>c_val             # <<<<<<<<<<<<<<
 *         return __pyx_enum(underlying_c_val)
 * 
 */
    __pyx_v_underlying_c_val = ((int)__pyx_v_c_val);

    /* "EnumTypeToPy":19
 *     else:
 *         underlying_c_val = <int>c_val
 *         return __pyx_enum(underlying_c_val)             # <<<<<<<<<<<<<<
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_underlying_c_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v___pyx_enum);
    __pyx_t_3 = __pyx_v___pyx_enum; __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    break;
  }

  /* "EnumTypeToPy":3
 * 
 * @cname("__Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py")
 * cdef __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(OutputFormat c_val):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_enum
 *     __pyx_enum = OutputFormat
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("EnumTypeToPy.__Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_enum);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "EnumBase":17
 * @cython.internal
 * cdef class __Pyx_EnumMeta(type):
 *     def __init__(cls, name, parents, dct):             # <<<<<<<<<<<<<<
 *         type.__init__(cls, name, parents, dct)
 *         cls.__members__ = __Pyx_OrderedDict()
 */

/* Python wrapper */
static int __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_parents = 0;
  PyObject *__pyx_v_dct = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_parents,&__pyx_n_s_dct,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 17, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_parents)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 17, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(2, 17, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dct)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 17, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(2, 17, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(2, 17, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
      values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
      values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
    }
    __pyx_v_name = values[0];
    __pyx_v_parents = values[1];
    __pyx_v_dct = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 17, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls), __pyx_v_name, __pyx_v_parents, __pyx_v_dct);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8EnumBase_14__Pyx_EnumMeta___init__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name, PyObject *__pyx_v_parents, PyObject *__pyx_v_dct) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "EnumBase":18
 * cdef class __Pyx_EnumMeta(type):
 *     def __init__(cls, name, parents, dct):
 *         type.__init__(cls, name, parents, dct)             # <<<<<<<<<<<<<<
 *         cls.__members__ = __Pyx_OrderedDict()
 *     def __iter__(cls):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyType_Type)), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_3, ((PyObject *)__pyx_v_cls), __pyx_v_name, __pyx_v_parents, __pyx_v_dct};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "EnumBase":19
 *     def __init__(cls, name, parents, dct):
 *         type.__init__(cls, name, parents, dct)
 *         cls.__members__ = __Pyx_OrderedDict()             # <<<<<<<<<<<<<<
 *     def __iter__(cls):
 *         return iter(cls.__members__.values())
 */
  __Pyx_INCREF(__Pyx_OrderedDict);
  __pyx_t_2 = __Pyx_OrderedDict; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 19, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members, __pyx_t_1) < 0) __PYX_ERR(2, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "EnumBase":17
 * @cython.internal
 * cdef class __Pyx_EnumMeta(type):
 *     def __init__(cls, name, parents, dct):             # <<<<<<<<<<<<<<
 *         type.__init__(cls, name, parents, dct)
 *         cls.__members__ = __Pyx_OrderedDict()
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "EnumBase":20
 *         type.__init__(cls, name, parents, dct)
 *         cls.__members__ = __Pyx_OrderedDict()
 *     def __iter__(cls):             # <<<<<<<<<<<<<<
 *         return iter(cls.__members__.values())
 *     def __getitem__(cls, name):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__(PyObject *__pyx_v_cls); /*proto*/
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__(PyObject *__pyx_v_cls) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls));

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

static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_2__iter__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "EnumBase":21
 *         cls.__members__ = __Pyx_OrderedDict()
 *     def __iter__(cls):
 *         return iter(cls.__members__.values())             # <<<<<<<<<<<<<<
 *     def __getitem__(cls, name):
 *         return cls.__members__[name]
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 21, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "EnumBase":20
 *         type.__init__(cls, name, parents, dct)
 *         cls.__members__ = __Pyx_OrderedDict()
 *     def __iter__(cls):             # <<<<<<<<<<<<<<
 *         return iter(cls.__members__.values())
 *     def __getitem__(cls, name):
 */

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

/* "EnumBase":22
 *     def __iter__(cls):
 *         return iter(cls.__members__.values())
 *     def __getitem__(cls, name):             # <<<<<<<<<<<<<<
 *         return cls.__members__[name]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__(PyObject *__pyx_v_cls, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__(PyObject *__pyx_v_cls, PyObject *__pyx_v_name) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_cls), ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_4__getitem__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_cls, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "EnumBase":23
 *         return iter(cls.__members__.values())
 *     def __getitem__(cls, name):
 *         return cls.__members__[name]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_members); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "EnumBase":22
 *     def __iter__(cls):
 *         return iter(cls.__members__.values())
 *     def __getitem__(cls, name):             # <<<<<<<<<<<<<<
 *         return cls.__members__[name]
 * 
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_self));

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

static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_6__reduce_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = ()             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_v_state = __pyx_empty_tuple;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = ()
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, None), state
 *     else:
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_238750788);
    __Pyx_GIVEREF(__pyx_int_238750788);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_238750788)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumMeta_8__setstate_cython__(struct __pyx_obj___Pyx_EnumMeta *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_unpickle___Pyx_EnumMeta__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumMeta.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "EnumBase":28
 * cdef object __Pyx_EnumBase
 * class __Pyx_EnumBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):             # <<<<<<<<<<<<<<
 *         for v in cls:
 *             if v == value:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_1__new__ = {"__new__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_1__new__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_value,&__pyx_n_s_name,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 28, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 28, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 3, 1); __PYX_ERR(2, 28, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 28, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__new__") < 0)) __PYX_ERR(2, 28, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_value = values[1];
    __pyx_v_name = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 3, __pyx_nargs); __PYX_ERR(2, 28, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(__pyx_self, __pyx_v_cls, __pyx_v_value, __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8EnumBase_14__Pyx_EnumBase___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__new__", 1);

  /* "EnumBase":29
 * class __Pyx_EnumBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):
 *         for v in cls:             # <<<<<<<<<<<<<<
 *             if v == value:
 *                 return v
 */
  if (likely(PyList_CheckExact(__pyx_v_cls)) || PyTuple_CheckExact(__pyx_v_cls)) {
    __pyx_t_1 = __pyx_v_cls; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 29, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 29, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 29, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(2, 29, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 29, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 29, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(2, 29, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 29, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      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(2, 29, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "EnumBase":30
 *     def __new__(cls, value, name=None):
 *         for v in cls:
 *             if v == value:             # <<<<<<<<<<<<<<
 *                 return v
 *         if name is None:
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_v, __pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 30, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 30, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_5) {

      /* "EnumBase":31
 *         for v in cls:
 *             if v == value:
 *                 return v             # <<<<<<<<<<<<<<
 *         if name is None:
 *             raise ValueError("Unknown enum value: '%s'" % value)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_v);
      __pyx_r = __pyx_v_v;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "EnumBase":30
 *     def __new__(cls, value, name=None):
 *         for v in cls:
 *             if v == value:             # <<<<<<<<<<<<<<
 *                 return v
 *         if name is None:
 */
    }

    /* "EnumBase":29
 * class __Pyx_EnumBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):
 *         for v in cls:             # <<<<<<<<<<<<<<
 *             if v == value:
 *                 return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "EnumBase":32
 *             if v == value:
 *                 return v
 *         if name is None:             # <<<<<<<<<<<<<<
 *             raise ValueError("Unknown enum value: '%s'" % value)
 *         res = int.__new__(cls, value)
 */
  __pyx_t_5 = (__pyx_v_name == Py_None);
  if (unlikely(__pyx_t_5)) {

    /* "EnumBase":33
 *                 return v
 *         if name is None:
 *             raise ValueError("Unknown enum value: '%s'" % value)             # <<<<<<<<<<<<<<
 *         res = int.__new__(cls, value)
 *         res.name = name
 */
    __pyx_t_1 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Unknown_enum_value_s, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 33, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(2, 33, __pyx_L1_error)

    /* "EnumBase":32
 *             if v == value:
 *                 return v
 *         if name is None:             # <<<<<<<<<<<<<<
 *             raise ValueError("Unknown enum value: '%s'" % value)
 *         res = int.__new__(cls, value)
 */
  }

  /* "EnumBase":34
 *         if name is None:
 *             raise ValueError("Unknown enum value: '%s'" % value)
 *         res = int.__new__(cls, value)             # <<<<<<<<<<<<<<
 *         res.name = name
 *         setattr(cls, name, res)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_cls, __pyx_v_value};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_v_res = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "EnumBase":35
 *             raise ValueError("Unknown enum value: '%s'" % value)
 *         res = int.__new__(cls, value)
 *         res.name = name             # <<<<<<<<<<<<<<
 *         setattr(cls, name, res)
 *         cls.__members__[name] = res
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_res, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(2, 35, __pyx_L1_error)

  /* "EnumBase":36
 *         res = int.__new__(cls, value)
 *         res.name = name
 *         setattr(cls, name, res)             # <<<<<<<<<<<<<<
 *         cls.__members__[name] = res
 *         return res
 */
  __pyx_t_8 = PyObject_SetAttr(__pyx_v_cls, __pyx_v_name, __pyx_v_res); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 36, __pyx_L1_error)

  /* "EnumBase":37
 *         res.name = name
 *         setattr(cls, name, res)
 *         cls.__members__[name] = res             # <<<<<<<<<<<<<<
 *         return res
 *     def __repr__(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_members); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely((PyObject_SetItem(__pyx_t_4, __pyx_v_name, __pyx_v_res) < 0))) __PYX_ERR(2, 37, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "EnumBase":38
 *         setattr(cls, name, res)
 *         cls.__members__[name] = res
 *         return res             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "EnumBase":28
 * cdef object __Pyx_EnumBase
 * class __Pyx_EnumBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):             # <<<<<<<<<<<<<<
 *         for v in cls:
 *             if v == value:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "EnumBase":39
 *         cls.__members__[name] = res
 *         return res
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_3__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 39, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(2, 39, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 39, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase_2__repr__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "EnumBase":40
 *         return res
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(2, 40, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 40, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self)) __PYX_ERR(2, 40, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_d, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "EnumBase":39
 *         cls.__members__[name] = res
 *         return res
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 */

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

/* "EnumBase":41
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_EnumBase_5__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_14__Pyx_EnumBase_5__str__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 41, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(2, 41, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 41, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__Pyx_EnumBase.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_EnumBase_4__str__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "EnumBase":42
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 *         return "%s.%s" % (self.__class__.__name__, self.name)             # <<<<<<<<<<<<<<
 * 
 * if PY_VERSION_HEX >= 0x03040000:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 42, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "EnumBase":41
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 */

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

/* "EnumBase":49
 * cdef object __Pyx_FlagBase
 * class __Pyx_FlagBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):             # <<<<<<<<<<<<<<
 *         for v in cls:
 *             if v == value:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_FlagBase_1__new__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_FlagBase_1__new__ = {"__new__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_FlagBase_1__new__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_14__Pyx_FlagBase_1__new__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_value,&__pyx_n_s_name,0};
    values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cls)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 49, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 49, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 3, 1); __PYX_ERR(2, 49, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name);
          if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 49, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__new__") < 0)) __PYX_ERR(2, 49, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_cls = values[0];
    __pyx_v_value = values[1];
    __pyx_v_name = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__new__", 0, 2, 3, __pyx_nargs); __PYX_ERR(2, 49, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__Pyx_FlagBase.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_FlagBase___new__(__pyx_self, __pyx_v_cls, __pyx_v_value, __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8EnumBase_14__Pyx_FlagBase___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_value, PyObject *__pyx_v_name) {
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__new__", 1);

  /* "EnumBase":50
 * class __Pyx_FlagBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):
 *         for v in cls:             # <<<<<<<<<<<<<<
 *             if v == value:
 *                 return v
 */
  if (likely(PyList_CheckExact(__pyx_v_cls)) || PyTuple_CheckExact(__pyx_v_cls)) {
    __pyx_t_1 = __pyx_v_cls; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_cls); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 50, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 50, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(2, 50, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 50, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 50, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(2, 50, __pyx_L1_error)
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 50, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      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(2, 50, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "EnumBase":51
 *     def __new__(cls, value, name=None):
 *         for v in cls:
 *             if v == value:             # <<<<<<<<<<<<<<
 *                 return v
 *         res = int.__new__(cls, value)
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_v, __pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 51, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(2, 51, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_5) {

      /* "EnumBase":52
 *         for v in cls:
 *             if v == value:
 *                 return v             # <<<<<<<<<<<<<<
 *         res = int.__new__(cls, value)
 *         if name is None:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_v);
      __pyx_r = __pyx_v_v;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;

      /* "EnumBase":51
 *     def __new__(cls, value, name=None):
 *         for v in cls:
 *             if v == value:             # <<<<<<<<<<<<<<
 *                 return v
 *         res = int.__new__(cls, value)
 */
    }

    /* "EnumBase":50
 * class __Pyx_FlagBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):
 *         for v in cls:             # <<<<<<<<<<<<<<
 *             if v == value:
 *                 return v
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "EnumBase":53
 *             if v == value:
 *                 return v
 *         res = int.__new__(cls, value)             # <<<<<<<<<<<<<<
 *         if name is None:
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_new); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_cls, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "EnumBase":54
 *                 return v
 *         res = int.__new__(cls, value)
 *         if name is None:             # <<<<<<<<<<<<<<
 * 
 *             res.name = ""
 */
  __pyx_t_5 = (__pyx_v_name == Py_None);
  if (__pyx_t_5) {

    /* "EnumBase":56
 *         if name is None:
 * 
 *             res.name = ""             # <<<<<<<<<<<<<<
 *         else:
 *             res.name = name
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_res, __pyx_n_s_name, __pyx_kp_s_) < 0) __PYX_ERR(2, 56, __pyx_L1_error)

    /* "EnumBase":54
 *                 return v
 *         res = int.__new__(cls, value)
 *         if name is None:             # <<<<<<<<<<<<<<
 * 
 *             res.name = ""
 */
    goto __pyx_L7;
  }

  /* "EnumBase":58
 *             res.name = ""
 *         else:
 *             res.name = name             # <<<<<<<<<<<<<<
 *             setattr(cls, name, res)
 *             cls.__members__[name] = res
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_res, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(2, 58, __pyx_L1_error)

    /* "EnumBase":59
 *         else:
 *             res.name = name
 *             setattr(cls, name, res)             # <<<<<<<<<<<<<<
 *             cls.__members__[name] = res
 *         return res
 */
    __pyx_t_8 = PyObject_SetAttr(__pyx_v_cls, __pyx_v_name, __pyx_v_res); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 59, __pyx_L1_error)

    /* "EnumBase":60
 *             res.name = name
 *             setattr(cls, name, res)
 *             cls.__members__[name] = res             # <<<<<<<<<<<<<<
 *         return res
 *     def __repr__(self):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_members); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_name, __pyx_v_res) < 0))) __PYX_ERR(2, 60, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L7:;

  /* "EnumBase":61
 *             setattr(cls, name, res)
 *             cls.__members__[name] = res
 *         return res             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "EnumBase":49
 * cdef object __Pyx_FlagBase
 * class __Pyx_FlagBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):             # <<<<<<<<<<<<<<
 *         for v in cls:
 *             if v == value:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("EnumBase.__Pyx_FlagBase.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "EnumBase":62
 *             cls.__members__[name] = res
 *         return res
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_FlagBase_3__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_FlagBase_3__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_FlagBase_3__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_14__Pyx_FlagBase_3__repr__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 62, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(2, 62, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 62, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__Pyx_FlagBase.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_FlagBase_2__repr__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "EnumBase":63
 *         return res
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)             # <<<<<<<<<<<<<<
 *     def __str__(self):
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(2, 63, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 63, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self)) __PYX_ERR(2, 63, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_d, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "EnumBase":62
 *             cls.__members__[name] = res
 *         return res
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 */

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

/* "EnumBase":64
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_14__Pyx_FlagBase_5__str__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_14__Pyx_FlagBase_5__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_FlagBase_5__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_14__Pyx_FlagBase_5__str__(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_self = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 64, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(2, 64, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 64, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__Pyx_FlagBase.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase_14__Pyx_FlagBase_4__str__(__pyx_self, __pyx_v_self);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

  /* "EnumBase":65
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 *         return "%s.%s" % (self.__class__.__name__, self.name)             # <<<<<<<<<<<<<<
 * 
 * if PY_VERSION_HEX >= 0x03060000:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(2, 65, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "EnumBase":64
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 */

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

/* "(tree fragment)":1
 * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta = {"__pyx_unpickle___Pyx_EnumMeta", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle___Pyx_EnumMeta") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle___Pyx_EnumMeta", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8EnumBase___pyx_unpickle___Pyx_EnumMeta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__2, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype___Pyx_EnumMeta), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_unpickle___Pyx_EnumMeta__set_state(((struct __pyx_obj___Pyx_EnumMeta *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 *     __pyx_result = __Pyx_EnumMeta.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

static PyObject *__pyx_unpickle___Pyx_EnumMeta__set_state(struct __pyx_obj___Pyx_EnumMeta *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t __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;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle___Pyx_EnumMeta__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 > 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "(tree fragment)":13
 * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 13, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state):
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle___Pyx_EnumMeta__set_state(<__Pyx_EnumMeta> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle___Pyx_EnumMeta__set_state(__Pyx_EnumMeta __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[0])
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("EnumBase.__pyx_unpickle___Pyx_EnumMeta__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":131
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

/* Python wrapper */
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shape = 0;
  Py_ssize_t __pyx_v_itemsize;
  PyObject *__pyx_v_format = 0;
  PyObject *__pyx_v_mode = 0;
  int __pyx_v_allocate_buffer;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
    values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 131, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 131, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 131, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
          if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 131, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
          if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 131, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(2, 131, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_shape = ((PyObject*)values[0]);
    __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 131, __pyx_L3_error)
    __pyx_v_format = values[2];
    __pyx_v_mode = values[3];
    if (values[4]) {
      __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 132, __pyx_L3_error)
    } else {

      /* "View.MemoryView":132
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
 *                   mode="c", bint allocate_buffer=True):             # <<<<<<<<<<<<<<
 * 
 *         cdef int idx
 */
      __pyx_v_allocate_buffer = ((int)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(2, 131, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 131, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 131, __pyx_L1_error)
  }
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);

  /* "View.MemoryView":131
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_v_dim;
  char __pyx_v_order;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __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;
  unsigned int __pyx_t_7;
  char *__pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_UCS4 __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_format);

  /* "View.MemoryView":137
 *         cdef Py_ssize_t dim
 * 
 *         self.ndim = <int> len(shape)             # <<<<<<<<<<<<<<
 *         self.itemsize = itemsize
 * 
 */
  if (unlikely(__pyx_v_shape == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 137, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 137, __pyx_L1_error)
  __pyx_v_self->ndim = ((int)__pyx_t_1);

  /* "View.MemoryView":138
 * 
 *         self.ndim = <int> len(shape)
 *         self.itemsize = itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not self.ndim:
 */
  __pyx_v_self->itemsize = __pyx_v_itemsize;

  /* "View.MemoryView":140
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 */
  __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":141
 * 
 *         if not self.ndim:
 *             raise ValueError, "Empty shape tuple for cython.array"             # <<<<<<<<<<<<<<
 * 
 *         if itemsize <= 0:
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
    __PYX_ERR(2, 141, __pyx_L1_error)

    /* "View.MemoryView":140
 *         self.itemsize = itemsize
 * 
 *         if not self.ndim:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 */
  }

  /* "View.MemoryView":143
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
 */
  __pyx_t_2 = (__pyx_v_itemsize <= 0);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":144
 * 
 *         if itemsize <= 0:
 *             raise ValueError, "itemsize <= 0 for cython.array"             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(format, bytes):
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
    __PYX_ERR(2, 144, __pyx_L1_error)

    /* "View.MemoryView":143
 *             raise ValueError, "Empty shape tuple for cython.array"
 * 
 *         if itemsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
 */
  }

  /* "View.MemoryView":146
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 */
  __pyx_t_2 = PyBytes_Check(__pyx_v_format); 
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "View.MemoryView":147
 * 
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')             # <<<<<<<<<<<<<<
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "View.MemoryView":146
 *             raise ValueError, "itemsize <= 0 for cython.array"
 * 
 *         if not isinstance(format, bytes):             # <<<<<<<<<<<<<<
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 */
  }

  /* "View.MemoryView":148
 *         if not isinstance(format, bytes):
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string             # <<<<<<<<<<<<<<
 *         self.format = self._format
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(2, 148, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_format;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->_format);
  __Pyx_DECREF(__pyx_v_self->_format);
  __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":149
 *             format = format.encode('ASCII')
 *         self._format = format  # keep a reference to the byte string
 *         self.format = self._format             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(__pyx_v_self->_format == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
    __PYX_ERR(2, 149, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error)
  __pyx_v_self->format = __pyx_t_8;

  /* "View.MemoryView":152
 * 
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)             # <<<<<<<<<<<<<<
 *         self._strides = self._shape + self.ndim
 * 
 */
  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));

  /* "View.MemoryView":153
 * 
 *         self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
 *         self._strides = self._shape + self.ndim             # <<<<<<<<<<<<<<
 * 
 *         if not self._shape:
 */
  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);

  /* "View.MemoryView":155
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError, "unable to allocate shape and strides."
 * 
 */
  __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
  if (unlikely(__pyx_t_3)) {

    /* "View.MemoryView":156
 * 
 *         if not self._shape:
 *             raise MemoryError, "unable to allocate shape and strides."             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
    __PYX_ERR(2, 156, __pyx_L1_error)

    /* "View.MemoryView":155
 *         self._strides = self._shape + self.ndim
 * 
 *         if not self._shape:             # <<<<<<<<<<<<<<
 *             raise MemoryError, "unable to allocate shape and strides."
 * 
 */
  }

  /* "View.MemoryView":159
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 */
  __pyx_t_9 = 0;
  __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
  __pyx_t_1 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 159, __pyx_L1_error)
      #endif
      if (__pyx_t_1 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(2, 159, __pyx_L1_error)
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 159, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_10;
    __pyx_v_idx = __pyx_t_9;
    __pyx_t_9 = (__pyx_t_9 + 1);

    /* "View.MemoryView":160
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim
 */
    __pyx_t_3 = (__pyx_v_dim <= 0);
    if (unlikely(__pyx_t_3)) {

      /* "View.MemoryView":161
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."             # <<<<<<<<<<<<<<
 *             self._shape[idx] = dim
 * 
 */
      __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = 0;
      __pyx_t_11 = 127;
      __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
      __pyx_t_10 += 22;
      __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
      __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__4);
      __pyx_t_10 += 2;
      __Pyx_GIVEREF(__pyx_kp_u__4);
      PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__4);
      __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_INCREF(__pyx_kp_u__3);
      __pyx_t_10 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__3);
      PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__3);
      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __PYX_ERR(2, 161, __pyx_L1_error)

      /* "View.MemoryView":160
 * 
 *         for idx, dim in enumerate(shape):
 *             if dim <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim
 */
    }

    /* "View.MemoryView":162
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 *             self._shape[idx] = dim             # <<<<<<<<<<<<<<
 * 
 *         cdef char order
 */
    (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;

    /* "View.MemoryView":159
 * 
 * 
 *         for idx, dim in enumerate(shape):             # <<<<<<<<<<<<<<
 *             if dim <= 0:
 *                 raise ValueError, f"Invalid shape in axis {idx}: {dim}."
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "View.MemoryView":165
 * 
 *         cdef char order
 *         if mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
 */
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 165, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "View.MemoryView":166
 *         cdef char order
 *         if mode == 'c':
 *             order = b'C'             # <<<<<<<<<<<<<<
 *             self.mode = u'c'
 *         elif mode == 'fortran':
 */
    __pyx_v_order = 'C';

    /* "View.MemoryView":167
 *         if mode == 'c':
 *             order = b'C'
 *             self.mode = u'c'             # <<<<<<<<<<<<<<
 *         elif mode == 'fortran':
 *             order = b'F'
 */
    __Pyx_INCREF(__pyx_n_u_c);
    __Pyx_GIVEREF(__pyx_n_u_c);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_n_u_c;

    /* "View.MemoryView":165
 * 
 *         cdef char order
 *         if mode == 'c':             # <<<<<<<<<<<<<<
 *             order = b'C'
 *             self.mode = u'c'
 */
    goto __pyx_L11;
  }

  /* "View.MemoryView":168
 *             order = b'C'
 *             self.mode = u'c'
 *         elif mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
 */
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(2, 168, __pyx_L1_error)
  if (likely(__pyx_t_3)) {

    /* "View.MemoryView":169
 *             self.mode = u'c'
 *         elif mode == 'fortran':
 *             order = b'F'             # <<<<<<<<<<<<<<
 *             self.mode = u'fortran'
 *         else:
 */
    __pyx_v_order = 'F';

    /* "View.MemoryView":170
 *         elif mode == 'fortran':
 *             order = b'F'
 *             self.mode = u'fortran'             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
 */
    __Pyx_INCREF(__pyx_n_u_fortran);
    __Pyx_GIVEREF(__pyx_n_u_fortran);
    __Pyx_GOTREF(__pyx_v_self->mode);
    __Pyx_DECREF(__pyx_v_self->mode);
    __pyx_v_self->mode = __pyx_n_u_fortran;

    /* "View.MemoryView":168
 *             order = b'C'
 *             self.mode = u'c'
 *         elif mode == 'fortran':             # <<<<<<<<<<<<<<
 *             order = b'F'
 *             self.mode = u'fortran'
 */
    goto __pyx_L11;
  }

  /* "View.MemoryView":172
 *             self.mode = u'fortran'
 *         else:
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"             # <<<<<<<<<<<<<<
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(2, 172, __pyx_L1_error)
  }
  __pyx_L11:;

  /* "View.MemoryView":174
 *             raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
 * 
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)             # <<<<<<<<<<<<<<
 * 
 *         self.free_data = allocate_buffer
 */
  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);

  /* "View.MemoryView":176
 *         self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
 * 
 *         self.free_data = allocate_buffer             # <<<<<<<<<<<<<<
 *         self.dtype_is_object = format == b'O'
 * 
 */
  __pyx_v_self->free_data = __pyx_v_allocate_buffer;

  /* "View.MemoryView":177
 * 
 *         self.free_data = allocate_buffer
 *         self.dtype_is_object = format == b'O'             # <<<<<<<<<<<<<<
 * 
 *         if allocate_buffer:
 */
  __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 177, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 177, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_self->dtype_is_object = __pyx_t_3;

  /* "View.MemoryView":179
 *         self.dtype_is_object = format == b'O'
 * 
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             _allocate_buffer(self)
 * 
 */
  if (__pyx_v_allocate_buffer) {

    /* "View.MemoryView":180
 * 
 *         if allocate_buffer:
 *             _allocate_buffer(self)             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 180, __pyx_L1_error)

    /* "View.MemoryView":179
 *         self.dtype_is_object = format == b'O'
 * 
 *         if allocate_buffer:             # <<<<<<<<<<<<<<
 *             _allocate_buffer(self)
 * 
 */
  }

  /* "View.MemoryView":131
 *         cdef bint dtype_is_object
 * 
 *     def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,             # <<<<<<<<<<<<<<
 *                   mode="c", bint allocate_buffer=True):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":182
 *             _allocate_buffer(self)
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 */

/* Python wrapper */
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_bufmode;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  char *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (unlikely(__pyx_v_info == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "View.MemoryView":184
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1             # <<<<<<<<<<<<<<
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":
 */
  __pyx_v_bufmode = -1;

  /* "View.MemoryView":185
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):             # <<<<<<<<<<<<<<
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
  __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":186
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
 */
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 186, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":187
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
      __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

      /* "View.MemoryView":186
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
 *             if self.mode == u"c":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
 */
      goto __pyx_L4;
    }

    /* "View.MemoryView":188
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
 */
    __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 188, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "View.MemoryView":189
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS             # <<<<<<<<<<<<<<
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 */
      __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);

      /* "View.MemoryView":188
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             elif self.mode == u"fortran":             # <<<<<<<<<<<<<<
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
 */
    }
    __pyx_L4:;

    /* "View.MemoryView":190
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
 */
    __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
    if (unlikely(__pyx_t_1)) {

      /* "View.MemoryView":191
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."             # <<<<<<<<<<<<<<
 *         info.buf = self.data
 *         info.len = self.len
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
      __PYX_ERR(2, 191, __pyx_L1_error)

      /* "View.MemoryView":190
 *             elif self.mode == u"fortran":
 *                 bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 *             if not (flags & bufmode):             # <<<<<<<<<<<<<<
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
 */
    }

    /* "View.MemoryView":185
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 *         if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):             # <<<<<<<<<<<<<<
 *             if self.mode == u"c":
 *                 bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
 */
  }

  /* "View.MemoryView":192
 *             if not (flags & bufmode):
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data             # <<<<<<<<<<<<<<
 *         info.len = self.len
 * 
 */
  __pyx_t_2 = __pyx_v_self->data;
  __pyx_v_info->buf = __pyx_t_2;

  /* "View.MemoryView":193
 *                 raise ValueError, "Can only create a buffer that is contiguous in memory."
 *         info.buf = self.data
 *         info.len = self.len             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
 */
  __pyx_t_3 = __pyx_v_self->len;
  __pyx_v_info->len = __pyx_t_3;

  /* "View.MemoryView":195
 *         info.len = self.len
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.ndim = self.ndim
 *             info.shape = self._shape
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":196
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.ndim = self.ndim             # <<<<<<<<<<<<<<
 *             info.shape = self._shape
 *             info.strides = self._strides
 */
    __pyx_t_4 = __pyx_v_self->ndim;
    __pyx_v_info->ndim = __pyx_t_4;

    /* "View.MemoryView":197
 *         if flags & PyBUF_STRIDES:
 *             info.ndim = self.ndim
 *             info.shape = self._shape             # <<<<<<<<<<<<<<
 *             info.strides = self._strides
 *         else:
 */
    __pyx_t_5 = __pyx_v_self->_shape;
    __pyx_v_info->shape = __pyx_t_5;

    /* "View.MemoryView":198
 *             info.ndim = self.ndim
 *             info.shape = self._shape
 *             info.strides = self._strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.ndim = 1
 */
    __pyx_t_5 = __pyx_v_self->_strides;
    __pyx_v_info->strides = __pyx_t_5;

    /* "View.MemoryView":195
 *         info.len = self.len
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.ndim = self.ndim
 *             info.shape = self._shape
 */
    goto __pyx_L6;
  }

  /* "View.MemoryView":200
 *             info.strides = self._strides
 *         else:
 *             info.ndim = 1             # <<<<<<<<<<<<<<
 *             info.shape = &self.len if flags & PyBUF_ND else NULL
 *             info.strides = NULL
 */
  /*else*/ {
    __pyx_v_info->ndim = 1;

    /* "View.MemoryView":201
 *         else:
 *             info.ndim = 1
 *             info.shape = &self.len if flags & PyBUF_ND else NULL             # <<<<<<<<<<<<<<
 *             info.strides = NULL
 * 
 */
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
    if (__pyx_t_1) {
      __pyx_t_5 = (&__pyx_v_self->len);
    } else {
      __pyx_t_5 = NULL;
    }
    __pyx_v_info->shape = __pyx_t_5;

    /* "View.MemoryView":202
 *             info.ndim = 1
 *             info.shape = &self.len if flags & PyBUF_ND else NULL
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.suboffsets = NULL
 */
    __pyx_v_info->strides = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":204
 *             info.strides = NULL
 * 
 *         info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
 */
  __pyx_v_info->suboffsets = NULL;

  /* "View.MemoryView":205
 * 
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize             # <<<<<<<<<<<<<<
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
 */
  __pyx_t_3 = __pyx_v_self->itemsize;
  __pyx_v_info->itemsize = __pyx_t_3;

  /* "View.MemoryView":206
 *         info.suboffsets = NULL
 *         info.itemsize = self.itemsize
 *         info.readonly = 0             # <<<<<<<<<<<<<<
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
 *         info.obj = self
 */
  __pyx_v_info->readonly = 0;

  /* "View.MemoryView":207
 *         info.itemsize = self.itemsize
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = __pyx_v_self->format;
  } else {
    __pyx_t_2 = NULL;
  }
  __pyx_v_info->format = __pyx_t_2;

  /* "View.MemoryView":208
 *         info.readonly = 0
 *         info.format = self.format if flags & PyBUF_FORMAT else NULL
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(array self):
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":182
 *             _allocate_buffer(self)
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         cdef int bufmode = -1
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":210
 *         info.obj = self
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

/* Python wrapper */
static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));

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

static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":211
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
 */
  __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":212
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)             # <<<<<<<<<<<<<<
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:
 */
    __pyx_v_self->callback_free_data(__pyx_v_self->data);

    /* "View.MemoryView":211
 * 
 *     def __dealloc__(array self):
 *         if self.callback_free_data != NULL:             # <<<<<<<<<<<<<<
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":213
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 */
  if (__pyx_v_self->free_data) {
  } else {
    __pyx_t_1 = __pyx_v_self->free_data;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_self->data != NULL);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "View.MemoryView":214
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
 */
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":215
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)             # <<<<<<<<<<<<<<
 *             free(self.data)
 *         PyObject_Free(self._shape)
 */
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);

      /* "View.MemoryView":214
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
 */
    }

    /* "View.MemoryView":216
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)             # <<<<<<<<<<<<<<
 *         PyObject_Free(self._shape)
 * 
 */
    free(__pyx_v_self->data);

    /* "View.MemoryView":213
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 *         elif self.free_data and self.data is not NULL:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":217
 *                 refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
 *             free(self.data)
 *         PyObject_Free(self._shape)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  PyObject_Free(__pyx_v_self->_shape);

  /* "View.MemoryView":210
 *         info.obj = self
 * 
 *     def __dealloc__(array self):             # <<<<<<<<<<<<<<
 *         if self.callback_free_data != NULL:
 *             self.callback_free_data(self.data)
 */

  /* function exit code */
}

/* "View.MemoryView":219
 *         PyObject_Free(self._shape)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def memview(self):
 *         return self.get_memview()
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":221
 *     @property
 *     def memview(self):
 *         return self.get_memview()             # <<<<<<<<<<<<<<
 * 
 *     @cname('get_memview')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":219
 *         PyObject_Free(self._shape)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def memview(self):
 *         return self.get_memview()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":224
 * 
 *     @cname('get_memview')
 *     cdef get_memview(self):             # <<<<<<<<<<<<<<
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)
 */

static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_memview", 1);

  /* "View.MemoryView":225
 *     @cname('get_memview')
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE             # <<<<<<<<<<<<<<
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 */
  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);

  /* "View.MemoryView":226
 *     cdef get_memview(self):
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(2, 226, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 226, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":224
 * 
 *     @cname('get_memview')
 *     cdef get_memview(self):             # <<<<<<<<<<<<<<
 *         flags =  PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
 *         return  memoryview(self, flags, self.dtype_is_object)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":228
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._shape[0]
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));

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

static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;

  /* "View.MemoryView":229
 * 
 *     def __len__(self):
 *         return self._shape[0]             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, attr):
 */
  __pyx_r = (__pyx_v_self->_shape[0]);
  goto __pyx_L0;

  /* "View.MemoryView":228
 *         return  memoryview(self, flags, self.dtype_is_object)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self._shape[0]
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":231
 *         return self._shape[0]
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));

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

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 1);

  /* "View.MemoryView":232
 * 
 *     def __getattr__(self, attr):
 *         return getattr(self.memview, attr)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":231
 *         return self._shape[0]
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return getattr(self.memview, attr)
 * 
 */

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

/* "View.MemoryView":234
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));

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

static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "View.MemoryView":235
 * 
 *     def __getitem__(self, item):
 *         return self.memview[item]             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, item, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":234
 *         return getattr(self.memview, attr)
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.memview[item]
 * 
 */

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

/* "View.MemoryView":237
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

/* Python wrapper */
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));

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

static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "View.MemoryView":238
 * 
 *     def __setitem__(self, item, value):
 *         self.memview[item] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(2, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":237
 *         return self.memview[item]
 * 
 *     def __setitem__(self, item, value):             # <<<<<<<<<<<<<<
 *         self.memview[item] = value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":248
 * 
 * @cname("__pyx_array_allocate_buffer")
 * cdef int _allocate_buffer(array self) except -1:             # <<<<<<<<<<<<<<
 * 
 * 
 */

static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
  Py_ssize_t __pyx_v_i;
  PyObject **__pyx_v_p;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":254
 *     cdef PyObject **p
 * 
 *     self.free_data = True             # <<<<<<<<<<<<<<
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:
 */
  __pyx_v_self->free_data = 1;

  /* "View.MemoryView":255
 * 
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)             # <<<<<<<<<<<<<<
 *     if not self.data:
 *         raise MemoryError, "unable to allocate array data."
 */
  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));

  /* "View.MemoryView":256
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:             # <<<<<<<<<<<<<<
 *         raise MemoryError, "unable to allocate array data."
 * 
 */
  __pyx_t_1 = (!(__pyx_v_self->data != 0));
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":257
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:
 *         raise MemoryError, "unable to allocate array data."             # <<<<<<<<<<<<<<
 * 
 *     if self.dtype_is_object:
 */
    __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
    __PYX_ERR(2, 257, __pyx_L1_error)

    /* "View.MemoryView":256
 *     self.free_data = True
 *     self.data = <char *>malloc(self.len)
 *     if not self.data:             # <<<<<<<<<<<<<<
 *         raise MemoryError, "unable to allocate array data."
 * 
 */
  }

  /* "View.MemoryView":259
 *         raise MemoryError, "unable to allocate array data."
 * 
 *     if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
 */
  if (__pyx_v_self->dtype_is_object) {

    /* "View.MemoryView":260
 * 
 *     if self.dtype_is_object:
 *         p = <PyObject **> self.data             # <<<<<<<<<<<<<<
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None
 */
    __pyx_v_p = ((PyObject **)__pyx_v_self->data);

    /* "View.MemoryView":261
 *     if self.dtype_is_object:
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):             # <<<<<<<<<<<<<<
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)
 */
    if (unlikely(__pyx_v_self->itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(2, 261, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(2, 261, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":262
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None             # <<<<<<<<<<<<<<
 *             Py_INCREF(Py_None)
 *     return 0
 */
      (__pyx_v_p[__pyx_v_i]) = Py_None;

      /* "View.MemoryView":263
 *         for i in range(self.len // self.itemsize):
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
      Py_INCREF(Py_None);
    }

    /* "View.MemoryView":259
 *         raise MemoryError, "unable to allocate array data."
 * 
 *     if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *         p = <PyObject **> self.data
 *         for i in range(self.len // self.itemsize):
 */
  }

  /* "View.MemoryView":264
 *             p[i] = Py_None
 *             Py_INCREF(Py_None)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":248
 * 
 * @cname("__pyx_array_allocate_buffer")
 * cdef int _allocate_buffer(array self) except -1:             # <<<<<<<<<<<<<<
 * 
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":268
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):             # <<<<<<<<<<<<<<
 *     cdef array result
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.
 */

static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
  struct __pyx_array_obj *__pyx_v_result = 0;
  PyObject *__pyx_v_mode = 0;
  struct __pyx_array_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("array_cwrapper", 1);

  /* "View.MemoryView":270
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
 *     cdef array result
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.             # <<<<<<<<<<<<<<
 * 
 *     if buf is NULL:
 */
  __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
  if (__pyx_t_2) {
    __Pyx_INCREF(__pyx_n_s_fortran);
    __pyx_t_1 = __pyx_n_s_fortran;
  } else {
    __Pyx_INCREF(__pyx_n_s_c);
    __pyx_t_1 = __pyx_n_s_c;
  }
  __pyx_v_mode = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":272
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.
 * 
 *     if buf is NULL:             # <<<<<<<<<<<<<<
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
 */
  __pyx_t_2 = (__pyx_v_buf == NULL);
  if (__pyx_t_2) {

    /* "View.MemoryView":273
 * 
 *     if buf is NULL:
 *         result = array.__new__(array, shape, itemsize, format, mode)             # <<<<<<<<<<<<<<
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
 */
    __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(2, 273, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(2, 273, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(2, 273, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(2, 273, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 273, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":272
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.
 * 
 *     if buf is NULL:             # <<<<<<<<<<<<<<
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":275
 *         result = array.__new__(array, shape, itemsize, format, mode)
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)             # <<<<<<<<<<<<<<
 *         result.data = buf
 * 
 */
  /*else*/ {
    __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_shape);
    __Pyx_GIVEREF(__pyx_v_shape);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(2, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(2, 275, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(2, 275, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_mode);
    __Pyx_GIVEREF(__pyx_v_mode);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(2, 275, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 275, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 275, __pyx_L1_error)
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 275, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":276
 *     else:
 *         result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
 *         result.data = buf             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
    __pyx_v_result->data = __pyx_v_buf;
  }
  __pyx_L3:;

  /* "View.MemoryView":278
 *         result.data = buf
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":268
 * 
 * @cname("__pyx_array_new")
 * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):             # <<<<<<<<<<<<<<
 *     cdef array result
 *     cdef str mode = "fortran" if c_mode[0] == b'f' else "c"  # this often comes from a constant C string.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_mode);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":304
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

/* Python wrapper */
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 304, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(2, 304, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 304, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "View.MemoryView":305
 *     cdef object name
 *     def __init__(self, name):
 *         self.name = name             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return self.name
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "View.MemoryView":304
 * cdef class Enum(object):
 *     cdef object name
 *     def __init__(self, name):             # <<<<<<<<<<<<<<
 *         self.name = name
 *     def __repr__(self):
 */

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

/* "View.MemoryView":306
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

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

static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 1);

  /* "View.MemoryView":307
 *         self.name = name
 *     def __repr__(self):
 *         return self.name             # <<<<<<<<<<<<<<
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* "View.MemoryView":306
 *     def __init__(self, name):
 *         self.name = name
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.name
 * 
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.name,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->name);
  __Pyx_GIVEREF(__pyx_v_self->name);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(2, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.name is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.name,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.name is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_self->name != Py_None);
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.name is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_136983863);
    __Pyx_GIVEREF(__pyx_int_136983863);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.name is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_136983863);
    __Pyx_GIVEREF(__pyx_int_136983863);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Enum__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":349
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */

/* Python wrapper */
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_obj = 0;
  int __pyx_v_flags;
  int __pyx_v_dtype_is_object;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 349, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 349, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 349, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
          if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 349, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(2, 349, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_obj = values[0];
    __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 349, __pyx_L3_error)
    if (values[2]) {
      __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 349, __pyx_L3_error)
    } else {
      __pyx_v_dtype_is_object = ((int)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(2, 349, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_intptr_t __pyx_t_4;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "View.MemoryView":350
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj             # <<<<<<<<<<<<<<
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 */
  __Pyx_INCREF(__pyx_v_obj);
  __Pyx_GIVEREF(__pyx_v_obj);
  __Pyx_GOTREF(__pyx_v_self->obj);
  __Pyx_DECREF(__pyx_v_self->obj);
  __pyx_v_self->obj = __pyx_v_obj;

  /* "View.MemoryView":351
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
 *         self.obj = obj
 *         self.flags = flags             # <<<<<<<<<<<<<<
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 */
  __pyx_v_self->flags = __pyx_v_flags;

  /* "View.MemoryView":352
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_obj != Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "View.MemoryView":353
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)             # <<<<<<<<<<<<<<
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 */
    __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 353, __pyx_L1_error)

    /* "View.MemoryView":354
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
 */
    __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
    if (__pyx_t_1) {

      /* "View.MemoryView":355
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None             # <<<<<<<<<<<<<<
 *                 Py_INCREF(Py_None)
 * 
 */
      ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;

      /* "View.MemoryView":356
 *             if <PyObject *> self.view.obj == NULL:
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 */
      Py_INCREF(Py_None);

      /* "View.MemoryView":354
 *         if type(self) is memoryview or obj is not None:
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:             # <<<<<<<<<<<<<<
 *                 (<__pyx_buffer *> &self.view).obj = Py_None
 *                 Py_INCREF(Py_None)
 */
    }

    /* "View.MemoryView":352
 *         self.obj = obj
 *         self.flags = flags
 *         if type(self) is memoryview or obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_GetBuffer(obj, &self.view, flags)
 *             if <PyObject *> self.view.obj == NULL:
 */
  }

  /* "View.MemoryView":358
 *                 Py_INCREF(Py_None)
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():             # <<<<<<<<<<<<<<
 *             global __pyx_memoryview_thread_locks_used
 *             if __pyx_memoryview_thread_locks_used < 8:
 */
  __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
  if (__pyx_t_1) {

    /* "View.MemoryView":360
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if __pyx_memoryview_thread_locks_used < 8:             # <<<<<<<<<<<<<<
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
 */
    __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
    if (__pyx_t_1) {

      /* "View.MemoryView":361
 *             global __pyx_memoryview_thread_locks_used
 *             if __pyx_memoryview_thread_locks_used < 8:
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]             # <<<<<<<<<<<<<<
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:
 */
      __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);

      /* "View.MemoryView":362
 *             if __pyx_memoryview_thread_locks_used < 8:
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1             # <<<<<<<<<<<<<<
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
 */
      __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);

      /* "View.MemoryView":360
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():
 *             global __pyx_memoryview_thread_locks_used
 *             if __pyx_memoryview_thread_locks_used < 8:             # <<<<<<<<<<<<<<
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
 */
    }

    /* "View.MemoryView":363
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
 */
    __pyx_t_1 = (__pyx_v_self->lock == NULL);
    if (__pyx_t_1) {

      /* "View.MemoryView":364
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()             # <<<<<<<<<<<<<<
 *                 if self.lock is NULL:
 *                     raise MemoryError
 */
      __pyx_v_self->lock = PyThread_allocate_lock();

      /* "View.MemoryView":365
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                     raise MemoryError
 * 
 */
      __pyx_t_1 = (__pyx_v_self->lock == NULL);
      if (unlikely(__pyx_t_1)) {

        /* "View.MemoryView":366
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
 *                     raise MemoryError             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
        PyErr_NoMemory(); __PYX_ERR(2, 366, __pyx_L1_error)

        /* "View.MemoryView":365
 *             if self.lock is NULL:
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                     raise MemoryError
 * 
 */
      }

      /* "View.MemoryView":363
 *                 self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
 *                 __pyx_memoryview_thread_locks_used += 1
 *             if self.lock is NULL:             # <<<<<<<<<<<<<<
 *                 self.lock = PyThread_allocate_lock()
 *                 if self.lock is NULL:
 */
    }

    /* "View.MemoryView":358
 *                 Py_INCREF(Py_None)
 * 
 *         if not __PYX_CYTHON_ATOMICS_ENABLED():             # <<<<<<<<<<<<<<
 *             global __pyx_memoryview_thread_locks_used
 *             if __pyx_memoryview_thread_locks_used < 8:
 */
  }

  /* "View.MemoryView":368
 *                     raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":369
 * 
 *         if flags & PyBUF_FORMAT:
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')             # <<<<<<<<<<<<<<
 *         else:
 *             self.dtype_is_object = dtype_is_object
 */
    __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L12_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
    __pyx_t_1 = __pyx_t_2;
    __pyx_L12_bool_binop_done:;
    __pyx_v_self->dtype_is_object = __pyx_t_1;

    /* "View.MemoryView":368
 *                     raise MemoryError
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 */
    goto __pyx_L11;
  }

  /* "View.MemoryView":371
 *             self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
 *         else:
 *             self.dtype_is_object = dtype_is_object             # <<<<<<<<<<<<<<
 * 
 *         assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
 */
  /*else*/ {
    __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
  }
  __pyx_L11:;

  /* "View.MemoryView":373
 *             self.dtype_is_object = dtype_is_object
 * 
 *         assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0             # <<<<<<<<<<<<<<
 *         self.typeinfo = NULL
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
    __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
    if (unlikely(__pyx_t_5 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(2, 373, __pyx_L1_error)
    }
    __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(2, 373, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(2, 373, __pyx_L1_error)
  #endif

  /* "View.MemoryView":374
 * 
 *         assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
 *         self.typeinfo = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(memoryview self):
 */
  __pyx_v_self->typeinfo = NULL;

  /* "View.MemoryView":349
 *     cdef __Pyx_TypeInfo *typeinfo
 * 
 *     def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):             # <<<<<<<<<<<<<<
 *         self.obj = obj
 *         self.flags = flags
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":376
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

/* Python wrapper */
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
  int __pyx_v_i;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyThread_type_lock __pyx_t_5;
  PyThread_type_lock __pyx_t_6;

  /* "View.MemoryView":377
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_ReleaseBuffer(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 */
  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":378
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)             # <<<<<<<<<<<<<<
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
 */
    __Pyx_ReleaseBuffer((&__pyx_v_self->view));

    /* "View.MemoryView":377
 * 
 *     def __dealloc__(memoryview self):
 *         if self.obj is not None:             # <<<<<<<<<<<<<<
 *             __Pyx_ReleaseBuffer(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":379
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 */
  __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":381
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL             # <<<<<<<<<<<<<<
 *             Py_DECREF(Py_None)
 * 
 */
    ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;

    /* "View.MemoryView":382
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 *             Py_DECREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *         cdef int i
 */
    Py_DECREF(Py_None);

    /* "View.MemoryView":379
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 *         elif (<__pyx_buffer *> &self.view).obj == Py_None:             # <<<<<<<<<<<<<<
 * 
 *             (<__pyx_buffer *> &self.view).obj = NULL
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":386
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 */
  __pyx_t_1 = (__pyx_v_self->lock != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":387
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):             # <<<<<<<<<<<<<<
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 */
    __pyx_t_2 = __pyx_memoryview_thread_locks_used;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":388
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 */
      __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
      if (__pyx_t_1) {

        /* "View.MemoryView":389
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1             # <<<<<<<<<<<<<<
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 */
        __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);

        /* "View.MemoryView":390
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 */
        __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
        if (__pyx_t_1) {

          /* "View.MemoryView":392
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])             # <<<<<<<<<<<<<<
 *                     break
 *             else:
 */
          __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
          __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);

          /* "View.MemoryView":391
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (             # <<<<<<<<<<<<<<
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break
 */
          (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
          (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;

          /* "View.MemoryView":390
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:             # <<<<<<<<<<<<<<
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 */
        }

        /* "View.MemoryView":393
 *                         __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
 *                             __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
 *                     break             # <<<<<<<<<<<<<<
 *             else:
 *                 PyThread_free_lock(self.lock)
 */
        goto __pyx_L6_break;

        /* "View.MemoryView":388
 *         if self.lock != NULL:
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:             # <<<<<<<<<<<<<<
 *                     __pyx_memoryview_thread_locks_used -= 1
 *                     if i != __pyx_memoryview_thread_locks_used:
 */
      }
    }
    /*else*/ {

      /* "View.MemoryView":395
 *                     break
 *             else:
 *                 PyThread_free_lock(self.lock)             # <<<<<<<<<<<<<<
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 */
      PyThread_free_lock(__pyx_v_self->lock);
    }
    __pyx_L6_break:;

    /* "View.MemoryView":386
 *         cdef int i
 *         global __pyx_memoryview_thread_locks_used
 *         if self.lock != NULL:             # <<<<<<<<<<<<<<
 *             for i in range(__pyx_memoryview_thread_locks_used):
 *                 if __pyx_memoryview_thread_locks[i] is self.lock:
 */
  }

  /* "View.MemoryView":376
 *         self.typeinfo = NULL
 * 
 *     def __dealloc__(memoryview self):             # <<<<<<<<<<<<<<
 *         if self.obj is not None:
 *             __Pyx_ReleaseBuffer(&self.view)
 */

  /* function exit code */
}

/* "View.MemoryView":397
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  Py_ssize_t __pyx_v_dim;
  char *__pyx_v_itemp;
  PyObject *__pyx_v_idx = NULL;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  char *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_item_pointer", 1);

  /* "View.MemoryView":399
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf             # <<<<<<<<<<<<<<
 * 
 *         for dim, idx in enumerate(index):
 */
  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);

  /* "View.MemoryView":401
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 */
  __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 401, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 401, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(2, 401, __pyx_L1_error)
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 401, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(2, 401, __pyx_L1_error)
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      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(2, 401, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_dim = __pyx_t_1;
    __pyx_t_1 = (__pyx_t_1 + 1);

    /* "View.MemoryView":402
 * 
 *         for dim, idx in enumerate(index):
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)             # <<<<<<<<<<<<<<
 * 
 *         return itemp
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 402, __pyx_L1_error)
    __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(2, 402, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_7;

    /* "View.MemoryView":401
 *         cdef char *itemp = <char *> self.view.buf
 * 
 *         for dim, idx in enumerate(index):             # <<<<<<<<<<<<<<
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":404
 *             itemp = pybuffer_index(&self.view, itemp, idx, dim)
 * 
 *         return itemp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_itemp;
  goto __pyx_L0;

  /* "View.MemoryView":397
 *                 PyThread_free_lock(self.lock)
 * 
 *     cdef char *get_item_pointer(memoryview self, object index) except NULL:             # <<<<<<<<<<<<<<
 *         cdef Py_ssize_t dim
 *         cdef char *itemp = <char *> self.view.buf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":407
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_indices = NULL;
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "View.MemoryView":408
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
  if (__pyx_t_1) {

    /* "View.MemoryView":409
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:
 *             return self             # <<<<<<<<<<<<<<
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_self);
    __pyx_r = ((PyObject *)__pyx_v_self);
    goto __pyx_L0;

    /* "View.MemoryView":408
 * 
 *     def __getitem__(memoryview self, object index):
 *         if index is Ellipsis:             # <<<<<<<<<<<<<<
 *             return self
 * 
 */
  }

  /* "View.MemoryView":411
 *             return self
 * 
 *         have_slices, indices = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         cdef char *itemp
 */
  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(__pyx_t_2 != Py_None)) {
    PyObject* sequence = __pyx_t_2;
    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(2, 411, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 411, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_indices = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "View.MemoryView":414
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 414, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "View.MemoryView":415
 *         cdef char *itemp
 *         if have_slices:
 *             return memview_slice(self, indices)             # <<<<<<<<<<<<<<
 *         else:
 *             itemp = self.get_item_pointer(indices)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":414
 * 
 *         cdef char *itemp
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             return memview_slice(self, indices)
 *         else:
 */
  }

  /* "View.MemoryView":417
 *             return memview_slice(self, indices)
 *         else:
 *             itemp = self.get_item_pointer(indices)             # <<<<<<<<<<<<<<
 *             return self.convert_item_to_object(itemp)
 * 
 */
  /*else*/ {
    __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(2, 417, __pyx_L1_error)
    __pyx_v_itemp = __pyx_t_5;

    /* "View.MemoryView":418
 *         else:
 *             itemp = self.get_item_pointer(indices)
 *             return self.convert_item_to_object(itemp)             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(memoryview self, object index, object value):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":407
 * 
 * 
 *     def __getitem__(memoryview self, object index):             # <<<<<<<<<<<<<<
 *         if index is Ellipsis:
 *             return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_indices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":420
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"
 */

/* Python wrapper */
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_have_slices = NULL;
  PyObject *__pyx_v_obj = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 0);
  __Pyx_INCREF(__pyx_v_index);

  /* "View.MemoryView":421
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
 */
  if (unlikely(__pyx_v_self->view.readonly)) {

    /* "View.MemoryView":422
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"             # <<<<<<<<<<<<<<
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 */
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
    __PYX_ERR(2, 422, __pyx_L1_error)

    /* "View.MemoryView":421
 * 
 *     def __setitem__(memoryview self, object index, object value):
 *         if self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
 */
  }

  /* "View.MemoryView":424
 *             raise TypeError, "Cannot assign to read-only memoryview"
 * 
 *         have_slices, index = _unellipsify(index, self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *         if have_slices:
 */
  __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(__pyx_t_1 != Py_None)) {
    PyObject* sequence = __pyx_t_1;
    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(2, 424, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 424, __pyx_L1_error)
  }
  __pyx_v_have_slices = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "View.MemoryView":426
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj is not None:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(2, 426, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "View.MemoryView":427
 * 
 *         if have_slices:
 *             obj = self.is_slice(value)             # <<<<<<<<<<<<<<
 *             if obj is not None:
 *                 self.setitem_slice_assignment(self[index], obj)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "View.MemoryView":428
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj is not None:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 */
    __pyx_t_4 = (__pyx_v_obj != Py_None);
    if (__pyx_t_4) {

      /* "View.MemoryView":429
 *             obj = self.is_slice(value)
 *             if obj is not None:
 *                 self.setitem_slice_assignment(self[index], obj)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)
 */
      __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "View.MemoryView":428
 *         if have_slices:
 *             obj = self.is_slice(value)
 *             if obj is not None:             # <<<<<<<<<<<<<<
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "View.MemoryView":431
 *                 self.setitem_slice_assignment(self[index], obj)
 *             else:
 *                 self.setitem_slice_assign_scalar(self[index], value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.setitem_indexed(index, value)
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 431, __pyx_L1_error)
      __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "View.MemoryView":426
 *         have_slices, index = _unellipsify(index, self.view.ndim)
 * 
 *         if have_slices:             # <<<<<<<<<<<<<<
 *             obj = self.is_slice(value)
 *             if obj is not None:
 */
    goto __pyx_L4;
  }

  /* "View.MemoryView":433
 *                 self.setitem_slice_assign_scalar(self[index], value)
 *         else:
 *             self.setitem_indexed(index, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef is_slice(self, obj):
 */
  /*else*/ {
    __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "View.MemoryView":420
 *             return self.convert_item_to_object(itemp)
 * 
 *     def __setitem__(memoryview self, object index, object value):             # <<<<<<<<<<<<<<
 *         if self.view.readonly:
 *             raise TypeError, "Cannot assign to read-only memoryview"
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_have_slices);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":435
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_slice", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "View.MemoryView":436
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type); 
  __pyx_t_2 = (!__pyx_t_1);
  if (__pyx_t_2) {

    /* "View.MemoryView":437
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "View.MemoryView":438
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 438, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "View.MemoryView":439
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)             # <<<<<<<<<<<<<<
 *             except TypeError:
 *                 return None
 */
        __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 439, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "View.MemoryView":438
 *         if not isinstance(obj, memoryview):
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,             # <<<<<<<<<<<<<<
 *                                  self.dtype_is_object)
 *             except TypeError:
 */
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 438, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_v_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(2, 438, __pyx_L4_error);
        __Pyx_GIVEREF(__pyx_t_6);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(2, 438, __pyx_L4_error);
        __Pyx_GIVEREF(__pyx_t_7);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(2, 438, __pyx_L4_error);
        __pyx_t_6 = 0;
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 438, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "View.MemoryView":437
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9_try_end;
      __pyx_L4_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "View.MemoryView":440
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 *             except TypeError:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_9) {
        __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 440, __pyx_L6_except_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);

        /* "View.MemoryView":441
 *                                  self.dtype_is_object)
 *             except TypeError:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         return obj
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_except_return;
      }
      goto __pyx_L6_except_error;

      /* "View.MemoryView":437
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 *                                  self.dtype_is_object)
 */
      __pyx_L6_except_error:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L7_except_return:;
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L0;
      __pyx_L9_try_end:;
    }

    /* "View.MemoryView":436
 * 
 *     cdef is_slice(self, obj):
 *         if not isinstance(obj, memoryview):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
 */
  }

  /* "View.MemoryView":443
 *                 return None
 * 
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assignment(self, dst, src):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "View.MemoryView":435
 *             self.setitem_indexed(index, value)
 * 
 *     cdef is_slice(self, obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, memoryview):
 *             try:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":445
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
  __Pyx_memviewslice __pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_src_slice;
  __Pyx_memviewslice __pyx_v_msrc;
  __Pyx_memviewslice __pyx_v_mdst;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assignment", 1);

  /* "View.MemoryView":448
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 *         cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
 * 
 */
  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 448, __pyx_L1_error)
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 448, __pyx_L1_error)
  __pyx_v_msrc = (__pyx_t_1[0]);

  /* "View.MemoryView":449
 *         cdef __Pyx_memviewslice src_slice
 *         cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]             # <<<<<<<<<<<<<<
 * 
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
 */
  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 449, __pyx_L1_error)
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 449, __pyx_L1_error)
  __pyx_v_mdst = (__pyx_t_1[0]);

  /* "View.MemoryView":451
 *         cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
 * 
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 451, __pyx_L1_error)

  /* "View.MemoryView":445
 *         return obj
 * 
 *     cdef setitem_slice_assignment(self, dst, src):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice dst_slice
 *         cdef __Pyx_memviewslice src_slice
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":453
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
  int __pyx_v_array[0x80];
  void *__pyx_v_tmp;
  void *__pyx_v_item;
  __Pyx_memviewslice *__pyx_v_dst_slice;
  __Pyx_memviewslice __pyx_v_tmp_slice;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1);

  /* "View.MemoryView":455
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):
 *         cdef int array[128]
 *         cdef void *tmp = NULL             # <<<<<<<<<<<<<<
 *         cdef void *item
 * 
 */
  __pyx_v_tmp = NULL;

  /* "View.MemoryView":460
 *         cdef __Pyx_memviewslice *dst_slice
 *         cdef __Pyx_memviewslice tmp_slice
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)             # <<<<<<<<<<<<<<
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 */
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 460, __pyx_L1_error)
  __pyx_v_dst_slice = __pyx_t_1;

  /* "View.MemoryView":462
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 */
  __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
  if (__pyx_t_2) {

    /* "View.MemoryView":463
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)             # <<<<<<<<<<<<<<
 *             if tmp == NULL:
 *                 raise MemoryError
 */
    __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);

    /* "View.MemoryView":464
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
 */
    __pyx_t_2 = (__pyx_v_tmp == NULL);
    if (unlikely(__pyx_t_2)) {

      /* "View.MemoryView":465
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 *                 raise MemoryError             # <<<<<<<<<<<<<<
 *             item = tmp
 *         else:
 */
      PyErr_NoMemory(); __PYX_ERR(2, 465, __pyx_L1_error)

      /* "View.MemoryView":464
 *         if <size_t>self.view.itemsize > sizeof(array):
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:             # <<<<<<<<<<<<<<
 *                 raise MemoryError
 *             item = tmp
 */
    }

    /* "View.MemoryView":466
 *             if tmp == NULL:
 *                 raise MemoryError
 *             item = tmp             # <<<<<<<<<<<<<<
 *         else:
 *             item = <void *> array
 */
    __pyx_v_item = __pyx_v_tmp;

    /* "View.MemoryView":462
 *         dst_slice = get_slice_from_memview(dst, &tmp_slice)
 * 
 *         if <size_t>self.view.itemsize > sizeof(array):             # <<<<<<<<<<<<<<
 *             tmp = PyMem_Malloc(self.view.itemsize)
 *             if tmp == NULL:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":468
 *             item = tmp
 *         else:
 *             item = <void *> array             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  /*else*/ {
    __pyx_v_item = ((void *)__pyx_v_array);
  }
  __pyx_L3:;

  /* "View.MemoryView":470
 *             item = <void *> array
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value
 */
  /*try:*/ {

    /* "View.MemoryView":471
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 */
    if (__pyx_v_self->dtype_is_object) {

      /* "View.MemoryView":472
 *         try:
 *             if self.dtype_is_object:
 *                 (<PyObject **> item)[0] = <PyObject *> value             # <<<<<<<<<<<<<<
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)
 */
      (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);

      /* "View.MemoryView":471
 * 
 *         try:
 *             if self.dtype_is_object:             # <<<<<<<<<<<<<<
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 */
      goto __pyx_L8;
    }

    /* "View.MemoryView":474
 *                 (<PyObject **> item)[0] = <PyObject *> value
 *             else:
 *                 self.assign_item_from_object(<char *> item, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 474, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L8:;

    /* "View.MemoryView":478
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 */
    __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
    if (__pyx_t_2) {

      /* "View.MemoryView":479
 * 
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)             # <<<<<<<<<<<<<<
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 *                                 item, self.dtype_is_object)
 */
      __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 479, __pyx_L6_error)

      /* "View.MemoryView":478
 * 
 * 
 *             if self.view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
 */
    }

    /* "View.MemoryView":480
 *             if self.view.suboffsets != NULL:
 *                 assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
 *             slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,             # <<<<<<<<<<<<<<
 *                                 item, self.dtype_is_object)
 *         finally:
 */
    __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
  }

  /* "View.MemoryView":483
 *                                 item, self.dtype_is_object)
 *         finally:
 *             PyMem_Free(tmp)             # <<<<<<<<<<<<<<
 * 
 *     cdef setitem_indexed(self, index, value):
 */
  /*finally:*/ {
    /*normal exit:*/{
      PyMem_Free(__pyx_v_tmp);
      goto __pyx_L7;
    }
    __pyx_L6_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
      {
        PyMem_Free(__pyx_v_tmp);
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      }
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
      __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
      goto __pyx_L1_error;
    }
    __pyx_L7:;
  }

  /* "View.MemoryView":453
 *         memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
 * 
 *     cdef setitem_slice_assign_scalar(self, memoryview dst, value):             # <<<<<<<<<<<<<<
 *         cdef int array[128]
 *         cdef void *tmp = NULL
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":485
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
  char *__pyx_v_itemp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("setitem_indexed", 1);

  /* "View.MemoryView":486
 * 
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)             # <<<<<<<<<<<<<<
 *         self.assign_item_from_object(itemp, value)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(2, 486, __pyx_L1_error)
  __pyx_v_itemp = __pyx_t_1;

  /* "View.MemoryView":487
 *     cdef setitem_indexed(self, index, value):
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":485
 *             PyMem_Free(tmp)
 * 
 *     cdef setitem_indexed(self, index, value):             # <<<<<<<<<<<<<<
 *         cdef char *itemp = self.get_item_pointer(index)
 *         self.assign_item_from_object(itemp, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":489
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_v_struct = NULL;
  PyObject *__pyx_v_bytesitem = 0;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 1);

  /* "View.MemoryView":492
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef bytes bytesitem
 * 
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":495
 *         cdef bytes bytesitem
 * 
 *         bytesitem = itemp[:self.view.itemsize]             # <<<<<<<<<<<<<<
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 */
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":496
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
  {
    __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:*/ {

      /* "View.MemoryView":497
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)             # <<<<<<<<<<<<<<
 *         except struct.error:
 *             raise ValueError, "Unable to convert item to object"
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 497, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 497, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_v_result = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "View.MemoryView":496
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
    }

    /* "View.MemoryView":501
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
 */
    /*else:*/ {
      __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(2, 501, __pyx_L5_except_error)
      __pyx_t_10 = (__pyx_t_9 == 1);
      if (__pyx_t_10) {

        /* "View.MemoryView":502
 *         else:
 *             if len(self.view.format) == 1:
 *                 return result[0]             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 502, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        goto __pyx_L6_except_return;

        /* "View.MemoryView":501
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 *             if len(self.view.format) == 1:             # <<<<<<<<<<<<<<
 *                 return result[0]
 *             return result
 */
      }

      /* "View.MemoryView":503
 *             if len(self.view.format) == 1:
 *                 return result[0]
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L6_except_return;
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 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;

    /* "View.MemoryView":498
 *         try:
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Unable to convert item to object"
 *         else:
 */
    __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 498, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
    __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_11) {
      __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 498, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_1);

      /* "View.MemoryView":499
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 *             raise ValueError, "Unable to convert item to object"             # <<<<<<<<<<<<<<
 *         else:
 *             if len(self.view.format) == 1:
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
      __PYX_ERR(2, 499, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;

    /* "View.MemoryView":496
 * 
 *         bytesitem = itemp[:self.view.itemsize]
 *         try:             # <<<<<<<<<<<<<<
 *             result = struct.unpack(self.view.format, bytesitem)
 *         except struct.error:
 */
    __pyx_L5_except_error:;
    __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_L6_except_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;
  }

  /* "View.MemoryView":489
 *         self.assign_item_from_object(itemp, value)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesitem);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":505
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_struct = NULL;
  char __pyx_v_c;
  PyObject *__pyx_v_bytesvalue = 0;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  char *__pyx_t_9;
  char *__pyx_t_10;
  char *__pyx_t_11;
  char *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 1);

  /* "View.MemoryView":508
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 *         import struct             # <<<<<<<<<<<<<<
 *         cdef char c
 *         cdef bytes bytesvalue
 */
  __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_struct = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "View.MemoryView":513
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_value); 
  if (__pyx_t_2) {

    /* "View.MemoryView":514
 * 
 *         if isinstance(value, tuple):
 *             bytesvalue = struct.pack(self.view.format, *value)             # <<<<<<<<<<<<<<
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(2, 514, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(2, 514, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":513
 *         cdef Py_ssize_t i
 * 
 *         if isinstance(value, tuple):             # <<<<<<<<<<<<<<
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":516
 *             bytesvalue = struct.pack(self.view.format, *value)
 *         else:
 *             bytesvalue = struct.pack(self.view.format, value)             # <<<<<<<<<<<<<<
 * 
 *         for i, c in enumerate(bytesvalue):
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(2, 516, __pyx_L1_error)
    __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":518
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
    __PYX_ERR(2, 518, __pyx_L1_error)
  }
  __Pyx_INCREF(__pyx_v_bytesvalue);
  __pyx_t_8 = __pyx_v_bytesvalue;
  __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
  __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
  for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
    __pyx_t_9 = __pyx_t_12;
    __pyx_v_c = (__pyx_t_9[0]);

    /* "View.MemoryView":519
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    __pyx_v_i = __pyx_t_7;

    /* "View.MemoryView":518
 *             bytesvalue = struct.pack(self.view.format, value)
 * 
 *         for i, c in enumerate(bytesvalue):             # <<<<<<<<<<<<<<
 *             itemp[i] = c
 * 
 */
    __pyx_t_7 = (__pyx_t_7 + 1);

    /* "View.MemoryView":519
 * 
 *         for i, c in enumerate(bytesvalue):
 *             itemp[i] = c             # <<<<<<<<<<<<<<
 * 
 *     @cname('getbuffer')
 */
    (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "View.MemoryView":505
 *             return result
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         """Only used if instantiated manually by the user, or if Cython doesn't
 *         know how to convert the type"""
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_struct);
  __Pyx_XDECREF(__pyx_v_bytesvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":521
 *             itemp[i] = c
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 */

/* Python wrapper */
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));

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

static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  char *__pyx_t_4;
  void *__pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (unlikely(__pyx_v_info == NULL)) {
    PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
    return -1;
  }
  __Pyx_RefNannySetupContext("__getbuffer__", 0);
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "View.MemoryView":523
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
 */
  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __pyx_v_self->view.readonly;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":524
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_ND:
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
    __PYX_ERR(2, 524, __pyx_L1_error)

    /* "View.MemoryView":523
 *     @cname('getbuffer')
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
 */
  }

  /* "View.MemoryView":526
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
 *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":527
 * 
 *         if flags & PyBUF_ND:
 *             info.shape = self.view.shape             # <<<<<<<<<<<<<<
 *         else:
 *             info.shape = NULL
 */
    __pyx_t_3 = __pyx_v_self->view.shape;
    __pyx_v_info->shape = __pyx_t_3;

    /* "View.MemoryView":526
 *             raise ValueError, "Cannot create writable memory view from read-only memoryview"
 * 
 *         if flags & PyBUF_ND:             # <<<<<<<<<<<<<<
 *             info.shape = self.view.shape
 *         else:
 */
    goto __pyx_L6;
  }

  /* "View.MemoryView":529
 *             info.shape = self.view.shape
 *         else:
 *             info.shape = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_STRIDES:
 */
  /*else*/ {
    __pyx_v_info->shape = NULL;
  }
  __pyx_L6:;

  /* "View.MemoryView":531
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":532
 * 
 *         if flags & PyBUF_STRIDES:
 *             info.strides = self.view.strides             # <<<<<<<<<<<<<<
 *         else:
 *             info.strides = NULL
 */
    __pyx_t_3 = __pyx_v_self->view.strides;
    __pyx_v_info->strides = __pyx_t_3;

    /* "View.MemoryView":531
 *             info.shape = NULL
 * 
 *         if flags & PyBUF_STRIDES:             # <<<<<<<<<<<<<<
 *             info.strides = self.view.strides
 *         else:
 */
    goto __pyx_L7;
  }

  /* "View.MemoryView":534
 *             info.strides = self.view.strides
 *         else:
 *             info.strides = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_INDIRECT:
 */
  /*else*/ {
    __pyx_v_info->strides = NULL;
  }
  __pyx_L7:;

  /* "View.MemoryView":536
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":537
 * 
 *         if flags & PyBUF_INDIRECT:
 *             info.suboffsets = self.view.suboffsets             # <<<<<<<<<<<<<<
 *         else:
 *             info.suboffsets = NULL
 */
    __pyx_t_3 = __pyx_v_self->view.suboffsets;
    __pyx_v_info->suboffsets = __pyx_t_3;

    /* "View.MemoryView":536
 *             info.strides = NULL
 * 
 *         if flags & PyBUF_INDIRECT:             # <<<<<<<<<<<<<<
 *             info.suboffsets = self.view.suboffsets
 *         else:
 */
    goto __pyx_L8;
  }

  /* "View.MemoryView":539
 *             info.suboffsets = self.view.suboffsets
 *         else:
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 * 
 *         if flags & PyBUF_FORMAT:
 */
  /*else*/ {
    __pyx_v_info->suboffsets = NULL;
  }
  __pyx_L8:;

  /* "View.MemoryView":541
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":542
 * 
 *         if flags & PyBUF_FORMAT:
 *             info.format = self.view.format             # <<<<<<<<<<<<<<
 *         else:
 *             info.format = NULL
 */
    __pyx_t_4 = __pyx_v_self->view.format;
    __pyx_v_info->format = __pyx_t_4;

    /* "View.MemoryView":541
 *             info.suboffsets = NULL
 * 
 *         if flags & PyBUF_FORMAT:             # <<<<<<<<<<<<<<
 *             info.format = self.view.format
 *         else:
 */
    goto __pyx_L9;
  }

  /* "View.MemoryView":544
 *             info.format = self.view.format
 *         else:
 *             info.format = NULL             # <<<<<<<<<<<<<<
 * 
 *         info.buf = self.view.buf
 */
  /*else*/ {
    __pyx_v_info->format = NULL;
  }
  __pyx_L9:;

  /* "View.MemoryView":546
 *             info.format = NULL
 * 
 *         info.buf = self.view.buf             # <<<<<<<<<<<<<<
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 */
  __pyx_t_5 = __pyx_v_self->view.buf;
  __pyx_v_info->buf = __pyx_t_5;

  /* "View.MemoryView":547
 * 
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim             # <<<<<<<<<<<<<<
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 */
  __pyx_t_6 = __pyx_v_self->view.ndim;
  __pyx_v_info->ndim = __pyx_t_6;

  /* "View.MemoryView":548
 *         info.buf = self.view.buf
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize             # <<<<<<<<<<<<<<
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly
 */
  __pyx_t_7 = __pyx_v_self->view.itemsize;
  __pyx_v_info->itemsize = __pyx_t_7;

  /* "View.MemoryView":549
 *         info.ndim = self.view.ndim
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len             # <<<<<<<<<<<<<<
 *         info.readonly = self.view.readonly
 *         info.obj = self
 */
  __pyx_t_7 = __pyx_v_self->view.len;
  __pyx_v_info->len = __pyx_t_7;

  /* "View.MemoryView":550
 *         info.itemsize = self.view.itemsize
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly             # <<<<<<<<<<<<<<
 *         info.obj = self
 * 
 */
  __pyx_t_1 = __pyx_v_self->view.readonly;
  __pyx_v_info->readonly = __pyx_t_1;

  /* "View.MemoryView":551
 *         info.len = self.view.len
 *         info.readonly = self.view.readonly
 *         info.obj = self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj);
  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);

  /* "View.MemoryView":521
 *             itemp[i] = c
 * 
 *     @cname('getbuffer')             # <<<<<<<<<<<<<<
 *     def __getbuffer__(self, Py_buffer *info, int flags):
 *         if flags & PyBUF_WRITABLE and self.view.readonly:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  if (__pyx_v_info->obj != NULL) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  }
  __pyx_L2:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":554
 * 
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":556
 *     @property
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&result.from_slice)
 *         return result
 */
  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 556, __pyx_L1_error)
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":557
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 557, __pyx_L1_error)

  /* "View.MemoryView":558
 *         cdef _memoryviewslice result = memoryview_copy(self)
 *         transpose_memslice(&result.from_slice)
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":554
 * 
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def T(self):
 *         cdef _memoryviewslice result = memoryview_copy(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":560
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def base(self):
 *         return self._get_base()
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":562
 *     @property
 *     def base(self):
 *         return self._get_base()             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_base(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":560
 *         return result
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def base(self):
 *         return self._get_base()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":564
 *         return self._get_base()
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
 */

static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_base", 1);

  /* "View.MemoryView":565
 * 
 *     cdef _get_base(self):
 *         return self.obj             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->obj);
  __pyx_r = __pyx_v_self->obj;
  goto __pyx_L0;

  /* "View.MemoryView":564
 *         return self._get_base()
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.obj
 * 
 */

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

/* "View.MemoryView":567
 *         return self.obj
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_7genexpr__pyx_v_length;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":569
 *     @property
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
      __pyx_t_2 = __pyx_t_4;
      __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 569, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":567
 *         return self.obj
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def shape(self):
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":571
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def strides(self):
 *         if self.view.strides == NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":573
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError, "Buffer view does not expose strides"
 */
  __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "View.MemoryView":575
 *         if self.view.strides == NULL:
 * 
 *             raise ValueError, "Buffer view does not expose strides"             # <<<<<<<<<<<<<<
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
    __PYX_ERR(2, 575, __pyx_L1_error)

    /* "View.MemoryView":573
 *     @property
 *     def strides(self):
 *         if self.view.strides == NULL:             # <<<<<<<<<<<<<<
 * 
 *             raise ValueError, "Buffer view does not expose strides"
 */
  }

  /* "View.MemoryView":577
 *             raise ValueError, "Buffer view does not expose strides"
 * 
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 577, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":571
 *         return tuple([length for length in self.view.shape[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def strides(self):
 *         if self.view.strides == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":579
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  Py_ssize_t *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":581
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
 */
  __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":582
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__6, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":581
 *     @property
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:             # <<<<<<<<<<<<<<
 *             return (-1,) * self.view.ndim
 * 
 */
  }

  /* "View.MemoryView":584
 *             return (-1,) * self.view.ndim
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
    for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
      __pyx_t_3 = __pyx_t_5;
      __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
      __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 584, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":579
 *         return tuple([stride for stride in self.view.strides[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":586
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ndim(self):
 *         return self.view.ndim
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":588
 *     @property
 *     def ndim(self):
 *         return self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":586
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def ndim(self):
 *         return self.view.ndim
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":590
 *         return self.view.ndim
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def itemsize(self):
 *         return self.view.itemsize
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":592
 *     @property
 *     def itemsize(self):
 *         return self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":590
 *         return self.view.ndim
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def itemsize(self):
 *         return self.view.itemsize
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":594
 *         return self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nbytes(self):
 *         return self.size * self.view.itemsize
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":596
 *     @property
 *     def nbytes(self):
 *         return self.size * self.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":594
 *         return self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nbytes(self):
 *         return self.size * self.view.itemsize
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":598
 *         return self.size * self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self):
 *         if self._size is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);

  /* "View.MemoryView":600
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":601
 *     def size(self):
 *         if self._size is None:
 *             result = 1             # <<<<<<<<<<<<<<
 * 
 *             for length in self.view.shape[:self.view.ndim]:
 */
    __Pyx_INCREF(__pyx_int_1);
    __pyx_v_result = __pyx_int_1;

    /* "View.MemoryView":603
 *             result = 1
 * 
 *             for length in self.view.shape[:self.view.ndim]:             # <<<<<<<<<<<<<<
 *                 result *= length
 * 
 */
    __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
    for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
      __pyx_t_2 = __pyx_t_4;
      __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 603, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "View.MemoryView":604
 * 
 *             for length in self.view.shape[:self.view.ndim]:
 *                 result *= length             # <<<<<<<<<<<<<<
 * 
 *             self._size = result
 */
      __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
      __pyx_t_5 = 0;
    }

    /* "View.MemoryView":606
 *                 result *= length
 * 
 *             self._size = result             # <<<<<<<<<<<<<<
 * 
 *         return self._size
 */
    __Pyx_INCREF(__pyx_v_result);
    __Pyx_GIVEREF(__pyx_v_result);
    __Pyx_GOTREF(__pyx_v_self->_size);
    __Pyx_DECREF(__pyx_v_self->_size);
    __pyx_v_self->_size = __pyx_v_result;

    /* "View.MemoryView":600
 *     @property
 *     def size(self):
 *         if self._size is None:             # <<<<<<<<<<<<<<
 *             result = 1
 * 
 */
  }

  /* "View.MemoryView":608
 *             self._size = result
 * 
 *         return self._size             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_size);
  __pyx_r = __pyx_v_self->_size;
  goto __pyx_L0;

  /* "View.MemoryView":598
 *         return self.size * self.view.itemsize
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def size(self):
 *         if self._size is None:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":610
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

/* Python wrapper */
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":611
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
 */
  __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":612
 *     def __len__(self):
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_r = (__pyx_v_self->view.shape[0]);
    goto __pyx_L0;

    /* "View.MemoryView":611
 * 
 *     def __len__(self):
 *         if self.view.ndim >= 1:             # <<<<<<<<<<<<<<
 *             return self.view.shape[0]
 * 
 */
  }

  /* "View.MemoryView":614
 *             return self.view.shape[0]
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":610
 *         return self._size
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         if self.view.ndim >= 1:
 *             return self.view.shape[0]
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":616
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 1);

  /* "View.MemoryView":617
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":618
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "View.MemoryView":617
 * 
 *     def __repr__(self):
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,             # <<<<<<<<<<<<<<
 *                                                id(self))
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(2, 617, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(2, 617, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":616
 *         return 0
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
 *                                                id(self))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":620
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 1);

  /* "View.MemoryView":621
 * 
 *     def __str__(self):
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(2, 621, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":620
 *                                                id(self))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
 * 
 */

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

/* "View.MemoryView":624
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_c_contig", 1);

  /* "View.MemoryView":627
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 627, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":628
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def is_f_contig(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":624
 * 
 * 
 *     def is_c_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":630
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice *__pyx_v_mslice;
  __Pyx_memviewslice __pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_f_contig", 1);

  /* "View.MemoryView":633
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)             # <<<<<<<<<<<<<<
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 */
  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(2, 633, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":634
 *         cdef __Pyx_memviewslice tmp
 *         mslice = get_slice_from_memview(self, &tmp)
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)             # <<<<<<<<<<<<<<
 * 
 *     def copy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":630
 *         return slice_is_contig(mslice[0], 'C', self.view.ndim)
 * 
 *     def is_f_contig(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice *mslice
 *         cdef __Pyx_memviewslice tmp
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":636
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_mslice;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 1);

  /* "View.MemoryView":638
 *     def copy(self):
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &mslice)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));

  /* "View.MemoryView":640
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 * 
 *         slice_copy(self, &mslice)             # <<<<<<<<<<<<<<
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
 *                                    self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));

  /* "View.MemoryView":641
 * 
 *         slice_copy(self, &mslice)
 *         mslice = slice_copy_contig(&mslice, "c", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                    self.view.itemsize,
 *                                    flags|PyBUF_C_CONTIGUOUS,
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 641, __pyx_L1_error)
  __pyx_v_mslice = __pyx_t_1;

  /* "View.MemoryView":646
 *                                    self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &mslice)             # <<<<<<<<<<<<<<
 * 
 *     def copy_fortran(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":636
 *         return slice_is_contig(mslice[0], 'F', self.view.ndim)
 * 
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice mslice
 *         cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":648
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

/* Python wrapper */
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_memviewslice __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy_fortran", 1);

  /* "View.MemoryView":650
 *     def copy_fortran(self):
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS             # <<<<<<<<<<<<<<
 * 
 *         slice_copy(self, &src)
 */
  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));

  /* "View.MemoryView":652
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 * 
 *         slice_copy(self, &src)             # <<<<<<<<<<<<<<
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,
 *                                 self.view.itemsize,
 */
  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));

  /* "View.MemoryView":653
 * 
 *         slice_copy(self, &src)
 *         dst = slice_copy_contig(&src, "fortran", self.view.ndim,             # <<<<<<<<<<<<<<
 *                                 self.view.itemsize,
 *                                 flags|PyBUF_F_CONTIGUOUS,
 */
  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 653, __pyx_L1_error)
  __pyx_v_dst = __pyx_t_1;

  /* "View.MemoryView":658
 *                                 self.dtype_is_object)
 * 
 *         return memoryview_copy_from_slice(self, &dst)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":648
 *         return memoryview_copy_from_slice(self, &mslice)
 * 
 *     def copy_fortran(self):             # <<<<<<<<<<<<<<
 *         cdef __Pyx_memviewslice src, dst
 *         cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":662
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
  struct __pyx_memoryview_obj *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_cwrapper", 1);

  /* "View.MemoryView":663
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)             # <<<<<<<<<<<<<<
 *     result.typeinfo = typeinfo
 *     return result
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_o);
  __Pyx_GIVEREF(__pyx_v_o);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(2, 663, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 663, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(2, 663, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":664
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_v_result->typeinfo = __pyx_v_typeinfo;

  /* "View.MemoryView":665
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_check')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":662
 * 
 * @cname('__pyx_memoryview_new')
 * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):             # <<<<<<<<<<<<<<
 *     cdef memoryview result = memoryview(o, flags, dtype_is_object)
 *     result.typeinfo = typeinfo
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":668
 * 
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
  int __pyx_r;
  int __pyx_t_1;

  /* "View.MemoryView":669
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o) noexcept:
 *     return isinstance(o, memoryview)             # <<<<<<<<<<<<<<
 * 
 * cdef tuple _unellipsify(object index, int ndim):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":668
 * 
 * @cname('__pyx_memoryview_check')
 * cdef inline bint memoryview_check(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return isinstance(o, memoryview)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":671
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_idx;
  PyObject *__pyx_v_tup = NULL;
  PyObject *__pyx_v_result = NULL;
  int __pyx_v_have_slices;
  int __pyx_v_seen_ellipsis;
  PyObject *__pyx_v_item = NULL;
  Py_ssize_t __pyx_v_nslices;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_unellipsify", 1);

  /* "View.MemoryView":677
 *     """
 *     cdef Py_ssize_t idx
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)             # <<<<<<<<<<<<<<
 * 
 *     result = [slice(None)] * ndim
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_index); 
  if (__pyx_t_2) {
    __Pyx_INCREF(((PyObject*)__pyx_v_index));
    __pyx_t_1 = __pyx_v_index;
  } else {
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(2, 677, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_v_tup = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":679
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)
 * 
 *     result = [slice(None)] * ndim             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
 */
  __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  { Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
      __Pyx_INCREF(__pyx_slice__7);
      __Pyx_GIVEREF(__pyx_slice__7);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__7)) __PYX_ERR(2, 679, __pyx_L1_error);
    }
  }
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "View.MemoryView":680
 * 
 *     result = [slice(None)] * ndim
 *     have_slices = False             # <<<<<<<<<<<<<<
 *     seen_ellipsis = False
 *     idx = 0
 */
  __pyx_v_have_slices = 0;

  /* "View.MemoryView":681
 *     result = [slice(None)] * ndim
 *     have_slices = False
 *     seen_ellipsis = False             # <<<<<<<<<<<<<<
 *     idx = 0
 *     for item in tup:
 */
  __pyx_v_seen_ellipsis = 0;

  /* "View.MemoryView":682
 *     have_slices = False
 *     seen_ellipsis = False
 *     idx = 0             # <<<<<<<<<<<<<<
 *     for item in tup:
 *         if item is Ellipsis:
 */
  __pyx_v_idx = 0;

  /* "View.MemoryView":683
 *     seen_ellipsis = False
 *     idx = 0
 *     for item in tup:             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  if (unlikely(__pyx_v_tup == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(2, 683, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 683, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(2, 683, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "View.MemoryView":684
 *     idx = 0
 *     for item in tup:
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
 */
    __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
    if (__pyx_t_2) {

      /* "View.MemoryView":685
 *     for item in tup:
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
 */
      __pyx_t_2 = (!__pyx_v_seen_ellipsis);
      if (__pyx_t_2) {

        /* "View.MemoryView":686
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)             # <<<<<<<<<<<<<<
 *                 seen_ellipsis = True
 *             have_slices = True
 */
        if (unlikely(__pyx_v_tup == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(2, 686, __pyx_L1_error)
        }
        __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 686, __pyx_L1_error)
        __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));

        /* "View.MemoryView":687
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True             # <<<<<<<<<<<<<<
 *             have_slices = True
 *         else:
 */
        __pyx_v_seen_ellipsis = 1;

        /* "View.MemoryView":685
 *     for item in tup:
 *         if item is Ellipsis:
 *             if not seen_ellipsis:             # <<<<<<<<<<<<<<
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
 */
      }

      /* "View.MemoryView":688
 *                 idx += ndim - len(tup)
 *                 seen_ellipsis = True
 *             have_slices = True             # <<<<<<<<<<<<<<
 *         else:
 *             if isinstance(item, slice):
 */
      __pyx_v_have_slices = 1;

      /* "View.MemoryView":684
 *     idx = 0
 *     for item in tup:
 *         if item is Ellipsis:             # <<<<<<<<<<<<<<
 *             if not seen_ellipsis:
 *                 idx += ndim - len(tup)
 */
      goto __pyx_L5;
    }

    /* "View.MemoryView":690
 *             have_slices = True
 *         else:
 *             if isinstance(item, slice):             # <<<<<<<<<<<<<<
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
 */
    /*else*/ {
      __pyx_t_2 = PySlice_Check(__pyx_v_item); 
      if (__pyx_t_2) {

        /* "View.MemoryView":691
 *         else:
 *             if isinstance(item, slice):
 *                 have_slices = True             # <<<<<<<<<<<<<<
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 */
        __pyx_v_have_slices = 1;

        /* "View.MemoryView":690
 *             have_slices = True
 *         else:
 *             if isinstance(item, slice):             # <<<<<<<<<<<<<<
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
 */
        goto __pyx_L7;
      }

      /* "View.MemoryView":692
 *             if isinstance(item, slice):
 *                 have_slices = True
 *             elif not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
 */
      __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
      if (unlikely(__pyx_t_2)) {

        /* "View.MemoryView":693
 *                 have_slices = True
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"             # <<<<<<<<<<<<<<
 *             result[idx] = item
 *         idx += 1
 */
        __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = 0;
        __pyx_t_6 = 127;
        __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
        __pyx_t_5 += 24;
        __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
        PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
        __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
        __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
        __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_kp_u__8);
        __pyx_t_5 += 1;
        __Pyx_GIVEREF(__pyx_kp_u__8);
        PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__8);
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(2, 693, __pyx_L1_error)

        /* "View.MemoryView":692
 *             if isinstance(item, slice):
 *                 have_slices = True
 *             elif not PyIndex_Check(item):             # <<<<<<<<<<<<<<
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
 */
      }
      __pyx_L7:;

      /* "View.MemoryView":694
 *             elif not PyIndex_Check(item):
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item             # <<<<<<<<<<<<<<
 *         idx += 1
 * 
 */
      if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(2, 694, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "View.MemoryView":695
 *                 raise TypeError, f"Cannot index with type '{type(item)}'"
 *             result[idx] = item
 *         idx += 1             # <<<<<<<<<<<<<<
 * 
 *     nslices = ndim - idx
 */
    __pyx_v_idx = (__pyx_v_idx + 1);

    /* "View.MemoryView":683
 *     seen_ellipsis = False
 *     idx = 0
 *     for item in tup:             # <<<<<<<<<<<<<<
 *         if item is Ellipsis:
 *             if not seen_ellipsis:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "View.MemoryView":697
 *         idx += 1
 * 
 *     nslices = ndim - idx             # <<<<<<<<<<<<<<
 *     return have_slices or nslices, tuple(result)
 * 
 */
  __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);

  /* "View.MemoryView":698
 * 
 *     nslices = ndim - idx
 *     return have_slices or nslices, tuple(result)             # <<<<<<<<<<<<<<
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 */
  __Pyx_XDECREF(__pyx_r);
  if (!__pyx_v_have_slices) {
  } else {
    __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __pyx_t_7;
  __pyx_t_7 = 0;
  __pyx_L9_bool_binop_done:;
  __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(2, 698, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(2, 698, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_7 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":671
 *     return isinstance(o, memoryview)
 * 
 * cdef tuple _unellipsify(object index, int ndim):             # <<<<<<<<<<<<<<
 *     """
 *     Replace all ellipses with full slices and fill incomplete indices with
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tup);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":700
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 */

static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_suboffset;
  int __pyx_r;
  Py_ssize_t *__pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "View.MemoryView":701
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"
 */
  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
    __pyx_t_1 = __pyx_t_3;
    __pyx_v_suboffset = (__pyx_t_1[0]);

    /* "View.MemoryView":702
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag
 */
    __pyx_t_4 = (__pyx_v_suboffset >= 0);
    if (unlikely(__pyx_t_4)) {

      /* "View.MemoryView":703
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"             # <<<<<<<<<<<<<<
 *     return 0  # return type just used as an error flag
 * 
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
      __PYX_ERR(2, 703, __pyx_L1_error)

      /* "View.MemoryView":702
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag
 */
    }
  }

  /* "View.MemoryView":704
 *         if suboffset >= 0:
 *             raise ValueError, "Indirect dimensions not supported"
 *     return 0  # return type just used as an error flag             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":700
 *     return have_slices or nslices, tuple(result)
 * 
 * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:             # <<<<<<<<<<<<<<
 *     for suboffset in suboffsets[:ndim]:
 *         if suboffset >= 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":711
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
  int __pyx_v_new_ndim;
  int __pyx_v_suboffset_dim;
  int __pyx_v_dim;
  __Pyx_memviewslice __pyx_v_src;
  __Pyx_memviewslice __pyx_v_dst;
  __Pyx_memviewslice *__pyx_v_p_src;
  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
  __Pyx_memviewslice *__pyx_v_p_dst;
  int *__pyx_v_p_suboffset_dim;
  Py_ssize_t __pyx_v_start;
  Py_ssize_t __pyx_v_stop;
  Py_ssize_t __pyx_v_step;
  Py_ssize_t __pyx_v_cindex;
  int __pyx_v_have_start;
  int __pyx_v_have_stop;
  int __pyx_v_have_step;
  PyObject *__pyx_v_index = NULL;
  struct __pyx_memoryview_obj *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_memoryview_obj *__pyx_t_3;
  char *__pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memview_slice", 1);

  /* "View.MemoryView":712
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim             # <<<<<<<<<<<<<<
 *     cdef bint negative_step
 *     cdef __Pyx_memviewslice src, dst
 */
  __pyx_v_new_ndim = 0;
  __pyx_v_suboffset_dim = -1;

  /* "View.MemoryView":719
 * 
 * 
 *     memset(&dst, 0, sizeof(dst))             # <<<<<<<<<<<<<<
 * 
 *     cdef _memoryviewslice memviewsliceobj
 */
  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));

  /* "View.MemoryView":723
 *     cdef _memoryviewslice memviewsliceobj
 * 
 *     assert memview.view.ndim > 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(2, 723, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(2, 723, __pyx_L1_error)
  #endif

  /* "View.MemoryView":725
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":726
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview             # <<<<<<<<<<<<<<
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 726, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":727
 *     if isinstance(memview, _memoryviewslice):
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, &src)
 */
    __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);

    /* "View.MemoryView":725
 *     assert memview.view.ndim > 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         memviewsliceobj = memview
 *         p_src = &memviewsliceobj.from_slice
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":729
 *         p_src = &memviewsliceobj.from_slice
 *     else:
 *         slice_copy(memview, &src)             # <<<<<<<<<<<<<<
 *         p_src = &src
 * 
 */
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));

    /* "View.MemoryView":730
 *     else:
 *         slice_copy(memview, &src)
 *         p_src = &src             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_p_src = (&__pyx_v_src);
  }
  __pyx_L3:;

  /* "View.MemoryView":736
 * 
 * 
 *     dst.memview = p_src.memview             # <<<<<<<<<<<<<<
 *     dst.data = p_src.data
 * 
 */
  __pyx_t_3 = __pyx_v_p_src->memview;
  __pyx_v_dst.memview = __pyx_t_3;

  /* "View.MemoryView":737
 * 
 *     dst.memview = p_src.memview
 *     dst.data = p_src.data             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_v_p_src->data;
  __pyx_v_dst.data = __pyx_t_4;

  /* "View.MemoryView":742
 * 
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst             # <<<<<<<<<<<<<<
 *     cdef int *p_suboffset_dim = &suboffset_dim
 *     cdef Py_ssize_t start, stop, step, cindex
 */
  __pyx_v_p_dst = (&__pyx_v_dst);

  /* "View.MemoryView":743
 * 
 *     cdef __Pyx_memviewslice *p_dst = &dst
 *     cdef int *p_suboffset_dim = &suboffset_dim             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t start, stop, step, cindex
 *     cdef bint have_start, have_stop, have_step
 */
  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);

  /* "View.MemoryView":747
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             cindex = index
 */
  __pyx_t_5 = 0;
  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
    __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 747, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 747, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(2, 747, __pyx_L1_error)
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(2, 747, __pyx_L1_error)
          #endif
          if (__pyx_t_6 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(2, 747, __pyx_L1_error)
        #else
        __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
      }
    } else {
      __pyx_t_8 = __pyx_t_7(__pyx_t_2);
      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(2, 747, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_v_dim = __pyx_t_5;
    __pyx_t_5 = (__pyx_t_5 + 1);

    /* "View.MemoryView":748
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             cindex = index
 *             slice_memviewslice(
 */
    __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":749
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):
 *             cindex = index             # <<<<<<<<<<<<<<
 *             slice_memviewslice(
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 */
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 749, __pyx_L1_error)
      __pyx_v_cindex = __pyx_t_9;

      /* "View.MemoryView":750
 *         if PyIndex_Check(index):
 *             cindex = index
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 */
      __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 750, __pyx_L1_error)

      /* "View.MemoryView":748
 * 
 *     for dim, index in enumerate(indices):
 *         if PyIndex_Check(index):             # <<<<<<<<<<<<<<
 *             cindex = index
 *             slice_memviewslice(
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":756
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 */
    __pyx_t_1 = (__pyx_v_index == Py_None);
    if (__pyx_t_1) {

      /* "View.MemoryView":757
 *                 False)
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1             # <<<<<<<<<<<<<<
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 */
      (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;

      /* "View.MemoryView":758
 *         elif index is None:
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0             # <<<<<<<<<<<<<<
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1
 */
      (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;

      /* "View.MemoryView":759
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1             # <<<<<<<<<<<<<<
 *             new_ndim += 1
 *         else:
 */
      (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;

      /* "View.MemoryView":760
 *             p_dst.strides[new_ndim] = 0
 *             p_dst.suboffsets[new_ndim] = -1
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 *         else:
 *             start = index.start or 0
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);

      /* "View.MemoryView":756
 *                 0, 0, 0, # have_{start,stop,step}
 *                 False)
 *         elif index is None:             # <<<<<<<<<<<<<<
 *             p_dst.shape[new_ndim] = 1
 *             p_dst.strides[new_ndim] = 0
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":762
 *             new_ndim += 1
 *         else:
 *             start = index.start or 0             # <<<<<<<<<<<<<<
 *             stop = index.stop or 0
 *             step = index.step or 0
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 762, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 762, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L7_bool_binop_done:;
      __pyx_v_start = __pyx_t_9;

      /* "View.MemoryView":763
 *         else:
 *             start = index.start or 0
 *             stop = index.stop or 0             # <<<<<<<<<<<<<<
 *             step = index.step or 0
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 763, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 763, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L9_bool_binop_done:;
      __pyx_v_stop = __pyx_t_9;

      /* "View.MemoryView":764
 *             start = index.start or 0
 *             stop = index.stop or 0
 *             step = index.step or 0             # <<<<<<<<<<<<<<
 * 
 *             have_start = index.start is not None
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(2, 764, __pyx_L1_error)
      if (!__pyx_t_1) {
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 764, __pyx_L1_error)
        __pyx_t_9 = __pyx_t_11;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_9 = 0;
      __pyx_L11_bool_binop_done:;
      __pyx_v_step = __pyx_t_9;

      /* "View.MemoryView":766
 *             step = index.step or 0
 * 
 *             have_start = index.start is not None             # <<<<<<<<<<<<<<
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 766, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_start = __pyx_t_1;

      /* "View.MemoryView":767
 * 
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None             # <<<<<<<<<<<<<<
 *             have_step = index.step is not None
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_stop = __pyx_t_1;

      /* "View.MemoryView":768
 *             have_start = index.start is not None
 *             have_stop = index.stop is not None
 *             have_step = index.step is not None             # <<<<<<<<<<<<<<
 * 
 *             slice_memviewslice(
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_1 = (__pyx_t_8 != Py_None);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_v_have_step = __pyx_t_1;

      /* "View.MemoryView":770
 *             have_step = index.step is not None
 * 
 *             slice_memviewslice(             # <<<<<<<<<<<<<<
 *                 p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
 *                 dim, new_ndim, p_suboffset_dim,
 */
      __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(2, 770, __pyx_L1_error)

      /* "View.MemoryView":776
 *                 have_start, have_stop, have_step,
 *                 True)
 *             new_ndim += 1             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(memview, _memoryviewslice):
 */
      __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
    }
    __pyx_L6:;

    /* "View.MemoryView":747
 *     cdef bint have_start, have_stop, have_step
 * 
 *     for dim, index in enumerate(indices):             # <<<<<<<<<<<<<<
 *         if PyIndex_Check(index):
 *             cindex = index
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "View.MemoryView":778
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":779
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);

    /* "View.MemoryView":780
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_dtype_func,
 *                                     memview.dtype_is_object)
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 780, __pyx_L1_error) }

    /* "View.MemoryView":781
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 *     else:
 */
    if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 781, __pyx_L1_error) }

    /* "View.MemoryView":779
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         return memoryview_fromslice(dst, new_ndim,             # <<<<<<<<<<<<<<
 *                                     memviewsliceobj.to_object_func,
 *                                     memviewsliceobj.to_dtype_func,
 */
    __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(2, 779, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":778
 *             new_ndim += 1
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         return memoryview_fromslice(dst, new_ndim,
 *                                     memviewsliceobj.to_object_func,
 */
  }

  /* "View.MemoryView":784
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
  /*else*/ {
    __Pyx_XDECREF((PyObject *)__pyx_r);

    /* "View.MemoryView":785
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,
 *                                     memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "View.MemoryView":784
 *                                     memview.dtype_is_object)
 *     else:
 *         return memoryview_fromslice(dst, new_ndim, NULL, NULL,             # <<<<<<<<<<<<<<
 *                                     memview.dtype_is_object)
 * 
 */
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(2, 784, __pyx_L1_error)
    __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":711
 * 
 * @cname('__pyx_memview_slice')
 * cdef memoryview memview_slice(memoryview memview, object indices):             # <<<<<<<<<<<<<<
 *     cdef int new_ndim = 0, suboffset_dim = -1, dim
 *     cdef bint negative_step
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":793
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
  Py_ssize_t __pyx_v_new_shape;
  int __pyx_v_negative_step;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "View.MemoryView":813
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
 */
  __pyx_t_1 = (!__pyx_v_is_slice);
  if (__pyx_t_1) {

    /* "View.MemoryView":815
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
 */
    __pyx_t_1 = (__pyx_v_start < 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":816
 * 
 *         if start < 0:
 *             start += shape             # <<<<<<<<<<<<<<
 *         if not 0 <= start < shape:
 *             _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
 */
      __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

      /* "View.MemoryView":815
 *     if not is_slice:
 * 
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start += shape
 *         if not 0 <= start < shape:
 */
    }

    /* "View.MemoryView":817
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
 */
    __pyx_t_1 = (0 <= __pyx_v_start);
    if (__pyx_t_1) {
      __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
    }
    __pyx_t_2 = (!__pyx_t_1);
    if (__pyx_t_2) {

      /* "View.MemoryView":818
 *             start += shape
 *         if not 0 <= start < shape:
 *             _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)             # <<<<<<<<<<<<<<
 *     else:
 * 
 */
      __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 818, __pyx_L1_error)

      /* "View.MemoryView":817
 *         if start < 0:
 *             start += shape
 *         if not 0 <= start < shape:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
 *     else:
 */
    }

    /* "View.MemoryView":813
 *     cdef bint negative_step
 * 
 *     if not is_slice:             # <<<<<<<<<<<<<<
 * 
 *         if start < 0:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":821
 *     else:
 * 
 *         if have_step:             # <<<<<<<<<<<<<<
 *             negative_step = step < 0
 *             if step == 0:
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_have_step != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":822
 * 
 *         if have_step:
 *             negative_step = step < 0             # <<<<<<<<<<<<<<
 *             if step == 0:
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
 */
      __pyx_v_negative_step = (__pyx_v_step < 0);

      /* "View.MemoryView":823
 *         if have_step:
 *             negative_step = step < 0
 *             if step == 0:             # <<<<<<<<<<<<<<
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
 *         else:
 */
      __pyx_t_2 = (__pyx_v_step == 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":824
 *             negative_step = step < 0
 *             if step == 0:
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)             # <<<<<<<<<<<<<<
 *         else:
 *             negative_step = False
 */
        __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 824, __pyx_L1_error)

        /* "View.MemoryView":823
 *         if have_step:
 *             negative_step = step < 0
 *             if step == 0:             # <<<<<<<<<<<<<<
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
 *         else:
 */
      }

      /* "View.MemoryView":821
 *     else:
 * 
 *         if have_step:             # <<<<<<<<<<<<<<
 *             negative_step = step < 0
 *             if step == 0:
 */
      goto __pyx_L6;
    }

    /* "View.MemoryView":826
 *                 _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
 *         else:
 *             negative_step = False             # <<<<<<<<<<<<<<
 *             step = 1
 * 
 */
    /*else*/ {
      __pyx_v_negative_step = 0;

      /* "View.MemoryView":827
 *         else:
 *             negative_step = False
 *             step = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_step = 1;
    }
    __pyx_L6:;

    /* "View.MemoryView":830
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
    __pyx_t_2 = (__pyx_v_have_start != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":831
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
 */
      __pyx_t_2 = (__pyx_v_start < 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":832
 *         if have_start:
 *             if start < 0:
 *                 start += shape             # <<<<<<<<<<<<<<
 *                 if start < 0:
 *                     start = 0
 */
        __pyx_v_start = (__pyx_v_start + __pyx_v_shape);

        /* "View.MemoryView":833
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
 */
        __pyx_t_2 = (__pyx_v_start < 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":834
 *                 start += shape
 *                 if start < 0:
 *                     start = 0             # <<<<<<<<<<<<<<
 *             elif start >= shape:
 *                 if negative_step:
 */
          __pyx_v_start = 0;

          /* "View.MemoryView":833
 *             if start < 0:
 *                 start += shape
 *                 if start < 0:             # <<<<<<<<<<<<<<
 *                     start = 0
 *             elif start >= shape:
 */
        }

        /* "View.MemoryView":831
 * 
 *         if have_start:
 *             if start < 0:             # <<<<<<<<<<<<<<
 *                 start += shape
 *                 if start < 0:
 */
        goto __pyx_L9;
      }

      /* "View.MemoryView":835
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
 */
      __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
      if (__pyx_t_2) {

        /* "View.MemoryView":836
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
 */
        if (__pyx_v_negative_step) {

          /* "View.MemoryView":837
 *             elif start >= shape:
 *                 if negative_step:
 *                     start = shape - 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     start = shape
 */
          __pyx_v_start = (__pyx_v_shape - 1);

          /* "View.MemoryView":836
 *                     start = 0
 *             elif start >= shape:
 *                 if negative_step:             # <<<<<<<<<<<<<<
 *                     start = shape - 1
 *                 else:
 */
          goto __pyx_L11;
        }

        /* "View.MemoryView":839
 *                     start = shape - 1
 *                 else:
 *                     start = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        /*else*/ {
          __pyx_v_start = __pyx_v_shape;
        }
        __pyx_L11:;

        /* "View.MemoryView":835
 *                 if start < 0:
 *                     start = 0
 *             elif start >= shape:             # <<<<<<<<<<<<<<
 *                 if negative_step:
 *                     start = shape - 1
 */
      }
      __pyx_L9:;

      /* "View.MemoryView":830
 * 
 * 
 *         if have_start:             # <<<<<<<<<<<<<<
 *             if start < 0:
 *                 start += shape
 */
      goto __pyx_L8;
    }

    /* "View.MemoryView":841
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
    /*else*/ {
      if (__pyx_v_negative_step) {

        /* "View.MemoryView":842
 *         else:
 *             if negative_step:
 *                 start = shape - 1             # <<<<<<<<<<<<<<
 *             else:
 *                 start = 0
 */
        __pyx_v_start = (__pyx_v_shape - 1);

        /* "View.MemoryView":841
 *                     start = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 start = shape - 1
 *             else:
 */
        goto __pyx_L12;
      }

      /* "View.MemoryView":844
 *                 start = shape - 1
 *             else:
 *                 start = 0             # <<<<<<<<<<<<<<
 * 
 *         if have_stop:
 */
      /*else*/ {
        __pyx_v_start = 0;
      }
      __pyx_L12:;
    }
    __pyx_L8:;

    /* "View.MemoryView":846
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
    __pyx_t_2 = (__pyx_v_have_stop != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":847
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
 */
      __pyx_t_2 = (__pyx_v_stop < 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":848
 *         if have_stop:
 *             if stop < 0:
 *                 stop += shape             # <<<<<<<<<<<<<<
 *                 if stop < 0:
 *                     stop = 0
 */
        __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);

        /* "View.MemoryView":849
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
 */
        __pyx_t_2 = (__pyx_v_stop < 0);
        if (__pyx_t_2) {

          /* "View.MemoryView":850
 *                 stop += shape
 *                 if stop < 0:
 *                     stop = 0             # <<<<<<<<<<<<<<
 *             elif stop > shape:
 *                 stop = shape
 */
          __pyx_v_stop = 0;

          /* "View.MemoryView":849
 *             if stop < 0:
 *                 stop += shape
 *                 if stop < 0:             # <<<<<<<<<<<<<<
 *                     stop = 0
 *             elif stop > shape:
 */
        }

        /* "View.MemoryView":847
 * 
 *         if have_stop:
 *             if stop < 0:             # <<<<<<<<<<<<<<
 *                 stop += shape
 *                 if stop < 0:
 */
        goto __pyx_L14;
      }

      /* "View.MemoryView":851
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
 */
      __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
      if (__pyx_t_2) {

        /* "View.MemoryView":852
 *                     stop = 0
 *             elif stop > shape:
 *                 stop = shape             # <<<<<<<<<<<<<<
 *         else:
 *             if negative_step:
 */
        __pyx_v_stop = __pyx_v_shape;

        /* "View.MemoryView":851
 *                 if stop < 0:
 *                     stop = 0
 *             elif stop > shape:             # <<<<<<<<<<<<<<
 *                 stop = shape
 *         else:
 */
      }
      __pyx_L14:;

      /* "View.MemoryView":846
 *                 start = 0
 * 
 *         if have_stop:             # <<<<<<<<<<<<<<
 *             if stop < 0:
 *                 stop += shape
 */
      goto __pyx_L13;
    }

    /* "View.MemoryView":854
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
    /*else*/ {
      if (__pyx_v_negative_step) {

        /* "View.MemoryView":855
 *         else:
 *             if negative_step:
 *                 stop = -1             # <<<<<<<<<<<<<<
 *             else:
 *                 stop = shape
 */
        __pyx_v_stop = -1L;

        /* "View.MemoryView":854
 *                 stop = shape
 *         else:
 *             if negative_step:             # <<<<<<<<<<<<<<
 *                 stop = -1
 *             else:
 */
        goto __pyx_L16;
      }

      /* "View.MemoryView":857
 *                 stop = -1
 *             else:
 *                 stop = shape             # <<<<<<<<<<<<<<
 * 
 * 
 */
      /*else*/ {
        __pyx_v_stop = __pyx_v_shape;
      }
      __pyx_L16:;
    }
    __pyx_L13:;

    /* "View.MemoryView":861
 * 
 *         with cython.cdivision(True):
 *             new_shape = (stop - start) // step             # <<<<<<<<<<<<<<
 * 
 *             if (stop - start) - step * new_shape:
 */
    __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);

    /* "View.MemoryView":863
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
 */
    __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":864
 * 
 *             if (stop - start) - step * new_shape:
 *                 new_shape += 1             # <<<<<<<<<<<<<<
 * 
 *         if new_shape < 0:
 */
      __pyx_v_new_shape = (__pyx_v_new_shape + 1);

      /* "View.MemoryView":863
 *             new_shape = (stop - start) // step
 * 
 *             if (stop - start) - step * new_shape:             # <<<<<<<<<<<<<<
 *                 new_shape += 1
 * 
 */
    }

    /* "View.MemoryView":866
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
 */
    __pyx_t_2 = (__pyx_v_new_shape < 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":867
 * 
 *         if new_shape < 0:
 *             new_shape = 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_new_shape = 0;

      /* "View.MemoryView":866
 *                 new_shape += 1
 * 
 *         if new_shape < 0:             # <<<<<<<<<<<<<<
 *             new_shape = 0
 * 
 */
    }

    /* "View.MemoryView":870
 * 
 * 
 *         dst.strides[new_ndim] = stride * step             # <<<<<<<<<<<<<<
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset
 */
    (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);

    /* "View.MemoryView":871
 * 
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape             # <<<<<<<<<<<<<<
 *         dst.suboffsets[new_ndim] = suboffset
 * 
 */
    (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;

    /* "View.MemoryView":872
 *         dst.strides[new_ndim] = stride * step
 *         dst.shape[new_ndim] = new_shape
 *         dst.suboffsets[new_ndim] = suboffset             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
  }
  __pyx_L3:;

  /* "View.MemoryView":875
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":876
 * 
 *     if suboffset_dim[0] < 0:
 *         dst.data += start * stride             # <<<<<<<<<<<<<<
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 */
    __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));

    /* "View.MemoryView":875
 * 
 * 
 *     if suboffset_dim[0] < 0:             # <<<<<<<<<<<<<<
 *         dst.data += start * stride
 *     else:
 */
    goto __pyx_L19;
  }

  /* "View.MemoryView":878
 *         dst.data += start * stride
 *     else:
 *         dst.suboffsets[suboffset_dim[0]] += start * stride             # <<<<<<<<<<<<<<
 * 
 *     if suboffset >= 0:
 */
  /*else*/ {
    __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
    (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
  }
  __pyx_L19:;

  /* "View.MemoryView":880
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
 */
  __pyx_t_2 = (__pyx_v_suboffset >= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":881
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 */
    __pyx_t_2 = (!__pyx_v_is_slice);
    if (__pyx_t_2) {

      /* "View.MemoryView":882
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 */
      __pyx_t_2 = (__pyx_v_new_ndim == 0);
      if (__pyx_t_2) {

        /* "View.MemoryView":883
 *         if not is_slice:
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
 */
        __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);

        /* "View.MemoryView":882
 *     if suboffset >= 0:
 *         if not is_slice:
 *             if new_ndim == 0:             # <<<<<<<<<<<<<<
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 */
        goto __pyx_L22;
      }

      /* "View.MemoryView":885
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 *             else:
 *                 _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "             # <<<<<<<<<<<<<<
 *                                      "must be indexed and not sliced", dim)
 *         else:
 */
      /*else*/ {

        /* "View.MemoryView":886
 *             else:
 *                 _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
 *                                      "must be indexed and not sliced", dim)             # <<<<<<<<<<<<<<
 *         else:
 *             suboffset_dim[0] = new_ndim
 */
        __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 885, __pyx_L1_error)
      }
      __pyx_L22:;

      /* "View.MemoryView":881
 * 
 *     if suboffset >= 0:
 *         if not is_slice:             # <<<<<<<<<<<<<<
 *             if new_ndim == 0:
 *                 dst.data = (<char **> dst.data)[0] + suboffset
 */
      goto __pyx_L21;
    }

    /* "View.MemoryView":888
 *                                      "must be indexed and not sliced", dim)
 *         else:
 *             suboffset_dim[0] = new_ndim             # <<<<<<<<<<<<<<
 * 
 *     return 0
 */
    /*else*/ {
      (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
    }
    __pyx_L21:;

    /* "View.MemoryView":880
 *         dst.suboffsets[suboffset_dim[0]] += start * stride
 * 
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         if not is_slice:
 *             if new_ndim == 0:
 */
  }

  /* "View.MemoryView":890
 *             suboffset_dim[0] = new_ndim
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":793
 * 
 * @cname('__pyx_memoryview_slice_memviewslice')
 * cdef int slice_memviewslice(             # <<<<<<<<<<<<<<
 *         __Pyx_memviewslice *dst,
 *         Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":896
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_suboffset;
  Py_ssize_t __pyx_v_itemsize;
  char *__pyx_v_resultp;
  char *__pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_UCS4 __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pybuffer_index", 1);

  /* "View.MemoryView":898
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t itemsize = view.itemsize
 *     cdef char *resultp
 */
  __pyx_v_suboffset = -1L;

  /* "View.MemoryView":899
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 *     cdef Py_ssize_t itemsize = view.itemsize             # <<<<<<<<<<<<<<
 *     cdef char *resultp
 * 
 */
  __pyx_t_1 = __pyx_v_view->itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":902
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len // itemsize
 *         stride = itemsize
 */
  __pyx_t_2 = (__pyx_v_view->ndim == 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":903
 * 
 *     if view.ndim == 0:
 *         shape = view.len // itemsize             # <<<<<<<<<<<<<<
 *         stride = itemsize
 *     else:
 */
    if (unlikely(__pyx_v_itemsize == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      __PYX_ERR(2, 903, __pyx_L1_error)
    }
    else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1)  && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
      PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
      __PYX_ERR(2, 903, __pyx_L1_error)
    }
    __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);

    /* "View.MemoryView":904
 *     if view.ndim == 0:
 *         shape = view.len // itemsize
 *         stride = itemsize             # <<<<<<<<<<<<<<
 *     else:
 *         shape = view.shape[dim]
 */
    __pyx_v_stride = __pyx_v_itemsize;

    /* "View.MemoryView":902
 *     cdef char *resultp
 * 
 *     if view.ndim == 0:             # <<<<<<<<<<<<<<
 *         shape = view.len // itemsize
 *         stride = itemsize
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":906
 *         stride = itemsize
 *     else:
 *         shape = view.shape[dim]             # <<<<<<<<<<<<<<
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 */
  /*else*/ {
    __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);

    /* "View.MemoryView":907
 *     else:
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]             # <<<<<<<<<<<<<<
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]
 */
    __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);

    /* "View.MemoryView":908
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
 */
    __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
    if (__pyx_t_2) {

      /* "View.MemoryView":909
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:
 *             suboffset = view.suboffsets[dim]             # <<<<<<<<<<<<<<
 * 
 *     if index < 0:
 */
      __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);

      /* "View.MemoryView":908
 *         shape = view.shape[dim]
 *         stride = view.strides[dim]
 *         if view.suboffsets != NULL:             # <<<<<<<<<<<<<<
 *             suboffset = view.suboffsets[dim]
 * 
 */
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":911
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
 */
  __pyx_t_2 = (__pyx_v_index < 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":912
 * 
 *     if index < 0:
 *         index += view.shape[dim]             # <<<<<<<<<<<<<<
 *         if index < 0:
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 */
    __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));

    /* "View.MemoryView":913
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 */
    __pyx_t_2 = (__pyx_v_index < 0);
    if (unlikely(__pyx_t_2)) {

      /* "View.MemoryView":914
 *         index += view.shape[dim]
 *         if index < 0:
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"             # <<<<<<<<<<<<<<
 * 
 *     if index >= shape:
 */
      __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = 0;
      __pyx_t_4 = 127;
      __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
      __pyx_t_1 += 37;
      __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
      __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_INCREF(__pyx_kp_u__9);
      __pyx_t_1 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__9);
      PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__9);
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 914, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(2, 914, __pyx_L1_error)

      /* "View.MemoryView":913
 *     if index < 0:
 *         index += view.shape[dim]
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 */
    }

    /* "View.MemoryView":911
 *             suboffset = view.suboffsets[dim]
 * 
 *     if index < 0:             # <<<<<<<<<<<<<<
 *         index += view.shape[dim]
 *         if index < 0:
 */
  }

  /* "View.MemoryView":916
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 */
  __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
  if (unlikely(__pyx_t_2)) {

    /* "View.MemoryView":917
 * 
 *     if index >= shape:
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"             # <<<<<<<<<<<<<<
 * 
 *     resultp = bufp + index * stride
 */
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_4 = 127;
    __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
    __pyx_t_1 += 37;
    __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
    __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_1 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__9);
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(2, 917, __pyx_L1_error)

    /* "View.MemoryView":916
 *             raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     if index >= shape:             # <<<<<<<<<<<<<<
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 */
  }

  /* "View.MemoryView":919
 *         raise IndexError, f"Out of bounds on buffer access (axis {dim})"
 * 
 *     resultp = bufp + index * stride             # <<<<<<<<<<<<<<
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset
 */
  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));

  /* "View.MemoryView":920
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 */
  __pyx_t_2 = (__pyx_v_suboffset >= 0);
  if (__pyx_t_2) {

    /* "View.MemoryView":921
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:
 *         resultp = (<char **> resultp)[0] + suboffset             # <<<<<<<<<<<<<<
 * 
 *     return resultp
 */
    __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);

    /* "View.MemoryView":920
 * 
 *     resultp = bufp + index * stride
 *     if suboffset >= 0:             # <<<<<<<<<<<<<<
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 */
  }

  /* "View.MemoryView":923
 *         resultp = (<char **> resultp)[0] + suboffset
 * 
 *     return resultp             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_resultp;
  goto __pyx_L0;

  /* "View.MemoryView":896
 * 
 * @cname('__pyx_pybuffer_index')
 * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,             # <<<<<<<<<<<<<<
 *                           Py_ssize_t dim) except NULL:
 *     cdef Py_ssize_t shape, stride, suboffset = -1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":929
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
  int __pyx_v_ndim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_r;
  int __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "View.MemoryView":930
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
 *     cdef int ndim = memslice.memview.view.ndim             # <<<<<<<<<<<<<<
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 */
  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
  __pyx_v_ndim = __pyx_t_1;

  /* "View.MemoryView":932
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 *     cdef Py_ssize_t *shape = memslice.shape             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t *strides = memslice.strides
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->shape;
  __pyx_v_shape = __pyx_t_2;

  /* "View.MemoryView":933
 * 
 *     cdef Py_ssize_t *shape = memslice.shape
 *     cdef Py_ssize_t *strides = memslice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_v_memslice->strides;
  __pyx_v_strides = __pyx_t_2;

  /* "View.MemoryView":937
 * 
 *     cdef int i, j
 *     for i in range(ndim // 2):             # <<<<<<<<<<<<<<
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 */
  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":938
 *     cdef int i, j
 *     for i in range(ndim // 2):
 *         j = ndim - 1 - i             # <<<<<<<<<<<<<<
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]
 */
    __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);

    /* "View.MemoryView":939
 *     for i in range(ndim // 2):
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]             # <<<<<<<<<<<<<<
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 */
    __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
    __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
    (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
    (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;

    /* "View.MemoryView":940
 *         j = ndim - 1 - i
 *         strides[i], strides[j] = strides[j], strides[i]
 *         shape[i], shape[j] = shape[j], shape[i]             # <<<<<<<<<<<<<<
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 */
    __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
    __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
    (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
    (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;

    /* "View.MemoryView":942
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 */
    __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
    __pyx_t_7 = __pyx_t_8;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_7) {

      /* "View.MemoryView":943
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")             # <<<<<<<<<<<<<<
 * 
 *     return 0
 */
      __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 943, __pyx_L1_error)

      /* "View.MemoryView":942
 *         shape[i], shape[j] = shape[j], shape[i]
 * 
 *         if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:             # <<<<<<<<<<<<<<
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 */
    }
  }

  /* "View.MemoryView":945
 *             _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":929
 * 
 * @cname('__pyx_memslice_transpose')
 * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:             # <<<<<<<<<<<<<<
 *     cdef int ndim = memslice.memview.view.ndim
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":963
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
 */

/* Python wrapper */
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {

  /* "View.MemoryView":964
 * 
 *     def __dealloc__(self):
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)             # <<<<<<<<<<<<<<
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 */
  __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);

  /* "View.MemoryView":963
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
 */

  /* function exit code */
}

/* "View.MemoryView":966
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert_item_to_object", 1);

  /* "View.MemoryView":967
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":968
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)             # <<<<<<<<<<<<<<
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "View.MemoryView":967
 * 
 *     cdef convert_item_to_object(self, char *itemp):
 *         if self.to_object_func != NULL:             # <<<<<<<<<<<<<<
 *             return self.to_object_func(itemp)
 *         else:
 */
  }

  /* "View.MemoryView":970
 *             return self.to_object_func(itemp)
 *         else:
 *             return memoryview.convert_item_to_object(self, itemp)             # <<<<<<<<<<<<<<
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "View.MemoryView":966
 *         __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
 * 
 *     cdef convert_item_to_object(self, char *itemp):             # <<<<<<<<<<<<<<
 *         if self.to_object_func != NULL:
 *             return self.to_object_func(itemp)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":972
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("assign_item_from_object", 1);

  /* "View.MemoryView":973
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
  if (__pyx_t_1) {

    /* "View.MemoryView":974
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)             # <<<<<<<<<<<<<<
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)
 */
    __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 974, __pyx_L1_error)

    /* "View.MemoryView":973
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):
 *         if self.to_dtype_func != NULL:             # <<<<<<<<<<<<<<
 *             self.to_dtype_func(itemp, value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":976
 *             self.to_dtype_func(itemp, value)
 *         else:
 *             memoryview.assign_item_from_object(self, itemp, value)             # <<<<<<<<<<<<<<
 * 
 *     cdef _get_base(self):
 */
  /*else*/ {
    __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "View.MemoryView":972
 *             return memoryview.convert_item_to_object(self, itemp)
 * 
 *     cdef assign_item_from_object(self, char *itemp, object value):             # <<<<<<<<<<<<<<
 *         if self.to_dtype_func != NULL:
 *             self.to_dtype_func(itemp, value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":978
 *             memoryview.assign_item_from_object(self, itemp, value)
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
 */

static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_base", 1);

  /* "View.MemoryView":979
 * 
 *     cdef _get_base(self):
 *         return self.from_object             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->from_object);
  __pyx_r = __pyx_v_self->from_object;
  goto __pyx_L0;

  /* "View.MemoryView":978
 *             memoryview.assign_item_from_object(self, itemp, value)
 * 
 *     cdef _get_base(self):             # <<<<<<<<<<<<<<
 *         return self.from_object
 * 
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));

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

static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":999
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_suboffset;
  PyObject *__pyx_v_length = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_TypeInfo *__pyx_t_4;
  Py_buffer __pyx_t_5;
  Py_ssize_t *__pyx_t_6;
  Py_ssize_t *__pyx_t_7;
  Py_ssize_t *__pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_fromslice", 1);

  /* "View.MemoryView":1007
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
  if (__pyx_t_1) {

    /* "View.MemoryView":1008
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "View.MemoryView":1007
 *     cdef _memoryviewslice result
 * 
 *     if <PyObject *> memviewslice.memview == Py_None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "View.MemoryView":1013
 * 
 * 
 *     result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 *     result.from_slice = memviewslice
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(2, 1013, __pyx_L1_error);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(2, 1013, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "View.MemoryView":1015
 *     result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
 * 
 *     result.from_slice = memviewslice             # <<<<<<<<<<<<<<
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 */
  __pyx_v_result->from_slice = __pyx_v_memviewslice;

  /* "View.MemoryView":1016
 * 
 *     result.from_slice = memviewslice
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)             # <<<<<<<<<<<<<<
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()
 */
  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);

  /* "View.MemoryView":1018
 *     __PYX_INC_MEMVIEW(&memviewslice, 1)
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()             # <<<<<<<<<<<<<<
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->from_object);
  __Pyx_DECREF(__pyx_v_result->from_object);
  __pyx_v_result->from_object = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "View.MemoryView":1019
 * 
 *     result.from_object = (<memoryview> memviewslice.memview)._get_base()
 *     result.typeinfo = memviewslice.memview.typeinfo             # <<<<<<<<<<<<<<
 * 
 *     result.view = memviewslice.memview.view
 */
  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;

  /* "View.MemoryView":1021
 *     result.typeinfo = memviewslice.memview.typeinfo
 * 
 *     result.view = memviewslice.memview.view             # <<<<<<<<<<<<<<
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 */
  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
  __pyx_v_result->__pyx_base.view = __pyx_t_5;

  /* "View.MemoryView":1022
 * 
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data             # <<<<<<<<<<<<<<
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 */
  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);

  /* "View.MemoryView":1023
 *     result.view = memviewslice.memview.view
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim             # <<<<<<<<<<<<<<
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)
 */
  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;

  /* "View.MemoryView":1024
 *     result.view.buf = <void *> memviewslice.data
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None             # <<<<<<<<<<<<<<
 *     Py_INCREF(Py_None)
 * 
 */
  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;

  /* "View.MemoryView":1025
 *     result.view.ndim = ndim
 *     (<__pyx_buffer *> &result.view).obj = Py_None
 *     Py_INCREF(Py_None)             # <<<<<<<<<<<<<<
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
 */
  Py_INCREF(Py_None);

  /* "View.MemoryView":1027
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
 */
  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
  if (__pyx_t_1) {

    /* "View.MemoryView":1028
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
 *         result.flags = PyBUF_RECORDS             # <<<<<<<<<<<<<<
 *     else:
 *         result.flags = PyBUF_RECORDS_RO
 */
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;

    /* "View.MemoryView":1027
 *     Py_INCREF(Py_None)
 * 
 *     if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *         result.flags = PyBUF_RECORDS
 *     else:
 */
    goto __pyx_L4;
  }

  /* "View.MemoryView":1030
 *         result.flags = PyBUF_RECORDS
 *     else:
 *         result.flags = PyBUF_RECORDS_RO             # <<<<<<<<<<<<<<
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 */
  /*else*/ {
    __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
  }
  __pyx_L4:;

  /* "View.MemoryView":1032
 *         result.flags = PyBUF_RECORDS_RO
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape             # <<<<<<<<<<<<<<
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides
 * 
 */
  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);

  /* "View.MemoryView":1033
 * 
 *     result.view.shape = <Py_ssize_t *> result.from_slice.shape
 *     result.view.strides = <Py_ssize_t *> result.from_slice.strides             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);

  /* "View.MemoryView":1036
 * 
 * 
 *     result.view.suboffsets = NULL             # <<<<<<<<<<<<<<
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 */
  __pyx_v_result->__pyx_base.view.suboffsets = NULL;

  /* "View.MemoryView":1037
 * 
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:             # <<<<<<<<<<<<<<
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 */
  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_v_suboffset = (__pyx_t_6[0]);

    /* "View.MemoryView":1038
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
 */
    __pyx_t_1 = (__pyx_v_suboffset >= 0);
    if (__pyx_t_1) {

      /* "View.MemoryView":1039
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);

      /* "View.MemoryView":1040
 *         if suboffset >= 0:
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break             # <<<<<<<<<<<<<<
 * 
 *     result.view.len = result.view.itemsize
 */
      goto __pyx_L6_break;

      /* "View.MemoryView":1038
 *     result.view.suboffsets = NULL
 *     for suboffset in result.from_slice.suboffsets[:ndim]:
 *         if suboffset >= 0:             # <<<<<<<<<<<<<<
 *             result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
 *             break
 */
    }
  }
  __pyx_L6_break:;

  /* "View.MemoryView":1042
 *             break
 * 
 *     result.view.len = result.view.itemsize             # <<<<<<<<<<<<<<
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length
 */
  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;

  /* "View.MemoryView":1043
 * 
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         result.view.len *= length
 * 
 */
  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
    __pyx_t_6 = __pyx_t_8;
    __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1043, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":1044
 *     result.view.len = result.view.itemsize
 *     for length in result.view.shape[:ndim]:
 *         result.view.len *= length             # <<<<<<<<<<<<<<
 * 
 *     result.to_object_func = to_object_func
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1044, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1044, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
  }

  /* "View.MemoryView":1046
 *         result.view.len *= length
 * 
 *     result.to_object_func = to_object_func             # <<<<<<<<<<<<<<
 *     result.to_dtype_func = to_dtype_func
 * 
 */
  __pyx_v_result->to_object_func = __pyx_v_to_object_func;

  /* "View.MemoryView":1047
 * 
 *     result.to_object_func = to_object_func
 *     result.to_dtype_func = to_dtype_func             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;

  /* "View.MemoryView":1049
 *     result.to_dtype_func = to_dtype_func
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "View.MemoryView":999
 * 
 * @cname('__pyx_memoryview_fromslice')
 * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice,             # <<<<<<<<<<<<<<
 *                           int ndim,
 *                           object (*to_object_func)(char *),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_length);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1052
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 */

static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
  __Pyx_memviewslice *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_slice_from_memview", 1);

  /* "View.MemoryView":1055
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":1056
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview             # <<<<<<<<<<<<<<
 *         return &obj.from_slice
 *     else:
 */
    if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1056, __pyx_L1_error)
    __pyx_t_2 = ((PyObject *)__pyx_v_memview);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "View.MemoryView":1057
 *     if isinstance(memview, _memoryviewslice):
 *         obj = memview
 *         return &obj.from_slice             # <<<<<<<<<<<<<<
 *     else:
 *         slice_copy(memview, mslice)
 */
    __pyx_r = (&__pyx_v_obj->from_slice);
    goto __pyx_L0;

    /* "View.MemoryView":1055
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         obj = memview
 *         return &obj.from_slice
 */
  }

  /* "View.MemoryView":1059
 *         return &obj.from_slice
 *     else:
 *         slice_copy(memview, mslice)             # <<<<<<<<<<<<<<
 *         return mslice
 * 
 */
  /*else*/ {
    __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);

    /* "View.MemoryView":1060
 *     else:
 *         slice_copy(memview, mslice)
 *         return mslice             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_slice_copy')
 */
    __pyx_r = __pyx_v_mslice;
    goto __pyx_L0;
  }

  /* "View.MemoryView":1052
 * 
 * @cname('__pyx_memoryview_get_slice_from_memoryview')
 * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview,             # <<<<<<<<<<<<<<
 *                                                    __Pyx_memviewslice *mslice) except NULL:
 *     cdef _memoryviewslice obj
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1063
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 */

static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
  int __pyx_v_dim;
  Py_ssize_t *__pyx_v_shape;
  Py_ssize_t *__pyx_v_strides;
  Py_ssize_t *__pyx_v_suboffsets;
  Py_ssize_t *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;

  /* "View.MemoryView":1067
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 * 
 *     shape = memview.view.shape             # <<<<<<<<<<<<<<
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets
 */
  __pyx_t_1 = __pyx_v_memview->view.shape;
  __pyx_v_shape = __pyx_t_1;

  /* "View.MemoryView":1068
 * 
 *     shape = memview.view.shape
 *     strides = memview.view.strides             # <<<<<<<<<<<<<<
 *     suboffsets = memview.view.suboffsets
 * 
 */
  __pyx_t_1 = __pyx_v_memview->view.strides;
  __pyx_v_strides = __pyx_t_1;

  /* "View.MemoryView":1069
 *     shape = memview.view.shape
 *     strides = memview.view.strides
 *     suboffsets = memview.view.suboffsets             # <<<<<<<<<<<<<<
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 */
  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
  __pyx_v_suboffsets = __pyx_t_1;

  /* "View.MemoryView":1071
 *     suboffsets = memview.view.suboffsets
 * 
 *     dst.memview = <__pyx_memoryview *> memview             # <<<<<<<<<<<<<<
 *     dst.data = <char *> memview.view.buf
 * 
 */
  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);

  /* "View.MemoryView":1072
 * 
 *     dst.memview = <__pyx_memoryview *> memview
 *     dst.data = <char *> memview.view.buf             # <<<<<<<<<<<<<<
 * 
 *     for dim in range(memview.view.ndim):
 */
  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);

  /* "View.MemoryView":1074
 *     dst.data = <char *> memview.view.buf
 * 
 *     for dim in range(memview.view.ndim):             # <<<<<<<<<<<<<<
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 */
  __pyx_t_2 = __pyx_v_memview->view.ndim;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_dim = __pyx_t_4;

    /* "View.MemoryView":1075
 * 
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]             # <<<<<<<<<<<<<<
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 */
    (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);

    /* "View.MemoryView":1076
 *     for dim in range(memview.view.ndim):
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]             # <<<<<<<<<<<<<<
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
 * 
 */
    (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);

    /* "View.MemoryView":1077
 *         dst.shape[dim] = shape[dim]
 *         dst.strides[dim] = strides[dim]
 *         dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object')
 */
    __pyx_t_6 = (__pyx_v_suboffsets != 0);
    if (__pyx_t_6) {
      __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
    } else {
      __pyx_t_5 = -1L;
    }
    (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
  }

  /* "View.MemoryView":1063
 * 
 * @cname('__pyx_memoryview_slice_copy')
 * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept:             # <<<<<<<<<<<<<<
 *     cdef int dim
 *     cdef (Py_ssize_t*) shape, strides, suboffsets
 */

  /* function exit code */
}

/* "View.MemoryView":1080
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
  __Pyx_memviewslice __pyx_v_memviewslice;
  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("memoryview_copy", 1);

  /* "View.MemoryView":1083
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)             # <<<<<<<<<<<<<<
 *     return memoryview_copy_from_slice(memview, &memviewslice)
 * 
 */
  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));

  /* "View.MemoryView":1084
 *     cdef __Pyx_memviewslice memviewslice
 *     slice_copy(memview, &memviewslice)
 *     return memoryview_copy_from_slice(memview, &memviewslice)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1080
 * 
 * @cname('__pyx_memoryview_copy_object')
 * cdef memoryview_copy(memoryview memview):             # <<<<<<<<<<<<<<
 *     "Create a new memoryview object"
 *     cdef __Pyx_memviewslice memviewslice
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1087
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
  PyObject *(*__pyx_v_to_object_func)(char *);
  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *(*__pyx_t_2)(char *);
  int (*__pyx_t_3)(char *, PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1);

  /* "View.MemoryView":1094
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type); 
  if (__pyx_t_1) {

    /* "View.MemoryView":1095
 * 
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func             # <<<<<<<<<<<<<<
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 */
    __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
    __pyx_v_to_object_func = __pyx_t_2;

    /* "View.MemoryView":1096
 *     if isinstance(memview, _memoryviewslice):
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func             # <<<<<<<<<<<<<<
 *     else:
 *         to_object_func = NULL
 */
    __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
    __pyx_v_to_dtype_func = __pyx_t_3;

    /* "View.MemoryView":1094
 *     cdef int (*to_dtype_func)(char *, object) except 0
 * 
 *     if isinstance(memview, _memoryviewslice):             # <<<<<<<<<<<<<<
 *         to_object_func = (<_memoryviewslice> memview).to_object_func
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1098
 *         to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
 *     else:
 *         to_object_func = NULL             # <<<<<<<<<<<<<<
 *         to_dtype_func = NULL
 * 
 */
  /*else*/ {
    __pyx_v_to_object_func = NULL;

    /* "View.MemoryView":1099
 *     else:
 *         to_object_func = NULL
 *         to_dtype_func = NULL             # <<<<<<<<<<<<<<
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 */
    __pyx_v_to_dtype_func = NULL;
  }
  __pyx_L3:;

  /* "View.MemoryView":1101
 *         to_dtype_func = NULL
 * 
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,             # <<<<<<<<<<<<<<
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "View.MemoryView":1103
 *     return memoryview_fromslice(memviewslice[0], memview.view.ndim,
 *                                 to_object_func, to_dtype_func,
 *                                 memview.dtype_is_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1087
 * 
 * @cname('__pyx_memoryview_copy_object_from_slice')
 * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice):             # <<<<<<<<<<<<<<
 *     """
 *     Create a new memoryview object from a given memoryview object and slice.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "View.MemoryView":1109
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:             # <<<<<<<<<<<<<<
 *     return -arg if arg < 0 else arg
 * 
 */

static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;

  /* "View.MemoryView":1110
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
 *     return -arg if arg < 0 else arg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_get_best_slice_order')
 */
  __pyx_t_2 = (__pyx_v_arg < 0);
  if (__pyx_t_2) {
    __pyx_t_1 = (-__pyx_v_arg);
  } else {
    __pyx_t_1 = __pyx_v_arg;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "View.MemoryView":1109
 * 
 * 
 * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:             # <<<<<<<<<<<<<<
 *     return -arg if arg < 0 else arg
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1113
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
  int __pyx_v_i;
  Py_ssize_t __pyx_v_c_stride;
  Py_ssize_t __pyx_v_f_stride;
  char __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1118
 *     """
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t f_stride = 0
 * 
 */
  __pyx_v_c_stride = 0;

  /* "View.MemoryView":1119
 *     cdef int i
 *     cdef Py_ssize_t c_stride = 0
 *     cdef Py_ssize_t f_stride = 0             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_f_stride = 0;

  /* "View.MemoryView":1121
 *     cdef Py_ssize_t f_stride = 0
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1122
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1123
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1124
 *         if mslice.shape[i] > 1:
 *             c_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
      goto __pyx_L4_break;

      /* "View.MemoryView":1122
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             c_stride = mslice.strides[i]
 *             break
 */
    }
  }
  __pyx_L4_break:;

  /* "View.MemoryView":1126
 *             break
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 */
  __pyx_t_1 = __pyx_v_ndim;
  __pyx_t_3 = __pyx_t_1;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "View.MemoryView":1127
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
 */
    __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1128
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]             # <<<<<<<<<<<<<<
 *             break
 * 
 */
      __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);

      /* "View.MemoryView":1129
 *         if mslice.shape[i] > 1:
 *             f_stride = mslice.strides[i]
 *             break             # <<<<<<<<<<<<<<
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 */
      goto __pyx_L7_break;

      /* "View.MemoryView":1127
 * 
 *     for i in range(ndim):
 *         if mslice.shape[i] > 1:             # <<<<<<<<<<<<<<
 *             f_stride = mslice.strides[i]
 *             break
 */
    }
  }
  __pyx_L7_break:;

  /* "View.MemoryView":1131
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
 */
  __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
  if (__pyx_t_2) {

    /* "View.MemoryView":1132
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
 *         return 'C'             # <<<<<<<<<<<<<<
 *     else:
 *         return 'F'
 */
    __pyx_r = 'C';
    goto __pyx_L0;

    /* "View.MemoryView":1131
 *             break
 * 
 *     if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):             # <<<<<<<<<<<<<<
 *         return 'C'
 *     else:
 */
  }

  /* "View.MemoryView":1134
 *         return 'C'
 *     else:
 *         return 'F'             # <<<<<<<<<<<<<<
 * 
 * @cython.cdivision(True)
 */
  /*else*/ {
    __pyx_r = 'F';
    goto __pyx_L0;
  }

  /* "View.MemoryView":1113
 * 
 * @cname('__pyx_get_best_slice_order')
 * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil:             # <<<<<<<<<<<<<<
 *     """
 *     Figure out the best memory access order for a given slice.
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1137
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
  Py_ssize_t __pyx_v_dst_extent;
  Py_ssize_t __pyx_v_src_stride;
  Py_ssize_t __pyx_v_dst_stride;
  int __pyx_t_1;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;

  /* "View.MemoryView":1144
 * 
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 */
  __pyx_v_src_extent = (__pyx_v_src_shape[0]);

  /* "View.MemoryView":1145
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 */
  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);

  /* "View.MemoryView":1146
 *     cdef Py_ssize_t src_extent = src_shape[0]
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 */
  __pyx_v_src_stride = (__pyx_v_src_strides[0]);

  /* "View.MemoryView":1147
 *     cdef Py_ssize_t dst_extent = dst_shape[0]
 *     cdef Py_ssize_t src_stride = src_strides[0]
 *     cdef Py_ssize_t dst_stride = dst_strides[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);

  /* "View.MemoryView":1149
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if (src_stride > 0 and dst_stride > 0 and
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 */
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1150
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 */
    __pyx_t_2 = (__pyx_v_src_stride > 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_dst_stride > 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }

    /* "View.MemoryView":1151
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):             # <<<<<<<<<<<<<<
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 *         else:
 */
    __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
    if (__pyx_t_2) {
      __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
    }
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;

    /* "View.MemoryView":1150
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 */
    if (__pyx_t_1) {

      /* "View.MemoryView":1152
 *         if (src_stride > 0 and dst_stride > 0 and
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)             # <<<<<<<<<<<<<<
 *         else:
 *             for i in range(dst_extent):
 */
      (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));

      /* "View.MemoryView":1150
 * 
 *     if ndim == 1:
 *         if (src_stride > 0 and dst_stride > 0 and             # <<<<<<<<<<<<<<
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 */
      goto __pyx_L4;
    }

    /* "View.MemoryView":1154
 *             memcpy(dst_data, src_data, itemsize * dst_extent)
 *         else:
 *             for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride
 */
    /*else*/ {
      __pyx_t_3 = __pyx_v_dst_extent;
      __pyx_t_4 = __pyx_t_3;
      for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
        __pyx_v_i = __pyx_t_5;

        /* "View.MemoryView":1155
 *         else:
 *             for i in range(dst_extent):
 *                 memcpy(dst_data, src_data, itemsize)             # <<<<<<<<<<<<<<
 *                 src_data += src_stride
 *                 dst_data += dst_stride
 */
        (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));

        /* "View.MemoryView":1156
 *             for i in range(dst_extent):
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride             # <<<<<<<<<<<<<<
 *                 dst_data += dst_stride
 *     else:
 */
        __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

        /* "View.MemoryView":1157
 *                 memcpy(dst_data, src_data, itemsize)
 *                 src_data += src_stride
 *                 dst_data += dst_stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(dst_extent):
 */
        __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
      }
    }
    __pyx_L4:;

    /* "View.MemoryView":1149
 *     cdef Py_ssize_t dst_stride = dst_strides[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         if (src_stride > 0 and dst_stride > 0 and
 *             <size_t> src_stride == itemsize == <size_t> dst_stride):
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1159
 *                 dst_data += dst_stride
 *     else:
 *         for i in range(dst_extent):             # <<<<<<<<<<<<<<
 *             _copy_strided_to_strided(src_data, src_strides + 1,
 *                                      dst_data, dst_strides + 1,
 */
  /*else*/ {
    __pyx_t_3 = __pyx_v_dst_extent;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "View.MemoryView":1160
 *     else:
 *         for i in range(dst_extent):
 *             _copy_strided_to_strided(src_data, src_strides + 1,             # <<<<<<<<<<<<<<
 *                                      dst_data, dst_strides + 1,
 *                                      src_shape + 1, dst_shape + 1,
 */
      _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);

      /* "View.MemoryView":1164
 *                                      src_shape + 1, dst_shape + 1,
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride             # <<<<<<<<<<<<<<
 *             dst_data += dst_stride
 * 
 */
      __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);

      /* "View.MemoryView":1165
 *                                      ndim - 1, itemsize)
 *             src_data += src_stride
 *             dst_data += dst_stride             # <<<<<<<<<<<<<<
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
 */
      __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1137
 * 
 * @cython.cdivision(True)
 * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides,             # <<<<<<<<<<<<<<
 *                                    char *dst_data, Py_ssize_t *dst_strides,
 *                                    Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
 */

  /* function exit code */
}

/* "View.MemoryView":1167
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
 */

static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {

  /* "View.MemoryView":1170
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
 *     _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,             # <<<<<<<<<<<<<<
 *                              src.shape, dst.shape, ndim, itemsize)
 * 
 */
  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1167
 *             dst_data += dst_stride
 * 
 * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice *dst,
 *                                   int ndim, size_t itemsize) noexcept nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1174
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
 */

static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
  Py_ssize_t __pyx_v_shape;
  Py_ssize_t __pyx_v_size;
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t *__pyx_t_2;
  Py_ssize_t *__pyx_t_3;
  Py_ssize_t *__pyx_t_4;

  /* "View.MemoryView":1176
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 * 
 *     for shape in src.shape[:ndim]:
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_size = __pyx_t_1;

  /* "View.MemoryView":1178
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
 * 
 *     for shape in src.shape[:ndim]:             # <<<<<<<<<<<<<<
 *         size *= shape
 * 
 */
  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
    __pyx_t_2 = __pyx_t_4;
    __pyx_v_shape = (__pyx_t_2[0]);

    /* "View.MemoryView":1179
 * 
 *     for shape in src.shape[:ndim]:
 *         size *= shape             # <<<<<<<<<<<<<<
 * 
 *     return size
 */
    __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
  }

  /* "View.MemoryView":1181
 *         size *= shape
 * 
 *     return size             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_fill_contig_strides_array')
 */
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;

  /* "View.MemoryView":1174
 * 
 * @cname('__pyx_memoryview_slice_get_size')
 * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:             # <<<<<<<<<<<<<<
 *     "Return the size of the memory occupied by the slice in number of bytes"
 *     cdef Py_ssize_t shape, size = src.memview.view.itemsize
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1184
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) noexcept nogil:
 */

static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
  int __pyx_v_idx;
  Py_ssize_t __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1193
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
 */
  __pyx_t_1 = (__pyx_v_order == 'F');
  if (__pyx_t_1) {

    /* "View.MemoryView":1194
 * 
 *     if order == 'F':
 *         for idx in range(ndim):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride *= shape[idx]
 */
    __pyx_t_2 = __pyx_v_ndim;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_idx = __pyx_t_4;

      /* "View.MemoryView":1195
 *     if order == 'F':
 *         for idx in range(ndim):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride *= shape[idx]
 *     else:
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1196
 *         for idx in range(ndim):
 *             strides[idx] = stride
 *             stride *= shape[idx]             # <<<<<<<<<<<<<<
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }

    /* "View.MemoryView":1193
 *     cdef int idx
 * 
 *     if order == 'F':             # <<<<<<<<<<<<<<
 *         for idx in range(ndim):
 *             strides[idx] = stride
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1198
 *             stride *= shape[idx]
 *     else:
 *         for idx in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *             strides[idx] = stride
 *             stride *= shape[idx]
 */
  /*else*/ {
    for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
      __pyx_v_idx = __pyx_t_2;

      /* "View.MemoryView":1199
 *     else:
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride             # <<<<<<<<<<<<<<
 *             stride *= shape[idx]
 * 
 */
      (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;

      /* "View.MemoryView":1200
 *         for idx in range(ndim - 1, -1, -1):
 *             strides[idx] = stride
 *             stride *= shape[idx]             # <<<<<<<<<<<<<<
 * 
 *     return stride
 */
      __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1202
 *             stride *= shape[idx]
 * 
 *     return stride             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 */
  __pyx_r = __pyx_v_stride;
  goto __pyx_L0;

  /* "View.MemoryView":1184
 * 
 * @cname('__pyx_fill_contig_strides_array')
 * cdef Py_ssize_t fill_contig_strides_array(             # <<<<<<<<<<<<<<
 *                 Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
 *                 int ndim, char order) noexcept nogil:
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1205
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
  int __pyx_v_i;
  void *__pyx_v_result;
  size_t __pyx_v_itemsize;
  size_t __pyx_v_size;
  void *__pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  struct __pyx_memoryview_obj *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "View.MemoryView":1216
 *     cdef void *result
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 */
  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1217
 * 
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef size_t size = slice_get_size(src, ndim)             # <<<<<<<<<<<<<<
 * 
 *     result = malloc(size)
 */
  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);

  /* "View.MemoryView":1219
 *     cdef size_t size = slice_get_size(src, ndim)
 * 
 *     result = malloc(size)             # <<<<<<<<<<<<<<
 *     if not result:
 *         _err_no_memory()
 */
  __pyx_v_result = malloc(__pyx_v_size);

  /* "View.MemoryView":1220
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err_no_memory()
 * 
 */
  __pyx_t_2 = (!(__pyx_v_result != 0));
  if (__pyx_t_2) {

    /* "View.MemoryView":1221
 *     result = malloc(size)
 *     if not result:
 *         _err_no_memory()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1221, __pyx_L1_error)

    /* "View.MemoryView":1220
 * 
 *     result = malloc(size)
 *     if not result:             # <<<<<<<<<<<<<<
 *         _err_no_memory()
 * 
 */
  }

  /* "View.MemoryView":1224
 * 
 * 
 *     tmpslice.data = <char *> result             # <<<<<<<<<<<<<<
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 */
  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);

  /* "View.MemoryView":1225
 * 
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview             # <<<<<<<<<<<<<<
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 */
  __pyx_t_4 = __pyx_v_src->memview;
  __pyx_v_tmpslice->memview = __pyx_t_4;

  /* "View.MemoryView":1226
 *     tmpslice.data = <char *> result
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1
 */
  __pyx_t_3 = __pyx_v_ndim;
  __pyx_t_5 = __pyx_t_3;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":1227
 *     tmpslice.memview = src.memview
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]             # <<<<<<<<<<<<<<
 *         tmpslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);

    /* "View.MemoryView":1228
 *     for i in range(ndim):
 *         tmpslice.shape[i] = src.shape[i]
 *         tmpslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
 */
    (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1230
 *         tmpslice.suboffsets[i] = -1
 * 
 *     fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));

  /* "View.MemoryView":1233
 * 
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0
 */
  __pyx_t_3 = __pyx_v_ndim;
  __pyx_t_5 = __pyx_t_3;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "View.MemoryView":1234
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
 */
    __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
    if (__pyx_t_2) {

      /* "View.MemoryView":1235
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:
 *             tmpslice.strides[i] = 0             # <<<<<<<<<<<<<<
 * 
 *     if slice_is_contig(src[0], order, ndim):
 */
      (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;

      /* "View.MemoryView":1234
 * 
 *     for i in range(ndim):
 *         if tmpslice.shape[i] == 1:             # <<<<<<<<<<<<<<
 *             tmpslice.strides[i] = 0
 * 
 */
    }
  }

  /* "View.MemoryView":1237
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
 */
  __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1238
 * 
 *     if slice_is_contig(src[0], order, ndim):
 *         memcpy(result, src.data, size)             # <<<<<<<<<<<<<<
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 */
    (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));

    /* "View.MemoryView":1237
 *             tmpslice.strides[i] = 0
 * 
 *     if slice_is_contig(src[0], order, ndim):             # <<<<<<<<<<<<<<
 *         memcpy(result, src.data, size)
 *     else:
 */
    goto __pyx_L9;
  }

  /* "View.MemoryView":1240
 *         memcpy(result, src.data, size)
 *     else:
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  /*else*/ {
    copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
  }
  __pyx_L9:;

  /* "View.MemoryView":1242
 *         copy_strided_to_strided(src, tmpslice, ndim, itemsize)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "View.MemoryView":1205
 * 
 * @cname('__pyx_memoryview_copy_data_to_temp')
 * cdef void *copy_data_to_temp(__Pyx_memviewslice *src,             # <<<<<<<<<<<<<<
 *                              __Pyx_memviewslice *tmpslice,
 *                              char order,
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1247
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
 */

static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_extents", 0);

  /* "View.MemoryView":1249
 * cdef int _err_extents(int i, Py_ssize_t extent1,
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_dim')
 */
  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi);
  __pyx_t_2 += 35;
  __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi);
  __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_got);
  __pyx_t_2 += 6;
  __Pyx_GIVEREF(__pyx_kp_u_got);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got);
  __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_and);
  __pyx_t_2 += 5;
  __Pyx_GIVEREF(__pyx_kp_u_and);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and);
  __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__9);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__9);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__9);
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __PYX_ERR(2, 1249, __pyx_L1_error)

  /* "View.MemoryView":1247
 * 
 * @cname('__pyx_memoryview_err_extents')
 * cdef int _err_extents(int i, Py_ssize_t extent1,             # <<<<<<<<<<<<<<
 *                              Py_ssize_t extent2) except -1 with gil:
 *     raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1252
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise <object>error, msg % dim
 * 
 */

static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err_dim", 0);
  __Pyx_INCREF(__pyx_v_msg);

  /* "View.MemoryView":1253
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
 *     raise <object>error, msg % dim             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err')
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __PYX_ERR(2, 1253, __pyx_L1_error)

  /* "View.MemoryView":1252
 * 
 * @cname('__pyx_memoryview_err_dim')
 * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise <object>error, msg % dim
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1256
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(PyObject *error, str msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise <object>error, msg
 * 
 */

static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_err", 0);
  __Pyx_INCREF(__pyx_v_msg);

  /* "View.MemoryView":1257
 * @cname('__pyx_memoryview_err')
 * cdef int _err(PyObject *error, str msg) except -1 with gil:
 *     raise <object>error, msg             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_err_no_memory')
 */
  __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
  __PYX_ERR(2, 1257, __pyx_L1_error)

  /* "View.MemoryView":1256
 * 
 * @cname('__pyx_memoryview_err')
 * cdef int _err(PyObject *error, str msg) except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise <object>error, msg
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1260
 * 
 * @cname('__pyx_memoryview_err_no_memory')
 * cdef int _err_no_memory() except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise MemoryError
 * 
 */

static int __pyx_memoryview_err_no_memory(void) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif

  /* "View.MemoryView":1261
 * @cname('__pyx_memoryview_err_no_memory')
 * cdef int _err_no_memory() except -1 with gil:
 *     raise MemoryError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  PyErr_NoMemory(); __PYX_ERR(2, 1261, __pyx_L1_error)

  /* "View.MemoryView":1260
 * 
 * @cname('__pyx_memoryview_err_no_memory')
 * cdef int _err_no_memory() except -1 with gil:             # <<<<<<<<<<<<<<
 *     raise MemoryError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "View.MemoryView":1265
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
  void *__pyx_v_tmpdata;
  size_t __pyx_v_itemsize;
  int __pyx_v_i;
  char __pyx_v_order;
  int __pyx_v_broadcasting;
  int __pyx_v_direct_copy;
  __Pyx_memviewslice __pyx_v_tmp;
  int __pyx_v_ndim;
  int __pyx_r;
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  void *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save;
  #endif

  /* "View.MemoryView":1273
 *     Check for overlapping memory and verify the shapes.
 *     """
 *     cdef void *tmpdata = NULL             # <<<<<<<<<<<<<<
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 */
  __pyx_v_tmpdata = NULL;

  /* "View.MemoryView":1274
 *     """
 *     cdef void *tmpdata = NULL
 *     cdef size_t itemsize = src.memview.view.itemsize             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 */
  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
  __pyx_v_itemsize = __pyx_t_1;

  /* "View.MemoryView":1276
 *     cdef size_t itemsize = src.memview.view.itemsize
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)             # <<<<<<<<<<<<<<
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False
 */
  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);

  /* "View.MemoryView":1277
 *     cdef int i
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False             # <<<<<<<<<<<<<<
 *     cdef bint direct_copy = False
 *     cdef __Pyx_memviewslice tmp
 */
  __pyx_v_broadcasting = 0;

  /* "View.MemoryView":1278
 *     cdef char order = get_best_order(&src, src_ndim)
 *     cdef bint broadcasting = False
 *     cdef bint direct_copy = False             # <<<<<<<<<<<<<<
 *     cdef __Pyx_memviewslice tmp
 * 
 */
  __pyx_v_direct_copy = 0;

  /* "View.MemoryView":1281
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 */
  __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1282
 * 
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);

    /* "View.MemoryView":1281
 *     cdef __Pyx_memviewslice tmp
 * 
 *     if src_ndim < dst_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1283
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 */
  __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
  if (__pyx_t_2) {

    /* "View.MemoryView":1284
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:
 *         broadcast_leading(&dst, dst_ndim, src_ndim)             # <<<<<<<<<<<<<<
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)
 */
    __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);

    /* "View.MemoryView":1283
 *     if src_ndim < dst_ndim:
 *         broadcast_leading(&src, src_ndim, dst_ndim)
 *     elif dst_ndim < src_ndim:             # <<<<<<<<<<<<<<
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 */
  }
  __pyx_L3:;

  /* "View.MemoryView":1286
 *         broadcast_leading(&dst, dst_ndim, src_ndim)
 * 
 *     cdef int ndim = max(src_ndim, dst_ndim)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim):
 */
  __pyx_t_3 = __pyx_v_dst_ndim;
  __pyx_t_4 = __pyx_v_src_ndim;
  __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
  if (__pyx_t_2) {
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  __pyx_v_ndim = __pyx_t_5;

  /* "View.MemoryView":1288
 *     cdef int ndim = max(src_ndim, dst_ndim)
 * 
 *     for i in range(ndim):             # <<<<<<<<<<<<<<
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 */
  __pyx_t_5 = __pyx_v_ndim;
  __pyx_t_3 = __pyx_t_5;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "View.MemoryView":1289
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 */
    __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
    if (__pyx_t_2) {

      /* "View.MemoryView":1290
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
 */
      __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
      if (__pyx_t_2) {

        /* "View.MemoryView":1291
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:
 *                 broadcasting = True             # <<<<<<<<<<<<<<
 *                 src.strides[i] = 0
 *             else:
 */
        __pyx_v_broadcasting = 1;

        /* "View.MemoryView":1292
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 *                 src.strides[i] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 */
        (__pyx_v_src.strides[__pyx_v_i]) = 0;

        /* "View.MemoryView":1290
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:
 *             if src.shape[i] == 1:             # <<<<<<<<<<<<<<
 *                 broadcasting = True
 *                 src.strides[i] = 0
 */
        goto __pyx_L7;
      }

      /* "View.MemoryView":1294
 *                 src.strides[i] = 0
 *             else:
 *                 _err_extents(i, dst.shape[i], src.shape[i])             # <<<<<<<<<<<<<<
 * 
 *         if src.suboffsets[i] >= 0:
 */
      /*else*/ {
        __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1294, __pyx_L1_error)
      }
      __pyx_L7:;

      /* "View.MemoryView":1289
 * 
 *     for i in range(ndim):
 *         if src.shape[i] != dst.shape[i]:             # <<<<<<<<<<<<<<
 *             if src.shape[i] == 1:
 *                 broadcasting = True
 */
    }

    /* "View.MemoryView":1296
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
 */
    __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
    if (__pyx_t_2) {

      /* "View.MemoryView":1297
 * 
 *         if src.suboffsets[i] >= 0:
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)             # <<<<<<<<<<<<<<
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 */
      __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(2, 1297, __pyx_L1_error)

      /* "View.MemoryView":1296
 *                 _err_extents(i, dst.shape[i], src.shape[i])
 * 
 *         if src.suboffsets[i] >= 0:             # <<<<<<<<<<<<<<
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
 */
    }
  }

  /* "View.MemoryView":1299
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
 */
  __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
  if (__pyx_t_2) {

    /* "View.MemoryView":1301
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
 */
    __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
    if (__pyx_t_2) {

      /* "View.MemoryView":1302
 * 
 *         if not slice_is_contig(src, order, ndim):
 *             order = get_best_order(&dst, ndim)             # <<<<<<<<<<<<<<
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 */
      __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);

      /* "View.MemoryView":1301
 *     if slices_overlap(&src, &dst, ndim, itemsize):
 * 
 *         if not slice_is_contig(src, order, ndim):             # <<<<<<<<<<<<<<
 *             order = get_best_order(&dst, ndim)
 * 
 */
    }

    /* "View.MemoryView":1304
 *             order = get_best_order(&dst, ndim)
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)             # <<<<<<<<<<<<<<
 *         src = tmp
 * 
 */
    __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(2, 1304, __pyx_L1_error)
    __pyx_v_tmpdata = __pyx_t_7;

    /* "View.MemoryView":1305
 * 
 *         tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
 *         src = tmp             # <<<<<<<<<<<<<<
 * 
 *     if not broadcasting:
 */
    __pyx_v_src = __pyx_v_tmp;

    /* "View.MemoryView":1299
 *             _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
 * 
 *     if slices_overlap(&src, &dst, ndim, itemsize):             # <<<<<<<<<<<<<<
 * 
 *         if not slice_is_contig(src, order, ndim):
 */
  }

  /* "View.MemoryView":1307
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (!__pyx_v_broadcasting);
  if (__pyx_t_2) {

    /* "View.MemoryView":1310
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 */
    __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
    if (__pyx_t_2) {

      /* "View.MemoryView":1311
 * 
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)             # <<<<<<<<<<<<<<
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);

      /* "View.MemoryView":1310
 * 
 * 
 *         if slice_is_contig(src, 'C', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 */
      goto __pyx_L12;
    }

    /* "View.MemoryView":1312
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 */
    __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
    if (__pyx_t_2) {

      /* "View.MemoryView":1313
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):
 *             direct_copy = slice_is_contig(dst, 'F', ndim)             # <<<<<<<<<<<<<<
 * 
 *         if direct_copy:
 */
      __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);

      /* "View.MemoryView":1312
 *         if slice_is_contig(src, 'C', ndim):
 *             direct_copy = slice_is_contig(dst, 'C', ndim)
 *         elif slice_is_contig(src, 'F', ndim):             # <<<<<<<<<<<<<<
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 */
    }
    __pyx_L12:;

    /* "View.MemoryView":1315
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 */
    if (__pyx_v_direct_copy) {

      /* "View.MemoryView":1317
 *         if direct_copy:
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

      /* "View.MemoryView":1318
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))             # <<<<<<<<<<<<<<
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)
 */
      (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));

      /* "View.MemoryView":1319
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 *             free(tmpdata)
 *             return 0
 */
      __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

      /* "View.MemoryView":1320
 *             memcpy(dst.data, src.data, slice_get_size(&src, ndim))
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)             # <<<<<<<<<<<<<<
 *             return 0
 * 
 */
      free(__pyx_v_tmpdata);

      /* "View.MemoryView":1321
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 *             free(tmpdata)
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):
 */
      __pyx_r = 0;
      goto __pyx_L0;

      /* "View.MemoryView":1315
 *             direct_copy = slice_is_contig(dst, 'F', ndim)
 * 
 *         if direct_copy:             # <<<<<<<<<<<<<<
 * 
 *             refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 */
    }

    /* "View.MemoryView":1307
 *         src = tmp
 * 
 *     if not broadcasting:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }

  /* "View.MemoryView":1323
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (__pyx_v_order == 'F');
  if (__pyx_t_2) {
    __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
  }
  if (__pyx_t_2) {

    /* "View.MemoryView":1326
 * 
 * 
 *         transpose_memslice(&src)             # <<<<<<<<<<<<<<
 *         transpose_memslice(&dst)
 * 
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 1326, __pyx_L1_error)

    /* "View.MemoryView":1327
 * 
 *         transpose_memslice(&src)
 *         transpose_memslice(&dst)             # <<<<<<<<<<<<<<
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 */
    __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 1327, __pyx_L1_error)

    /* "View.MemoryView":1323
 *             return 0
 * 
 *     if order == 'F' == get_best_order(&dst, ndim):             # <<<<<<<<<<<<<<
 * 
 * 
 */
  }

  /* "View.MemoryView":1329
 *         transpose_memslice(&dst)
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1330
 * 
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)             # <<<<<<<<<<<<<<
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 * 
 */
  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);

  /* "View.MemoryView":1331
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=False)
 *     copy_strided_to_strided(&src, &dst, ndim, itemsize)
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 * 
 *     free(tmpdata)
 */
  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1333
 *     refcount_copying(&dst, dtype_is_object, ndim, inc=True)
 * 
 *     free(tmpdata)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  free(__pyx_v_tmpdata);

  /* "View.MemoryView":1334
 * 
 *     free(tmpdata)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "View.MemoryView":1265
 * 
 * @cname('__pyx_memoryview_copy_contents')
 * cdef int memoryview_copy_contents(__Pyx_memviewslice src,             # <<<<<<<<<<<<<<
 *                                   __Pyx_memviewslice dst,
 *                                   int src_ndim, int dst_ndim,
 */

  /* function exit code */
  __pyx_L1_error:;
  #ifdef WITH_THREAD
  __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  __pyx_L0:;
  return __pyx_r;
}

/* "View.MemoryView":1337
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) noexcept nogil:
 */

static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
  int __pyx_v_i;
  int __pyx_v_offset;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;

  /* "View.MemoryView":1341
 *                             int ndim_other) noexcept nogil:
 *     cdef int i
 *     cdef int offset = ndim_other - ndim             # <<<<<<<<<<<<<<
 * 
 *     for i in range(ndim - 1, -1, -1):
 */
  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);

  /* "View.MemoryView":1343
 *     cdef int offset = ndim_other - ndim
 * 
 *     for i in range(ndim - 1, -1, -1):             # <<<<<<<<<<<<<<
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 */
  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
    __pyx_v_i = __pyx_t_1;

    /* "View.MemoryView":1344
 * 
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]             # <<<<<<<<<<<<<<
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 */
    (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);

    /* "View.MemoryView":1345
 *     for i in range(ndim - 1, -1, -1):
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 */
    (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);

    /* "View.MemoryView":1346
 *         mslice.shape[i + offset] = mslice.shape[i]
 *         mslice.strides[i + offset] = mslice.strides[i]
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(offset):
 */
    (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
  }

  /* "View.MemoryView":1348
 *         mslice.suboffsets[i + offset] = mslice.suboffsets[i]
 * 
 *     for i in range(offset):             # <<<<<<<<<<<<<<
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 */
  __pyx_t_1 = __pyx_v_offset;
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1349
 * 
 *     for i in range(offset):
 *         mslice.shape[i] = 1             # <<<<<<<<<<<<<<
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1
 */
    (__pyx_v_mslice->shape[__pyx_v_i]) = 1;

    /* "View.MemoryView":1350
 *     for i in range(offset):
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]             # <<<<<<<<<<<<<<
 *         mslice.suboffsets[i] = -1
 * 
 */
    (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);

    /* "View.MemoryView":1351
 *         mslice.shape[i] = 1
 *         mslice.strides[i] = mslice.strides[0]
 *         mslice.suboffsets[i] = -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
  }

  /* "View.MemoryView":1337
 * 
 * @cname('__pyx_memoryview_broadcast_leading')
 * cdef void broadcast_leading(__Pyx_memviewslice *mslice,             # <<<<<<<<<<<<<<
 *                             int ndim,
 *                             int ndim_other) noexcept nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1359
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:             # <<<<<<<<<<<<<<
 * 
 *     if dtype_is_object:
 */

static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {

  /* "View.MemoryView":1361
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
 */
  if (__pyx_v_dtype_is_object) {

    /* "View.MemoryView":1362
 * 
 *     if dtype_is_object:
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 */
    __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);

    /* "View.MemoryView":1361
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
 * 
 *     if dtype_is_object:             # <<<<<<<<<<<<<<
 *         refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
 * 
 */
  }

  /* "View.MemoryView":1359
 * 
 * @cname('__pyx_memoryview_refcount_copying')
 * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:             # <<<<<<<<<<<<<<
 * 
 *     if dtype_is_object:
 */

  /* function exit code */
}

/* "View.MemoryView":1365
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) noexcept with gil:
 */

static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif

  /* "View.MemoryView":1368
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) noexcept with gil:
 *     refcount_objects_in_slice(data, shape, strides, ndim, inc)             # <<<<<<<<<<<<<<
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 */
  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);

  /* "View.MemoryView":1365
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
 * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                              Py_ssize_t *strides, int ndim,
 *                                              bint inc) noexcept with gil:
 */

  /* function exit code */
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "View.MemoryView":1371
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
 *     cdef Py_ssize_t i
 */

static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;

  /* "View.MemoryView":1374
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 * 
 *     for i in range(shape[0]):
 */
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1376
 *     cdef Py_ssize_t stride = strides[0]
 * 
 *     for i in range(shape[0]):             # <<<<<<<<<<<<<<
 *         if ndim == 1:
 *             if inc:
 */
  __pyx_t_1 = (__pyx_v_shape[0]);
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "View.MemoryView":1377
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
 */
    __pyx_t_4 = (__pyx_v_ndim == 1);
    if (__pyx_t_4) {

      /* "View.MemoryView":1378
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 */
      if (__pyx_v_inc) {

        /* "View.MemoryView":1379
 *         if ndim == 1:
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])
 */
        Py_INCREF((((PyObject **)__pyx_v_data)[0]));

        /* "View.MemoryView":1378
 *     for i in range(shape[0]):
 *         if ndim == 1:
 *             if inc:             # <<<<<<<<<<<<<<
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 */
        goto __pyx_L6;
      }

      /* "View.MemoryView":1381
 *                 Py_INCREF((<PyObject **> data)[0])
 *             else:
 *                 Py_DECREF((<PyObject **> data)[0])             # <<<<<<<<<<<<<<
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
 */
      /*else*/ {
        Py_DECREF((((PyObject **)__pyx_v_data)[0]));
      }
      __pyx_L6:;

      /* "View.MemoryView":1377
 * 
 *     for i in range(shape[0]):
 *         if ndim == 1:             # <<<<<<<<<<<<<<
 *             if inc:
 *                 Py_INCREF((<PyObject **> data)[0])
 */
      goto __pyx_L5;
    }

    /* "View.MemoryView":1383
 *                 Py_DECREF((<PyObject **> data)[0])
 *         else:
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)             # <<<<<<<<<<<<<<
 * 
 *         data += stride
 */
    /*else*/ {
      __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
    }
    __pyx_L5:;

    /* "View.MemoryView":1385
 *             refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
 * 
 *         data += stride             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
  }

  /* "View.MemoryView":1371
 * 
 * @cname('__pyx_memoryview_refcount_objects_in_slice')
 * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                                     Py_ssize_t *strides, int ndim, bint inc) noexcept:
 *     cdef Py_ssize_t i
 */

  /* function exit code */
}

/* "View.MemoryView":1391
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) noexcept nogil:
 */

static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {

  /* "View.MemoryView":1394
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) noexcept nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)             # <<<<<<<<<<<<<<
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);

  /* "View.MemoryView":1395
 *                               bint dtype_is_object) noexcept nogil:
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)             # <<<<<<<<<<<<<<
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)
 * 
 */
  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);

  /* "View.MemoryView":1396
 *     refcount_copying(dst, dtype_is_object, ndim, inc=False)
 *     _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
 *     refcount_copying(dst, dtype_is_object, ndim, inc=True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);

  /* "View.MemoryView":1391
 * 
 * @cname('__pyx_memoryview_slice_assign_scalar')
 * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim,             # <<<<<<<<<<<<<<
 *                               size_t itemsize, void *item,
 *                               bint dtype_is_object) noexcept nogil:
 */

  /* function exit code */
}

/* "View.MemoryView":1400
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) noexcept nogil:
 */

static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
  Py_ssize_t __pyx_v_stride;
  Py_ssize_t __pyx_v_extent;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;

  /* "View.MemoryView":1404
 *                               size_t itemsize, void *item) noexcept nogil:
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t extent = shape[0]
 * 
 */
  __pyx_v_stride = (__pyx_v_strides[0]);

  /* "View.MemoryView":1405
 *     cdef Py_ssize_t i
 *     cdef Py_ssize_t stride = strides[0]
 *     cdef Py_ssize_t extent = shape[0]             # <<<<<<<<<<<<<<
 * 
 *     if ndim == 1:
 */
  __pyx_v_extent = (__pyx_v_shape[0]);

  /* "View.MemoryView":1407
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 */
  __pyx_t_1 = (__pyx_v_ndim == 1);
  if (__pyx_t_1) {

    /* "View.MemoryView":1408
 * 
 *     if ndim == 1:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             memcpy(data, item, itemsize)
 *             data += stride
 */
    __pyx_t_2 = __pyx_v_extent;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":1409
 *     if ndim == 1:
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)             # <<<<<<<<<<<<<<
 *             data += stride
 *     else:
 */
      (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));

      /* "View.MemoryView":1410
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 *             data += stride             # <<<<<<<<<<<<<<
 *     else:
 *         for i in range(extent):
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }

    /* "View.MemoryView":1407
 *     cdef Py_ssize_t extent = shape[0]
 * 
 *     if ndim == 1:             # <<<<<<<<<<<<<<
 *         for i in range(extent):
 *             memcpy(data, item, itemsize)
 */
    goto __pyx_L3;
  }

  /* "View.MemoryView":1412
 *             data += stride
 *     else:
 *         for i in range(extent):             # <<<<<<<<<<<<<<
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
 *             data += stride
 */
  /*else*/ {
    __pyx_t_2 = __pyx_v_extent;
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "View.MemoryView":1413
 *     else:
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)             # <<<<<<<<<<<<<<
 *             data += stride
 * 
 */
      __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);

      /* "View.MemoryView":1414
 *         for i in range(extent):
 *             _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
 *             data += stride             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
    }
  }
  __pyx_L3:;

  /* "View.MemoryView":1400
 * 
 * @cname('__pyx_memoryview__slice_assign_scalar')
 * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape,             # <<<<<<<<<<<<<<
 *                               Py_ssize_t *strides, int ndim,
 *                               size_t itemsize, void *item) noexcept nogil:
 */

  /* function exit code */
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__10, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 *     __pyx_result = Enum.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 *     __pyx_result = Enum.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 *     __pyx_result = Enum.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->name);
  __Pyx_DECREF(__pyx_v___pyx_result->name);
  __pyx_v___pyx_result->name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 > 1);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.name = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/complex.pxd":19
 * 
 *         @property
 *         cdef inline double real(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.real
 * 
 */

static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":20
 *         @property
 *         cdef inline double real(self) noexcept:
 *             return self.cval.real             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = __pyx_v_self->cval.real;
  goto __pyx_L0;

  /* "cpython/complex.pxd":19
 * 
 *         @property
 *         cdef inline double real(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.real
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/complex.pxd":23
 * 
 *         @property
 *         cdef inline double imag(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.imag
 * 
 */

static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
  double __pyx_r;

  /* "cpython/complex.pxd":24
 *         @property
 *         cdef inline double imag(self) noexcept:
 *             return self.cval.imag             # <<<<<<<<<<<<<<
 * 
 *     # PyTypeObject PyComplex_Type
 */
  __pyx_r = __pyx_v_self->cval.imag;
  goto __pyx_L0;

  /* "cpython/complex.pxd":23
 * 
 *         @property
 *         cdef inline double imag(self) noexcept:             # <<<<<<<<<<<<<<
 *             return self.cval.imag
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":117
 *     or None if no such value or default was found.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:
 */
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":118
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)             # <<<<<<<<<<<<<<
 *     if value is NULL:
 *         # context variable does not have a default
 */
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 118, __pyx_L1_error)

  /* "cpython/contextvars.pxd":119
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
 */
  __pyx_t_2 = (__pyx_v_value == NULL);
  if (__pyx_t_2) {

    /* "cpython/contextvars.pxd":121
 *     if value is NULL:
 *         # context variable does not have a default
 *         pyvalue = default_value             # <<<<<<<<<<<<<<
 *     else:
 *         # value or default value of context variable
 */
    __Pyx_INCREF(__pyx_v_default_value);
    __pyx_v_pyvalue = __pyx_v_default_value;

    /* "cpython/contextvars.pxd":119
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, NULL, &value)
 *     if value is NULL:             # <<<<<<<<<<<<<<
 *         # context variable does not have a default
 *         pyvalue = default_value
 */
    goto __pyx_L3;
  }

  /* "cpython/contextvars.pxd":124
 *     else:
 *         # value or default value of context variable
 *         pyvalue = <object>value             # <<<<<<<<<<<<<<
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
 */
  /*else*/ {
    __pyx_t_3 = ((PyObject *)__pyx_v_value);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_pyvalue = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "cpython/contextvars.pxd":125
 *         # value or default value of context variable
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 * 
 */
    Py_XDECREF(__pyx_v_value);
  }
  __pyx_L3:;

  /* "cpython/contextvars.pxd":126
 *         pyvalue = <object>value
 *         Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":112
 * 
 * 
 * cdef inline object get_value(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the default value of the context variable,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {
  PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
  PyObject *__pyx_v_value;
  PyObject *__pyx_v_pyvalue = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_value_no_default", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_default_value = __pyx_optional_args->default_value;
    }
  }

  /* "cpython/contextvars.pxd":135
 *     Ignores the default value of the context variable, if any.
 *     """
 *     cdef PyObject *value = NULL             # <<<<<<<<<<<<<<
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 */
  __pyx_v_value = NULL;

  /* "cpython/contextvars.pxd":136
 *     """
 *     cdef PyObject *value = NULL
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)             # <<<<<<<<<<<<<<
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 */
  __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 136, __pyx_L1_error)

  /* "cpython/contextvars.pxd":138
 *     PyContextVar_Get(var, <PyObject*>default_value, &value)
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value             # <<<<<<<<<<<<<<
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_value);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_pyvalue = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "cpython/contextvars.pxd":139
 *     # value of context variable or 'default_value'
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'             # <<<<<<<<<<<<<<
 *     return pyvalue
 */
  Py_XDECREF(__pyx_v_value);

  /* "cpython/contextvars.pxd":140
 *     pyvalue = <object>value
 *     Py_XDECREF(value)  # PyContextVar_Get() returned an owned reference as 'PyObject*'
 *     return pyvalue             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_pyvalue);
  __pyx_r = __pyx_v_pyvalue;
  goto __pyx_L0;

  /* "cpython/contextvars.pxd":129
 * 
 * 
 * cdef inline object get_value_no_default(var, default_value=None):             # <<<<<<<<<<<<<<
 *     """Return a new reference to the value of the context variable,
 *     or the provided default value if no such value was found.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pyvalue);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/pgproto/frb.pxd":14
 *         ssize_t len
 * 
 *     inline ssize_t frb_get_len(FRBuffer *frb):             # <<<<<<<<<<<<<<
 *         return frb.len
 * 
 */

static CYTHON_INLINE Py_ssize_t __pyx_f_3gel_7pgproto_7pgproto_frb_get_len(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_frb) {
  Py_ssize_t __pyx_r;

  /* "gel/pgproto/frb.pxd":15
 * 
 *     inline ssize_t frb_get_len(FRBuffer *frb):
 *         return frb.len             # <<<<<<<<<<<<<<
 * 
 *     inline void frb_set_len(FRBuffer *frb, ssize_t new_len):
 */
  __pyx_r = __pyx_v_frb->len;
  goto __pyx_L0;

  /* "gel/pgproto/frb.pxd":14
 *         ssize_t len
 * 
 *     inline ssize_t frb_get_len(FRBuffer *frb):             # <<<<<<<<<<<<<<
 *         return frb.len
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/pgproto/frb.pxd":17
 *         return frb.len
 * 
 *     inline void frb_set_len(FRBuffer *frb, ssize_t new_len):             # <<<<<<<<<<<<<<
 *         frb.len = new_len
 * 
 */

static CYTHON_INLINE void __pyx_f_3gel_7pgproto_7pgproto_frb_set_len(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_new_len) {

  /* "gel/pgproto/frb.pxd":18
 * 
 *     inline void frb_set_len(FRBuffer *frb, ssize_t new_len):
 *         frb.len = new_len             # <<<<<<<<<<<<<<
 * 
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):
 */
  __pyx_v_frb->len = __pyx_v_new_len;

  /* "gel/pgproto/frb.pxd":17
 *         return frb.len
 * 
 *     inline void frb_set_len(FRBuffer *frb, ssize_t new_len):             # <<<<<<<<<<<<<<
 *         frb.len = new_len
 * 
 */

  /* function exit code */
}

/* "gel/pgproto/frb.pxd":20
 *         frb.len = new_len
 * 
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):             # <<<<<<<<<<<<<<
 *         frb.buf = buf
 *         frb.len = len
 */

static CYTHON_INLINE void __pyx_f_3gel_7pgproto_7pgproto_frb_init(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, char const *__pyx_v_buf, Py_ssize_t __pyx_v_len) {

  /* "gel/pgproto/frb.pxd":21
 * 
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):
 *         frb.buf = buf             # <<<<<<<<<<<<<<
 *         frb.len = len
 * 
 */
  __pyx_v_frb->buf = __pyx_v_buf;

  /* "gel/pgproto/frb.pxd":22
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):
 *         frb.buf = buf
 *         frb.len = len             # <<<<<<<<<<<<<<
 * 
 *     inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL:
 */
  __pyx_v_frb->len = __pyx_v_len;

  /* "gel/pgproto/frb.pxd":20
 *         frb.len = new_len
 * 
 *     inline void frb_init(FRBuffer *frb, const char *buf, ssize_t len):             # <<<<<<<<<<<<<<
 *         frb.buf = buf
 *         frb.len = len
 */

  /* function exit code */
}

/* "gel/pgproto/frb.pxd":24
 *         frb.len = len
 * 
 *     inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL:             # <<<<<<<<<<<<<<
 *         cdef const char *result
 * 
 */

static CYTHON_INLINE char const *__pyx_f_3gel_7pgproto_7pgproto_frb_read(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, Py_ssize_t __pyx_v_n) {
  char const *__pyx_v_result;
  char const *__pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char const *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("frb_read", 1);

  /* "gel/pgproto/frb.pxd":27
 *         cdef const char *result
 * 
 *         frb_check(frb, n)             # <<<<<<<<<<<<<<
 * 
 *         result = frb.buf
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_check(__pyx_v_frb, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/pgproto/frb.pxd":29
 *         frb_check(frb, n)
 * 
 *         result = frb.buf             # <<<<<<<<<<<<<<
 *         frb.buf += n
 *         frb.len -= n
 */
  __pyx_t_2 = __pyx_v_frb->buf;
  __pyx_v_result = __pyx_t_2;

  /* "gel/pgproto/frb.pxd":30
 * 
 *         result = frb.buf
 *         frb.buf += n             # <<<<<<<<<<<<<<
 *         frb.len -= n
 * 
 */
  __pyx_v_frb->buf = (__pyx_v_frb->buf + __pyx_v_n);

  /* "gel/pgproto/frb.pxd":31
 *         result = frb.buf
 *         frb.buf += n
 *         frb.len -= n             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_v_frb->len = (__pyx_v_frb->len - __pyx_v_n);

  /* "gel/pgproto/frb.pxd":33
 *         frb.len -= n
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     inline const char* frb_read_all(FRBuffer *frb):
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/pgproto/frb.pxd":24
 *         frb.len = len
 * 
 *     inline const char* frb_read(FRBuffer *frb, ssize_t n) except NULL:             # <<<<<<<<<<<<<<
 *         cdef const char *result
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.pgproto.pgproto.frb_read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/pgproto/frb.pxd":35
 *         return result
 * 
 *     inline const char* frb_read_all(FRBuffer *frb):             # <<<<<<<<<<<<<<
 *         cdef const char *result
 *         result = frb.buf
 */

static CYTHON_INLINE char const *__pyx_f_3gel_7pgproto_7pgproto_frb_read_all(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_frb) {
  char const *__pyx_v_result;
  char const *__pyx_r;
  char const *__pyx_t_1;

  /* "gel/pgproto/frb.pxd":37
 *     inline const char* frb_read_all(FRBuffer *frb):
 *         cdef const char *result
 *         result = frb.buf             # <<<<<<<<<<<<<<
 *         frb.buf += frb.len
 *         frb.len = 0
 */
  __pyx_t_1 = __pyx_v_frb->buf;
  __pyx_v_result = __pyx_t_1;

  /* "gel/pgproto/frb.pxd":38
 *         cdef const char *result
 *         result = frb.buf
 *         frb.buf += frb.len             # <<<<<<<<<<<<<<
 *         frb.len = 0
 *         return result
 */
  __pyx_v_frb->buf = (__pyx_v_frb->buf + __pyx_v_frb->len);

  /* "gel/pgproto/frb.pxd":39
 *         result = frb.buf
 *         frb.buf += frb.len
 *         frb.len = 0             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_v_frb->len = 0;

  /* "gel/pgproto/frb.pxd":40
 *         frb.buf += frb.len
 *         frb.len = 0
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     inline FRBuffer *frb_slice_from(FRBuffer *frb,
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/pgproto/frb.pxd":35
 *         return result
 * 
 *     inline const char* frb_read_all(FRBuffer *frb):             # <<<<<<<<<<<<<<
 *         cdef const char *result
 *         result = frb.buf
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/pgproto/frb.pxd":42
 *         return result
 * 
 *     inline FRBuffer *frb_slice_from(FRBuffer *frb,             # <<<<<<<<<<<<<<
 *                                     FRBuffer* source, ssize_t len):
 *         frb.buf = frb_read(source, len)
 */

static CYTHON_INLINE struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_f_3gel_7pgproto_7pgproto_frb_slice_from(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_frb, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_source, Py_ssize_t __pyx_v_len) {
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_r;
  char const *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "gel/pgproto/frb.pxd":44
 *     inline FRBuffer *frb_slice_from(FRBuffer *frb,
 *                                     FRBuffer* source, ssize_t len):
 *         frb.buf = frb_read(source, len)             # <<<<<<<<<<<<<<
 *         frb.len = len
 *         return frb
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_source, __pyx_v_len); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(10, 44, __pyx_L1_error)
  __pyx_v_frb->buf = __pyx_t_1;

  /* "gel/pgproto/frb.pxd":45
 *                                     FRBuffer* source, ssize_t len):
 *         frb.buf = frb_read(source, len)
 *         frb.len = len             # <<<<<<<<<<<<<<
 *         return frb
 * 
 */
  __pyx_v_frb->len = __pyx_v_len;

  /* "gel/pgproto/frb.pxd":46
 *         frb.buf = frb_read(source, len)
 *         frb.len = len
 *         return frb             # <<<<<<<<<<<<<<
 * 
 *     object frb_check(FRBuffer *frb, ssize_t n)
 */
  __pyx_r = __pyx_v_frb;
  goto __pyx_L0;

  /* "gel/pgproto/frb.pxd":42
 *         return result
 * 
 *     inline FRBuffer *frb_slice_from(FRBuffer *frb,             # <<<<<<<<<<<<<<
 *                                     FRBuffer* source, ssize_t len):
 *         frb.buf = frb_read(source, len)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.pgproto.pgproto.frb_slice_from", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/pgproto/buffer.pxd":28
 *         bint _message_mode
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("len", 1);

  /* "gel/pgproto/buffer.pxd":29
 * 
 *     cdef inline len(self):
 *         return self._length             # <<<<<<<<<<<<<<
 * 
 *     cdef inline write_len_prefixed_utf8(self, str s):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/pgproto/buffer.pxd":28
 *         bint _message_mode
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.pgproto.pgproto.WriteBuffer.len", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/pgproto/buffer.pxd":31
 *         return self._length
 * 
 *     cdef inline write_len_prefixed_utf8(self, str s):             # <<<<<<<<<<<<<<
 *         return self.write_len_prefixed_bytes(s.encode('utf-8'))
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_len_prefixed_utf8", 1);

  /* "gel/pgproto/buffer.pxd":32
 * 
 *     cdef inline write_len_prefixed_utf8(self, str s):
 *         return self.write_len_prefixed_bytes(s.encode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _check_readonly(self)
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_s == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
    __PYX_ERR(11, 32, __pyx_L1_error)
  }
  __pyx_t_1 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_self->__pyx_vtab)->write_len_prefixed_bytes(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(11, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/pgproto/buffer.pxd":31
 *         return self._length
 * 
 *     cdef inline write_len_prefixed_utf8(self, str s):             # <<<<<<<<<<<<<<
 *         return self.write_len_prefixed_bytes(s.encode('utf-8'))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.pgproto.pgproto.WriteBuffer.write_len_prefixed_utf8", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/pgproto/buffer.pxd":100
 *         bint _current_message_ready
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_len(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("len", 1);

  /* "gel/pgproto/buffer.pxd":101
 * 
 *     cdef inline len(self):
 *         return self._length             # <<<<<<<<<<<<<<
 * 
 *     cdef inline char get_message_type(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/pgproto/buffer.pxd":100
 *         bint _current_message_ready
 * 
 *     cdef inline len(self):             # <<<<<<<<<<<<<<
 *         return self._length
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.pgproto.pgproto.ReadBuffer.len", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/pgproto/buffer.pxd":103
 *         return self._length
 * 
 *     cdef inline char get_message_type(self):             # <<<<<<<<<<<<<<
 *         return self._current_message_type
 * 
 */

static CYTHON_INLINE char __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) {
  char __pyx_r;

  /* "gel/pgproto/buffer.pxd":104
 * 
 *     cdef inline char get_message_type(self):
 *         return self._current_message_type             # <<<<<<<<<<<<<<
 * 
 *     cdef inline int32_t get_message_length(self):
 */
  __pyx_r = __pyx_v_self->_current_message_type;
  goto __pyx_L0;

  /* "gel/pgproto/buffer.pxd":103
 *         return self._length
 * 
 *     cdef inline char get_message_type(self):             # <<<<<<<<<<<<<<
 *         return self._current_message_type
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/pgproto/buffer.pxd":106
 *         return self._current_message_type
 * 
 *     cdef inline int32_t get_message_length(self):             # <<<<<<<<<<<<<<
 *         return self._current_message_len
 * 
 */

static CYTHON_INLINE int32_t __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_length(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_v_self) {
  int32_t __pyx_r;

  /* "gel/pgproto/buffer.pxd":107
 * 
 *     cdef inline int32_t get_message_length(self):
 *         return self._current_message_len             # <<<<<<<<<<<<<<
 * 
 *     cdef feed_data(self, data)
 */
  __pyx_r = __pyx_v_self->_current_message_len;
  goto __pyx_L0;

  /* "gel/pgproto/buffer.pxd":106
 *         return self._current_message_type
 * 
 *     cdef inline int32_t get_message_length(self):             # <<<<<<<<<<<<<<
 *         return self._current_message_len
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pxd":27
 *         str     type_name
 * 
 *     cdef inline bytes get_tid(self):             # <<<<<<<<<<<<<<
 *         return self.tid
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_get_tid(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tid", 1);

  /* "gel/protocol/codecs/base.pxd":28
 * 
 *     cdef inline bytes get_tid(self):
 *         return self.tid             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->tid);
  __pyx_r = __pyx_v_self->tid;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pxd":27
 *         str     type_name
 * 
 *     cdef inline bytes get_tid(self):             # <<<<<<<<<<<<<<
 *         return self.tid
 * 
 */

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

/* "cpython/datetime.pxd":72
 *     ctypedef extern class datetime.date[object PyDateTime_Date]:
 *         @property
 *         cdef inline int year(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_YEAR(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":73
 *         @property
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":72
 *     ctypedef extern class datetime.date[object PyDateTime_Date]:
 *         @property
 *         cdef inline int year(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_YEAR(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":76
 * 
 *         @property
 *         cdef inline int month(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_MONTH(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":77
 *         @property
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":76
 * 
 *         @property
 *         cdef inline int month(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_MONTH(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":80
 * 
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_DAY(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":81
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 */
  __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":80
 * 
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_DAY(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":85
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 *         @property
 *         cdef inline int hour(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_HOUR(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":86
 *         @property
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_TIME_GET_HOUR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_TIME_GET_HOUR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":85
 *     ctypedef extern class datetime.time[object PyDateTime_Time]:
 *         @property
 *         cdef inline int hour(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_HOUR(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":89
 * 
 *         @property
 *         cdef inline int minute(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_MINUTE(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":90
 *         @property
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_TIME_GET_MINUTE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_TIME_GET_MINUTE(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":89
 * 
 *         @property
 *         cdef inline int minute(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_MINUTE(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":93
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_SECOND(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":94
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_TIME_GET_SECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_TIME_GET_SECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":93
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_SECOND(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":97
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":98
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_TIME_GET_MICROSECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":97
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_TIME_GET_MICROSECOND(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":101
 * 
 *         @property
 *         cdef inline object tzinfo(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("tzinfo", 1);

  /* "cpython/datetime.pxd":102
 *         @property
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":101
 * 
 *         @property
 *         cdef inline object tzinfo(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDateTime_TIME_GET_TZINFO(self)
 * 
 */

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

/* "cpython/datetime.pxd":105
 * 
 *         @property
 *         cdef inline int fold(self) noexcept:             # <<<<<<<<<<<<<<
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_TIME_GET_FOLD(self)
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":107
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_TIME_GET_FOLD(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 */
  __pyx_r = PyDateTime_TIME_GET_FOLD(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":105
 * 
 *         @property
 *         cdef inline int fold(self) noexcept:             # <<<<<<<<<<<<<<
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_TIME_GET_FOLD(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":111
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 *         @property
 *         cdef inline int year(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_YEAR(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":112
 *         @property
 *         cdef inline int year(self) noexcept:
 *             return PyDateTime_GET_YEAR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":111
 *     ctypedef extern class datetime.datetime[object PyDateTime_DateTime]:
 *         @property
 *         cdef inline int year(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_YEAR(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":115
 * 
 *         @property
 *         cdef inline int month(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_MONTH(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":116
 *         @property
 *         cdef inline int month(self) noexcept:
 *             return PyDateTime_GET_MONTH(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":115
 * 
 *         @property
 *         cdef inline int month(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_MONTH(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":119
 * 
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_DAY(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":120
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_GET_DAY(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":119
 * 
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_GET_DAY(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":123
 * 
 *         @property
 *         cdef inline int hour(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_HOUR(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":124
 *         @property
 *         cdef inline int hour(self) noexcept:
 *             return PyDateTime_DATE_GET_HOUR(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DATE_GET_HOUR(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":123
 * 
 *         @property
 *         cdef inline int hour(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_HOUR(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":127
 * 
 *         @property
 *         cdef inline int minute(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_MINUTE(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":128
 *         @property
 *         cdef inline int minute(self) noexcept:
 *             return PyDateTime_DATE_GET_MINUTE(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DATE_GET_MINUTE(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":127
 * 
 *         @property
 *         cdef inline int minute(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_MINUTE(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":131
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_SECOND(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":132
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DATE_GET_SECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DATE_GET_SECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":131
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_SECOND(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":135
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":136
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DATE_GET_MICROSECOND(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":135
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DATE_GET_MICROSECOND(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":139
 * 
 *         @property
 *         cdef inline object tzinfo(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("tzinfo", 1);

  /* "cpython/datetime.pxd":140
 *         @property
 *         cdef inline object tzinfo(self):
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":139
 * 
 *         @property
 *         cdef inline object tzinfo(self):             # <<<<<<<<<<<<<<
 *             return <object>PyDateTime_DATE_GET_TZINFO(self)
 * 
 */

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

/* "cpython/datetime.pxd":143
 * 
 *         @property
 *         cdef inline int fold(self) noexcept:             # <<<<<<<<<<<<<<
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_DATE_GET_FOLD(self)
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":145
 *         cdef inline int fold(self) noexcept:
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_DATE_GET_FOLD(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 */
  __pyx_r = PyDateTime_DATE_GET_FOLD(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":143
 * 
 *         @property
 *         cdef inline int fold(self) noexcept:             # <<<<<<<<<<<<<<
 *             # For Python < 3.6 this returns 0 no matter what
 *             return PyDateTime_DATE_GET_FOLD(self)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":149
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_DAYS(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":150
 *         @property
 *         cdef inline int day(self) noexcept:
 *             return PyDateTime_DELTA_GET_DAYS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":149
 *     ctypedef extern class datetime.timedelta[object PyDateTime_Delta]:
 *         @property
 *         cdef inline int day(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_DAYS(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":153
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_SECONDS(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":154
 *         @property
 *         cdef inline int second(self) noexcept:
 *             return PyDateTime_DELTA_GET_SECONDS(self)             # <<<<<<<<<<<<<<
 * 
 *         @property
 */
  __pyx_r = PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":153
 * 
 *         @property
 *         cdef inline int second(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_SECONDS(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":157
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self) {
  int __pyx_r;

  /* "cpython/datetime.pxd":158
 *         @property
 *         cdef inline int microsecond(self) noexcept:
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)             # <<<<<<<<<<<<<<
 * 
 *     ctypedef extern class datetime.tzinfo[object PyDateTime_TZInfo]:
 */
  __pyx_r = PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_self));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":157
 * 
 *         @property
 *         cdef inline int microsecond(self) noexcept:             # <<<<<<<<<<<<<<
 *             return PyDateTime_DELTA_GET_MICROSECONDS(self)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":282
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
 */

static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void) {

  /* "cpython/datetime.pxd":283
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:
 *     PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DateTime CAPI factory function.
 */
  (void)(PyDateTime_IMPORT);

  /* "cpython/datetime.pxd":282
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime() noexcept:             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
 */

  /* function exit code */
}

/* "cpython/datetime.pxd":287
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  PyDateTime_Date *__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("date_new", 1);

  /* "cpython/datetime.pxd":288
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)             # <<<<<<<<<<<<<<
 * 
 * # Create time object using DateTime CAPI factory function
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Date_FromDate(__pyx_v_year, __pyx_v_month, __pyx_v_day, PyDateTimeAPI->DateType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Date *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":287
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline date date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.date_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":292
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
 */

static CYTHON_INLINE PyDateTime_Time *__pyx_f_7cpython_8datetime_time_new(int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_time_new *__pyx_optional_args) {
  int __pyx_v_fold = ((int)0);
  PyDateTime_Time *__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("time_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fold = __pyx_optional_args->fold;
    }
  }

  /* "cpython/datetime.pxd":293
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__Pyx_DateTime_TimeWithFold(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_time))))) __PYX_ERR(12, 293, __pyx_L1_error)
  __pyx_r = ((PyDateTime_Time *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":292
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.time_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":297
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz, struct __pyx_opt_args_7cpython_8datetime_datetime_new *__pyx_optional_args) {
  int __pyx_v_fold = ((int)0);
  PyDateTime_DateTime *__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("datetime_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fold = __pyx_optional_args->fold;
    }
  }

  /* "cpython/datetime.pxd":298
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__Pyx_DateTime_DateTimeWithFold(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, __pyx_v_fold)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":297
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0):             # <<<<<<<<<<<<<<
 *     return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.datetime_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":302
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
 */

static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cpython_8datetime_timedelta_new(int __pyx_v_days, int __pyx_v_seconds, int __pyx_v_useconds) {
  PyDateTime_Delta *__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("timedelta_new", 1);

  /* "cpython/datetime.pxd":303
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)PyDateTimeAPI->Delta_FromDelta(__pyx_v_days, __pyx_v_seconds, __pyx_v_useconds, 1, PyDateTimeAPI->DeltaType)); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyDateTime_Delta *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":302
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline timedelta timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.timedelta_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":306
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timezone_new(PyObject *__pyx_v_offset, struct __pyx_opt_args_7cpython_8datetime_timezone_new *__pyx_optional_args) {
  PyObject *__pyx_v_name = ((PyObject *)Py_None);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timezone_new", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_name = __pyx_optional_args->name;
    }
  }

  /* "cpython/datetime.pxd":307
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 */
  __pyx_t_1 = (PY_VERSION_HEX < 0x030700b1);
  if (unlikely(__pyx_t_1)) {

    /* "cpython/datetime.pxd":308
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 308, __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(12, 308, __pyx_L1_error)

    /* "cpython/datetime.pxd":307
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 */
  }

  /* "cpython/datetime.pxd":309
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DB API constructor.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__pyx_v_name != Py_None);
  if (__pyx_t_1) {
    __pyx_t_3 = ((PyObject *)__pyx_v_name);
  } else {
    __pyx_t_3 = NULL;
  }
  __pyx_t_2 = __Pyx_TimeZone_FromOffsetAndName(__pyx_v_offset, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":306
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 * cdef inline object timezone_new(object offset, object name=None):             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.datetime.timezone_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":312
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 */

static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_from_timestamp(PyObject *__pyx_v_timestamp, struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp *__pyx_optional_args) {
  PyObject *__pyx_v_tz = ((PyObject *)Py_None);
  PyDateTime_DateTime *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("datetime_from_timestamp", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tz = __pyx_optional_args->tz;
    }
  }

  /* "cpython/datetime.pxd":313
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(             # <<<<<<<<<<<<<<
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);

  /* "cpython/datetime.pxd":314
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DB API constructor.
 */
  __pyx_t_2 = (__pyx_v_tz != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_timestamp);
    __Pyx_GIVEREF(__pyx_v_timestamp);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp)) __PYX_ERR(12, 314, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_tz);
    __Pyx_GIVEREF(__pyx_v_tz);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_tz)) __PYX_ERR(12, 314, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_timestamp);
    __Pyx_GIVEREF(__pyx_v_timestamp);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_timestamp)) __PYX_ERR(12, 314, __pyx_L1_error);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  }

  /* "cpython/datetime.pxd":313
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):
 *     return PyDateTimeAPI.DateTime_FromTimestamp(             # <<<<<<<<<<<<<<
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 * 
 */
  __pyx_t_3 = ((PyObject *)PyDateTimeAPI->DateTime_FromTimestamp(((PyObject *)PyDateTimeAPI->DateTimeType), __pyx_t_1, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_DateTime *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":312
 * 
 * # Create datetime object using DB API constructor.
 * cdef inline datetime datetime_from_timestamp(timestamp, tz=None):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromTimestamp(
 *         <PyObject*>PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("cpython.datetime.datetime_from_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":317
 * 
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))
 * 
 */

static CYTHON_INLINE PyDateTime_Date *__pyx_f_7cpython_8datetime_date_from_timestamp(PyObject *__pyx_v_timestamp) {
  PyDateTime_Date *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_from_timestamp", 1);

  /* "cpython/datetime.pxd":318
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))             # <<<<<<<<<<<<<<
 * 
 * # More recognizable getters for date/time/datetime/timedelta.
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_timestamp);
  __Pyx_GIVEREF(__pyx_v_timestamp);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_timestamp)) __PYX_ERR(12, 318, __pyx_L1_error);
  __pyx_t_2 = ((PyObject *)PyDateTimeAPI->Date_FromTimestamp(((PyObject *)PyDateTimeAPI->DateType), __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((PyDateTime_Date *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":317
 * 
 * # Create date object using DB API constructor.
 * cdef inline date date_from_timestamp(timestamp):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromTimestamp(<PyObject*>PyDateTimeAPI.DateType, (timestamp,))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.datetime.date_from_timestamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":326
 * 
 * # Get UTC singleton
 * cdef inline object get_utc():             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_get_utc(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_utc", 1);

  /* "cpython/datetime.pxd":327
 * # Get UTC singleton
 * cdef inline object get_utc():
 *     if PY_VERSION_HEX < 0x030700b1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return <object>__Pyx_TimeZone_UTC
 */
  __pyx_t_1 = (PY_VERSION_HEX < 0x030700b1);
  if (unlikely(__pyx_t_1)) {

    /* "cpython/datetime.pxd":328
 * cdef inline object get_utc():
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')             # <<<<<<<<<<<<<<
 *     return <object>__Pyx_TimeZone_UTC
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 328, __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(12, 328, __pyx_L1_error)

    /* "cpython/datetime.pxd":327
 * # Get UTC singleton
 * cdef inline object get_utc():
 *     if PY_VERSION_HEX < 0x030700b1:             # <<<<<<<<<<<<<<
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return <object>__Pyx_TimeZone_UTC
 */
  }

  /* "cpython/datetime.pxd":329
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 *     return <object>__Pyx_TimeZone_UTC             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of time
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__Pyx_TimeZone_UTC));
  __pyx_r = ((PyObject *)__Pyx_TimeZone_UTC);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":326
 * 
 * # Get UTC singleton
 * cdef inline object get_utc():             # <<<<<<<<<<<<<<
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cpython.datetime.get_utc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cpython/datetime.pxd":332
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("time_tzinfo", 1);

  /* "cpython/datetime.pxd":333
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of datetime
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_TIME_GET_TZINFO(__pyx_v_o);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":332
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_TIME_GET_TZINFO(o)
 * 
 */

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

/* "cpython/datetime.pxd":336
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("datetime_tzinfo", 1);

  /* "cpython/datetime.pxd":337
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of date
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTime_DATE_GET_TZINFO(__pyx_v_o);
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":336
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     return <object>PyDateTime_DATE_GET_TZINFO(o)
 * 
 */

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

/* "cpython/datetime.pxd":340
 * 
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_year(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":341
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of date
 */
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":340
 * 
 * # Get year of date
 * cdef inline int date_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":344
 * 
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_month(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":345
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of date
 */
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":344
 * 
 * # Get month of date
 * cdef inline int date_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":348
 * 
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_day(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":349
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of datetime
 */
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":348
 * 
 * # Get day of date
 * cdef inline int date_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":352
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_year(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":353
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of datetime
 */
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":352
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":356
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_month(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":357
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of datetime
 */
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":356
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":360
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_day(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":361
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of time
 */
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":360
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":364
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_hour(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":365
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:
 *     return PyDateTime_TIME_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of time
 */
  __pyx_r = PyDateTime_TIME_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":364
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":368
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_minute(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":369
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:
 *     return PyDateTime_TIME_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of time
 */
  __pyx_r = PyDateTime_TIME_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":368
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":372
 * 
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_second(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":373
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:
 *     return PyDateTime_TIME_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of time
 */
  __pyx_r = PyDateTime_TIME_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":372
 * 
 * # Get second of time
 * cdef inline int time_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":376
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":377
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:
 *     return PyDateTime_TIME_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get fold of time
 */
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":376
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":380
 * 
 * # Get fold of time
 * cdef inline int time_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_fold(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":382
 * cdef inline int time_fold(object o) noexcept:
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of datetime
 */
  __pyx_r = PyDateTime_TIME_GET_FOLD(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":380
 * 
 * # Get fold of time
 * cdef inline int time_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_TIME_GET_FOLD(o)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":385
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_hour(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":386
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:
 *     return PyDateTime_DATE_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":385
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":389
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_minute(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":390
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:
 *     return PyDateTime_DATE_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":389
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":393
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_second(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":394
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:
 *     return PyDateTime_DATE_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":393
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":397
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":398
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:
 *     return PyDateTime_DATE_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get fold of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":397
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":401
 * 
 * # Get fold of datetime
 * cdef inline int datetime_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_fold(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":403
 * cdef inline int datetime_fold(object o) noexcept:
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)             # <<<<<<<<<<<<<<
 * 
 * # Get days of timedelta
 */
  __pyx_r = PyDateTime_DATE_GET_FOLD(__pyx_v_o);
  goto __pyx_L0;

  /* "cpython/datetime.pxd":401
 * 
 * # Get fold of datetime
 * cdef inline int datetime_fold(object o) noexcept:             # <<<<<<<<<<<<<<
 *     # For Python < 3.6 this returns 0 no matter what
 *     return PyDateTime_DATE_GET_FOLD(o)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":406
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).days
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":407
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:
 *     return (<PyDateTime_Delta*>o).days             # <<<<<<<<<<<<<<
 * 
 * # Get seconds of timedelta
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->days;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":406
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).days
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":410
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).seconds
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":411
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:
 *     return (<PyDateTime_Delta*>o).seconds             # <<<<<<<<<<<<<<
 * 
 * # Get microseconds of timedelta
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->seconds;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":410
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).seconds
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":414
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).microseconds
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) {
  int __pyx_r;

  /* "cpython/datetime.pxd":415
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:
 *     return (<PyDateTime_Delta*>o).microseconds             # <<<<<<<<<<<<<<
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->microseconds;
  goto __pyx_L0;

  /* "cpython/datetime.pxd":414
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o) noexcept:             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).microseconds
 * 
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "cpython/datetime.pxd":417
 *     return (<PyDateTime_Delta*>o).microseconds
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:             # <<<<<<<<<<<<<<
 *     # Mirrors the "timedelta.total_seconds()" method.
 *     # Note that this implementation is not guaranteed to give *exactly* the same
 */

static CYTHON_INLINE double __pyx_f_7cpython_8datetime_total_seconds(PyDateTime_Delta *__pyx_v_obj) {
  double __pyx_v_days;
  double __pyx_v_seconds;
  double __pyx_v_micros;
  double __pyx_r;

  /* "cpython/datetime.pxd":423
 *     cdef:
 *         double days, seconds, micros
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)             # <<<<<<<<<<<<<<
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 */
  __pyx_v_days = ((double)PyDateTime_DELTA_GET_DAYS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":424
 *         double days, seconds, micros
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)             # <<<<<<<<<<<<<<
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 *     return days * 24 * 3600 + seconds + micros / 1_000_000
 */
  __pyx_v_seconds = ((double)PyDateTime_DELTA_GET_SECONDS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":425
 *     days = <double>PyDateTime_DELTA_GET_DAYS(obj)
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)             # <<<<<<<<<<<<<<
 *     return days * 24 * 3600 + seconds + micros / 1_000_000
 */
  __pyx_v_micros = ((double)PyDateTime_DELTA_GET_MICROSECONDS(((PyObject *)__pyx_v_obj)));

  /* "cpython/datetime.pxd":426
 *     seconds = <double>PyDateTime_DELTA_GET_SECONDS(obj)
 *     micros = <double>PyDateTime_DELTA_GET_MICROSECONDS(obj)
 *     return days * 24 * 3600 + seconds + micros / 1_000_000             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((((__pyx_v_days * 24.0) * 3600.0) + __pyx_v_seconds) + (__pyx_v_micros / 1000000.0));
  goto __pyx_L0;

  /* "cpython/datetime.pxd":417
 *     return (<PyDateTime_Delta*>o).microseconds
 * 
 * cdef inline double total_seconds(timedelta obj) noexcept:             # <<<<<<<<<<<<<<
 *     # Mirrors the "timedelta.total_seconds()" method.
 *     # Note that this implementation is not guaranteed to give *exactly* the same
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/protocol/lru.pyx":46
 *     # beginning of it.
 * 
 *     def __init__(self, *, maxsize):             # <<<<<<<<<<<<<<
 *         if maxsize <= 0:
 *             raise ValueError(
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_maxsize = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_maxsize,0};
    if (likely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxsize)) != 0)) {
        (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
        kw_args--;
      }
      else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L3_error)
      else {
        __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_maxsize); __PYX_ERR(0, 46, __pyx_L3_error)
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "__init__") < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 0)) {
      goto __pyx_L5_argtuple_error;
    } else {
      __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_maxsize); __PYX_ERR(0, 46, __pyx_L3_error)
    }
    __pyx_v_maxsize = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); __PYX_ERR(0, 46, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping___init__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self), __pyx_v_maxsize);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_3gel_8protocol_8protocol_10LRUMapping___init__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_maxsize) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "gel/protocol/lru.pyx":47
 * 
 *     def __init__(self, *, maxsize):
 *         if maxsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'maxsize is expected to be greater than 0, got {maxsize}')
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_maxsize, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/lru.pyx":49
 *         if maxsize <= 0:
 *             raise ValueError(
 *                 f'maxsize is expected to be greater than 0, got {maxsize}')             # <<<<<<<<<<<<<<
 * 
 *         self._dict = collections.OrderedDict()
 */
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_maxsize, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_maxsize_is_expected_to_be_greate, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/lru.pyx":48
 *     def __init__(self, *, maxsize):
 *         if maxsize <= 0:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f'maxsize is expected to be greater than 0, got {maxsize}')
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 48, __pyx_L1_error)

    /* "gel/protocol/lru.pyx":47
 * 
 *     def __init__(self, *, maxsize):
 *         if maxsize <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'maxsize is expected to be greater than 0, got {maxsize}')
 */
  }

  /* "gel/protocol/lru.pyx":51
 *                 f'maxsize is expected to be greater than 0, got {maxsize}')
 * 
 *         self._dict = collections.OrderedDict()             # <<<<<<<<<<<<<<
 *         self._dict_move_to_end = self._dict.move_to_end
 *         self._dict_get = self._dict.get
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collections); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_dict);
  __Pyx_DECREF(__pyx_v_self->_dict);
  __pyx_v_self->_dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/lru.pyx":52
 * 
 *         self._dict = collections.OrderedDict()
 *         self._dict_move_to_end = self._dict.move_to_end             # <<<<<<<<<<<<<<
 *         self._dict_get = self._dict.get
 *         self._maxsize = maxsize
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dict, __pyx_n_s_move_to_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_dict_move_to_end);
  __Pyx_DECREF(__pyx_v_self->_dict_move_to_end);
  __pyx_v_self->_dict_move_to_end = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/lru.pyx":53
 *         self._dict = collections.OrderedDict()
 *         self._dict_move_to_end = self._dict.move_to_end
 *         self._dict_get = self._dict.get             # <<<<<<<<<<<<<<
 *         self._maxsize = maxsize
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dict, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_dict_get);
  __Pyx_DECREF(__pyx_v_self->_dict_get);
  __pyx_v_self->_dict_get = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/lru.pyx":54
 *         self._dict_move_to_end = self._dict.move_to_end
 *         self._dict_get = self._dict.get
 *         self._maxsize = maxsize             # <<<<<<<<<<<<<<
 * 
 *     cdef get(self, key, default):
 */
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_maxsize); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
  __pyx_v_self->_maxsize = __pyx_t_6;

  /* "gel/protocol/lru.pyx":46
 *     # beginning of it.
 * 
 *     def __init__(self, *, maxsize):             # <<<<<<<<<<<<<<
 *         if maxsize <= 0:
 *             raise ValueError(
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/lru.pyx":56
 *         self._maxsize = maxsize
 * 
 *     cdef get(self, key, default):             # <<<<<<<<<<<<<<
 *         o = self._dict_get(key, _LRU_MARKER)
 *         if o is _LRU_MARKER:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_10LRUMapping_get(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_default) {
  PyObject *__pyx_v_o = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 1);

  /* "gel/protocol/lru.pyx":57
 * 
 *     cdef get(self, key, default):
 *         o = self._dict_get(key, _LRU_MARKER)             # <<<<<<<<<<<<<<
 *         if o is _LRU_MARKER:
 *             return default
 */
  __Pyx_INCREF(__pyx_v_self->_dict_get);
  __pyx_t_2 = __pyx_v_self->_dict_get; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_3gel_8protocol_8protocol__LRU_MARKER};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_o = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/lru.pyx":58
 *     cdef get(self, key, default):
 *         o = self._dict_get(key, _LRU_MARKER)
 *         if o is _LRU_MARKER:             # <<<<<<<<<<<<<<
 *             return default
 *         self._dict_move_to_end(key)  # last=True
 */
  __pyx_t_5 = (__pyx_v_o == __pyx_v_3gel_8protocol_8protocol__LRU_MARKER);
  if (__pyx_t_5) {

    /* "gel/protocol/lru.pyx":59
 *         o = self._dict_get(key, _LRU_MARKER)
 *         if o is _LRU_MARKER:
 *             return default             # <<<<<<<<<<<<<<
 *         self._dict_move_to_end(key)  # last=True
 *         return o
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_default);
    __pyx_r = __pyx_v_default;
    goto __pyx_L0;

    /* "gel/protocol/lru.pyx":58
 *     cdef get(self, key, default):
 *         o = self._dict_get(key, _LRU_MARKER)
 *         if o is _LRU_MARKER:             # <<<<<<<<<<<<<<
 *             return default
 *         self._dict_move_to_end(key)  # last=True
 */
  }

  /* "gel/protocol/lru.pyx":60
 *         if o is _LRU_MARKER:
 *             return default
 *         self._dict_move_to_end(key)  # last=True             # <<<<<<<<<<<<<<
 *         return o
 * 
 */
  __Pyx_INCREF(__pyx_v_self->_dict_move_to_end);
  __pyx_t_2 = __pyx_v_self->_dict_move_to_end; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_key};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/lru.pyx":61
 *             return default
 *         self._dict_move_to_end(key)  # last=True
 *         return o             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_o);
  __pyx_r = __pyx_v_o;
  goto __pyx_L0;

  /* "gel/protocol/lru.pyx":56
 *         self._maxsize = maxsize
 * 
 *     cdef get(self, key, default):             # <<<<<<<<<<<<<<
 *         o = self._dict_get(key, _LRU_MARKER)
 *         if o is _LRU_MARKER:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/lru.pyx":63
 *         return o
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         o = self._dict[key]
 *         self._dict_move_to_end(key)  # last=True
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_2__getitem__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_2__getitem__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_v_o = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 1);

  /* "gel/protocol/lru.pyx":64
 * 
 *     def __getitem__(self, key):
 *         o = self._dict[key]             # <<<<<<<<<<<<<<
 *         self._dict_move_to_end(key)  # last=True
 *         return o
 */
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->_dict, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_o = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/lru.pyx":65
 *     def __getitem__(self, key):
 *         o = self._dict[key]
 *         self._dict_move_to_end(key)  # last=True             # <<<<<<<<<<<<<<
 *         return o
 * 
 */
  __Pyx_INCREF(__pyx_v_self->_dict_move_to_end);
  __pyx_t_2 = __pyx_v_self->_dict_move_to_end; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_key};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/lru.pyx":66
 *         o = self._dict[key]
 *         self._dict_move_to_end(key)  # last=True
 *         return o             # <<<<<<<<<<<<<<
 * 
 *     def __setitem__(self, key, o):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_o);
  __pyx_r = __pyx_v_o;
  goto __pyx_L0;

  /* "gel/protocol/lru.pyx":63
 *         return o
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         o = self._dict[key]
 *         self._dict_move_to_end(key)  # last=True
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/lru.pyx":68
 *         return o
 * 
 *     def __setitem__(self, key, o):             # <<<<<<<<<<<<<<
 *         if key in self._dict:
 *             self._dict[key] = o
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_o); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_5__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_o) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_4__setitem__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_o));

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

static int __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_4__setitem__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setitem__", 1);

  /* "gel/protocol/lru.pyx":69
 * 
 *     def __setitem__(self, key, o):
 *         if key in self._dict:             # <<<<<<<<<<<<<<
 *             self._dict[key] = o
 *             self._dict_move_to_end(key)  # last=True
 */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_self->_dict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 69, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "gel/protocol/lru.pyx":70
 *     def __setitem__(self, key, o):
 *         if key in self._dict:
 *             self._dict[key] = o             # <<<<<<<<<<<<<<
 *             self._dict_move_to_end(key)  # last=True
 *         else:
 */
    if (unlikely((PyObject_SetItem(__pyx_v_self->_dict, __pyx_v_key, __pyx_v_o) < 0))) __PYX_ERR(0, 70, __pyx_L1_error)

    /* "gel/protocol/lru.pyx":71
 *         if key in self._dict:
 *             self._dict[key] = o
 *             self._dict_move_to_end(key)  # last=True             # <<<<<<<<<<<<<<
 *         else:
 *             self._dict[key] = o
 */
    __Pyx_INCREF(__pyx_v_self->_dict_move_to_end);
    __pyx_t_3 = __pyx_v_self->_dict_move_to_end; __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_key};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/lru.pyx":69
 * 
 *     def __setitem__(self, key, o):
 *         if key in self._dict:             # <<<<<<<<<<<<<<
 *             self._dict[key] = o
 *             self._dict_move_to_end(key)  # last=True
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/lru.pyx":73
 *             self._dict_move_to_end(key)  # last=True
 *         else:
 *             self._dict[key] = o             # <<<<<<<<<<<<<<
 *             if len(self._dict) > self._maxsize:
 *                 self._dict.popitem(last=False)
 */
  /*else*/ {
    if (unlikely((PyObject_SetItem(__pyx_v_self->_dict, __pyx_v_key, __pyx_v_o) < 0))) __PYX_ERR(0, 73, __pyx_L1_error)

    /* "gel/protocol/lru.pyx":74
 *         else:
 *             self._dict[key] = o
 *             if len(self._dict) > self._maxsize:             # <<<<<<<<<<<<<<
 *                 self._dict.popitem(last=False)
 * 
 */
    __pyx_t_2 = __pyx_v_self->_dict;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = (__pyx_t_6 > __pyx_v_self->_maxsize);
    if (__pyx_t_1) {

      /* "gel/protocol/lru.pyx":75
 *             self._dict[key] = o
 *             if len(self._dict) > self._maxsize:
 *                 self._dict.popitem(last=False)             # <<<<<<<<<<<<<<
 * 
 *     def __delitem__(self, key):
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dict, __pyx_n_s_popitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_last, Py_False) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "gel/protocol/lru.pyx":74
 *         else:
 *             self._dict[key] = o
 *             if len(self._dict) > self._maxsize:             # <<<<<<<<<<<<<<
 *                 self._dict.popitem(last=False)
 * 
 */
    }
  }
  __pyx_L3:;

  /* "gel/protocol/lru.pyx":68
 *         return o
 * 
 *     def __setitem__(self, key, o):             # <<<<<<<<<<<<<<
 *         if key in self._dict:
 *             self._dict[key] = o
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/lru.pyx":77
 *                 self._dict.popitem(last=False)
 * 
 *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
 *         del self._dict[key]
 * 
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_7__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_7__delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__delitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_6__delitem__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static int __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_6__delitem__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "gel/protocol/lru.pyx":78
 * 
 *     def __delitem__(self, key):
 *         del self._dict[key]             # <<<<<<<<<<<<<<
 * 
 *     def __contains__(self, key):
 */
  if (unlikely((PyObject_DelItem(__pyx_v_self->_dict, __pyx_v_key) < 0))) __PYX_ERR(0, 78, __pyx_L1_error)

  /* "gel/protocol/lru.pyx":77
 *                 self._dict.popitem(last=False)
 * 
 *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
 *         del self._dict[key]
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__delitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/protocol/lru.pyx":80
 *         del self._dict[key]
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<<
 *         return key in self._dict
 * 
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_9__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_9__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_8__contains__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static int __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_8__contains__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "gel/protocol/lru.pyx":81
 * 
 *     def __contains__(self, key):
 *         return key in self._dict             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_self->_dict, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 81, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "gel/protocol/lru.pyx":80
 *         del self._dict[key]
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<<
 *         return key in self._dict
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/protocol/lru.pyx":83
 *         return key in self._dict
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self._dict)
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_11__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_11__len__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_10__len__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_10__len__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__", 1);

  /* "gel/protocol/lru.pyx":84
 * 
 *     def __len__(self):
 *         return len(self._dict)             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = __pyx_v_self->_dict;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "gel/protocol/lru.pyx":83
 *         return key in self._dict
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self._dict)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/lru.pyx":86
 *         return len(self._dict)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return iter(self._dict)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_13__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_13__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_12__iter__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_12__iter__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 1);

  /* "gel/protocol/lru.pyx":87
 * 
 *     def __iter__(self):
 *         return iter(self._dict)             # <<<<<<<<<<<<<<
 * 
 *     def clear(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_dict;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/lru.pyx":86
 *         return len(self._dict)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return iter(self._dict)
 * 
 */

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

/* "gel/protocol/lru.pyx":89
 *         return iter(self._dict)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self._dict.clear()
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_15clear(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10LRUMapping_15clear = {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_15clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_15clear(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("clear", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_14clear(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_14clear(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear", 1);

  /* "gel/protocol/lru.pyx":90
 * 
 *     def clear(self):
 *         self._dict.clear()             # <<<<<<<<<<<<<<
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_dict, __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/lru.pyx":89
 *         return iter(self._dict)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self._dict.clear()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10LRUMapping_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_16__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_16__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self._dict, self._dict_get, self._dict_move_to_end, self._maxsize)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_maxsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->_dict);
  __Pyx_GIVEREF(__pyx_v_self->_dict);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->_dict)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_dict_get);
  __Pyx_GIVEREF(__pyx_v_self->_dict_get);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_dict_get)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->_dict_move_to_end);
  __Pyx_GIVEREF(__pyx_v_self->_dict_move_to_end);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_self->_dict_move_to_end)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self._dict, self._dict_get, self._dict_move_to_end, self._maxsize)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v__dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":7
 *     state = (self._dict, self._dict_get, self._dict_move_to_end, self._maxsize)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  if (__pyx_t_3) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self._dict is not None or self._dict_get is not None or self._dict_move_to_end is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self._dict, self._dict_get, self._dict_move_to_end, self._maxsize)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self._dict is not None or self._dict_get is not None or self._dict_move_to_end is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, None), state
 */
  /*else*/ {
    __pyx_t_4 = (__pyx_v_self->_dict != Py_None);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->_dict_get != Py_None);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_3 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_self->_dict_move_to_end != Py_None);
    __pyx_t_3 = __pyx_t_4;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_3;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._dict is not None or self._dict_get is not None or self._dict_move_to_end is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self._dict is not None or self._dict_get is not None or self._dict_move_to_end is not None
 *     if use_setstate:
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_LRUMapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_14808274);
    __Pyx_GIVEREF(__pyx_int_14808274);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_14808274)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self._dict is not None or self._dict_get is not None or self._dict_move_to_end is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, None), state
 *     else:
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_LRUMapping__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_LRUMapping); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_14808274);
    __Pyx_GIVEREF(__pyx_int_14808274);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_14808274)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_LRUMapping__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10LRUMapping_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10LRUMapping_18__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10LRUMapping_18__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_LRUMapping__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_LRUMapping__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_LRUMapping__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.LRUMapping.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":37
 * cdef class BaseCodec:
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError(
 *             'codecs are not supposed to be instantiated directly')
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9BaseCodec___init__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_9BaseCodec___init__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "gel/protocol/codecs/base.pyx":38
 * 
 *     def __init__(self):
 *         raise RuntimeError(             # <<<<<<<<<<<<<<
 *             'codecs are not supposed to be instantiated directly')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __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(1, 38, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":37
 * cdef class BaseCodec:
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise RuntimeError(
 *             'codecs are not supposed to be instantiated directly')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":41
 *             'codecs are not supposed to be instantiated directly')
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.tid = None
 *         self.name = None
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9BaseCodec_2__cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_9BaseCodec_2__cinit__(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/base.pyx":42
 * 
 *     def __cinit__(self):
 *         self.tid = None             # <<<<<<<<<<<<<<
 *         self.name = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->tid);
  __Pyx_DECREF(__pyx_v_self->tid);
  __pyx_v_self->tid = ((PyObject*)Py_None);

  /* "gel/protocol/codecs/base.pyx":43
 *     def __cinit__(self):
 *         self.tid = None
 *         self.name = None             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* "gel/protocol/codecs/base.pyx":41
 *             'codecs are not supposed to be instantiated directly')
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.tid = None
 *         self.name = None
 */

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

/* "gel/protocol/codecs/base.pyx":45
 *         self.name = None
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_encode(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, CYTHON_UNUSED PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/base.pyx":46
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(1, 46, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":45
 *         self.name = None
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":48
 *         raise NotImplementedError
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_decode(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, CYTHON_UNUSED struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/base.pyx":49
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef dump(self, int level = 0):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(1, 49, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":48
 *         raise NotImplementedError
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":51
 *         raise NotImplementedError
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}'
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_9BaseCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args) {
  int __pyx_v_level = ((int)0);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_level = __pyx_optional_args->level;
    }
  }

  /* "gel/protocol/codecs/base.pyx":52
 * 
 *     cdef dump(self, int level = 0):
 *         return f'{level * " "}{self.name}'             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PySequence_Multiply_Left(__pyx_v_level, __pyx_kp_u__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":51
 *         raise NotImplementedError
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}'
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":54
 *         return f'{level * " "}{self.name}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_5make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9BaseCodec_5make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_5make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_5make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(1, 54, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 54, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9BaseCodec_4make_type(((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9BaseCodec_4make_type(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_describe_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/base.pyx":55
 * 
 *     def make_type(self, describe_context):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(1, 55, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":54
 *         return f'{level * " "}{self.name}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9BaseCodec_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9BaseCodec_6__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9BaseCodec_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9BaseCodec_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9BaseCodec_8__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9BaseCodec_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":60
 * cdef class CodecPythonOverride(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.codec = None
 *         self.encoder = None
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/base.pyx":61
 * 
 *     def __cinit__(self):
 *         self.codec = None             # <<<<<<<<<<<<<<
 *         self.encoder = None
 *         self.decoder = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->codec);
  __Pyx_DECREF((PyObject *)__pyx_v_self->codec);
  __pyx_v_self->codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);

  /* "gel/protocol/codecs/base.pyx":62
 *     def __cinit__(self):
 *         self.codec = None
 *         self.encoder = None             # <<<<<<<<<<<<<<
 *         self.decoder = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->encoder);
  __Pyx_DECREF(__pyx_v_self->encoder);
  __pyx_v_self->encoder = Py_None;

  /* "gel/protocol/codecs/base.pyx":63
 *         self.codec = None
 *         self.encoder = None
 *         self.decoder = None             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->decoder);
  __Pyx_DECREF(__pyx_v_self->decoder);
  __pyx_v_self->decoder = Py_None;

  /* "gel/protocol/codecs/base.pyx":60
 * cdef class CodecPythonOverride(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.codec = None
 *         self.encoder = None
 */

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

/* "gel/protocol/codecs/base.pyx":65
 *         self.decoder = None
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         self.codec.encode(buf, self.encoder(obj))
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_encode(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/base.pyx":66
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         self.codec.encode(buf, self.encoder(obj))             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __Pyx_INCREF(__pyx_v_self->encoder);
  __pyx_t_2 = __pyx_v_self->encoder; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_obj};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self->codec->__pyx_vtab)->encode(__pyx_v_self->codec, __pyx_v_buf, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __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;

  /* "gel/protocol/codecs/base.pyx":65
 *         self.decoder = None
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         self.codec.encode(buf, self.encoder(obj))
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":68
 *         self.codec.encode(buf, self.encoder(obj))
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self.decoder(self.codec.decode(buf))
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_decode(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/base.pyx":69
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         return self.decoder(self.codec.decode(buf))             # <<<<<<<<<<<<<<
 * 
 *     cdef dump(self, int level = 0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self->codec->__pyx_vtab)->decode(__pyx_v_self->codec, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->decoder);
  __pyx_t_3 = __pyx_v_self->decoder; __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 69, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":68
 *         self.codec.encode(buf, self.encoder(obj))
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self.decoder(self.codec.decode(buf))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":71
 *         return self.decoder(self.codec.decode(buf))
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}<Python override>{self.name}'
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_dump(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_19CodecPythonOverride_dump *__pyx_optional_args) {
  int __pyx_v_level = ((int)0);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_level = __pyx_optional_args->level;
    }
  }

  /* "gel/protocol/codecs/base.pyx":72
 * 
 *     cdef dump(self, int level = 0):
 *         return f'{level * " "}<Python override>{self.name}'             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PySequence_Multiply_Left(__pyx_v_level, __pyx_kp_u__13); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u_Python_override);
  __pyx_t_2 += 17;
  __Pyx_GIVEREF(__pyx_kp_u_Python_override);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_Python_override);
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":71
 *         return self.decoder(self.codec.decode(buf))
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}<Python override>{self.name}'
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":75
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid,             # <<<<<<<<<<<<<<
 *                        BaseCodec basecodec,
 *                        object encoder,
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_basecodec, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder) {
  struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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("new", 1);

  /* "gel/protocol/codecs/base.pyx":83
 *             CodecPythonOverride codec
 * 
 *         codec = CodecPythonOverride.__new__(CodecPythonOverride)             # <<<<<<<<<<<<<<
 *         codec.tid = tid
 *         codec.name = basecodec.name
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_CodecPythonOverride(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":84
 * 
 *         codec = CodecPythonOverride.__new__(CodecPythonOverride)
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = basecodec.name
 *         codec.codec = basecodec
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.tid);
  __pyx_v_codec->__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/base.pyx":85
 *         codec = CodecPythonOverride.__new__(CodecPythonOverride)
 *         codec.tid = tid
 *         codec.name = basecodec.name             # <<<<<<<<<<<<<<
 *         codec.codec = basecodec
 *         codec.encoder = encoder
 */
  __pyx_t_1 = __pyx_v_basecodec->name;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.name);
  __pyx_v_codec->__pyx_base.name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":86
 *         codec.tid = tid
 *         codec.name = basecodec.name
 *         codec.codec = basecodec             # <<<<<<<<<<<<<<
 *         codec.encoder = encoder
 *         codec.decoder = decoder
 */
  __Pyx_INCREF((PyObject *)__pyx_v_basecodec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_basecodec);
  __Pyx_GOTREF((PyObject *)__pyx_v_codec->codec);
  __Pyx_DECREF((PyObject *)__pyx_v_codec->codec);
  __pyx_v_codec->codec = __pyx_v_basecodec;

  /* "gel/protocol/codecs/base.pyx":87
 *         codec.name = basecodec.name
 *         codec.codec = basecodec
 *         codec.encoder = encoder             # <<<<<<<<<<<<<<
 *         codec.decoder = decoder
 *         return codec
 */
  __Pyx_INCREF(__pyx_v_encoder);
  __Pyx_GIVEREF(__pyx_v_encoder);
  __Pyx_GOTREF(__pyx_v_codec->encoder);
  __Pyx_DECREF(__pyx_v_codec->encoder);
  __pyx_v_codec->encoder = __pyx_v_encoder;

  /* "gel/protocol/codecs/base.pyx":88
 *         codec.codec = basecodec
 *         codec.encoder = encoder
 *         codec.decoder = decoder             # <<<<<<<<<<<<<<
 *         return codec
 * 
 */
  __Pyx_INCREF(__pyx_v_decoder);
  __Pyx_GIVEREF(__pyx_v_decoder);
  __Pyx_GOTREF(__pyx_v_codec->decoder);
  __Pyx_DECREF(__pyx_v_codec->decoder);
  __pyx_v_codec->decoder = __pyx_v_decoder;

  /* "gel/protocol/codecs/base.pyx":89
 *         codec.encoder = encoder
 *         codec.decoder = decoder
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":75
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid,             # <<<<<<<<<<<<<<
 *                        BaseCodec basecodec,
 *                        object encoder,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":91
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return self.codec.make_type(describe_context)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_19CodecPythonOverride_3make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 91, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(1, 91, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 91, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_2make_type(((struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/base.pyx":92
 * 
 *     def make_type(self, describe_context):
 *         return self.codec.make_type(describe_context)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->codec), __pyx_n_s_make_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_describe_context};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":91
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return self.codec.make_type(describe_context)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_19CodecPythonOverride_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_4__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_19CodecPythonOverride_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_6__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_19CodecPythonOverride_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.CodecPythonOverride.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":97
 * cdef class EmptyTupleCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.tid = EMPTY_TUPLE_CODEC_ID
 *         self.name = 'no-input'
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/base.pyx":98
 * 
 *     def __cinit__(self):
 *         self.tid = EMPTY_TUPLE_CODEC_ID             # <<<<<<<<<<<<<<
 *         self.name = 'no-input'
 *         self.empty_tup = None
 */
  __Pyx_INCREF(__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID);
  __Pyx_GIVEREF(__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.tid);
  __pyx_v_self->__pyx_base.tid = __pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID;

  /* "gel/protocol/codecs/base.pyx":99
 *     def __cinit__(self):
 *         self.tid = EMPTY_TUPLE_CODEC_ID
 *         self.name = 'no-input'             # <<<<<<<<<<<<<<
 *         self.empty_tup = None
 * 
 */
  __Pyx_INCREF(__pyx_kp_u_no_input);
  __Pyx_GIVEREF(__pyx_kp_u_no_input);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.name);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.name);
  __pyx_v_self->__pyx_base.name = __pyx_kp_u_no_input;

  /* "gel/protocol/codecs/base.pyx":100
 *         self.tid = EMPTY_TUPLE_CODEC_ID
 *         self.name = 'no-input'
 *         self.empty_tup = None             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->empty_tup);
  __Pyx_DECREF(__pyx_v_self->empty_tup);
  __pyx_v_self->empty_tup = Py_None;

  /* "gel/protocol/codecs/base.pyx":97
 * cdef class EmptyTupleCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.tid = EMPTY_TUPLE_CODEC_ID
 *         self.name = 'no-input'
 */

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

/* "gel/protocol/codecs/base.pyx":102
 *         self.empty_tup = None
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         if type(obj) is not tuple:
 *             raise RuntimeError(
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_15EmptyTupleCodec_encode(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/base.pyx":103
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         if type(obj) is not tuple:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot encode empty Tuple: expected a tuple, '
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_obj)) != ((PyObject *)(&PyTuple_Type)));
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/base.pyx":106
 *             raise RuntimeError(
 *                 f'cannot encode empty Tuple: expected a tuple, '
 *                 f'got {type(obj).__name__}')             # <<<<<<<<<<<<<<
 *         if len(obj) != 0:
 *             raise RuntimeError(
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_2, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/codecs/base.pyx":105
 *         if type(obj) is not tuple:
 *             raise RuntimeError(
 *                 f'cannot encode empty Tuple: expected a tuple, '             # <<<<<<<<<<<<<<
 *                 f'got {type(obj).__name__}')
 *         if len(obj) != 0:
 */
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_cannot_encode_empty_Tuple_expect, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/codecs/base.pyx":104
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         if type(obj) is not tuple:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'cannot encode empty Tuple: expected a tuple, '
 *                 f'got {type(obj).__name__}')
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 104, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":103
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         if type(obj) is not tuple:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot encode empty Tuple: expected a tuple, '
 */
  }

  /* "gel/protocol/codecs/base.pyx":107
 *                 f'cannot encode empty Tuple: expected a tuple, '
 *                 f'got {type(obj).__name__}')
 *         if len(obj) != 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot encode empty Tuple: expected 0 elements, '
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 107, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_4 != 0);
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/base.pyx":110
 *             raise RuntimeError(
 *                 f'cannot encode empty Tuple: expected 0 elements, '
 *                 f'got {len(obj)}')             # <<<<<<<<<<<<<<
 *         buf.write_bytes(EMPTY_RECORD_DATA)
 * 
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 110, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_4, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 110, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "gel/protocol/codecs/base.pyx":109
 *         if len(obj) != 0:
 *             raise RuntimeError(
 *                 f'cannot encode empty Tuple: expected 0 elements, '             # <<<<<<<<<<<<<<
 *                 f'got {len(obj)}')
 *         buf.write_bytes(EMPTY_RECORD_DATA)
 */
    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_cannot_encode_empty_Tuple_expect_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/codecs/base.pyx":108
 *                 f'got {type(obj).__name__}')
 *         if len(obj) != 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'cannot encode empty Tuple: expected 0 elements, '
 *                 f'got {len(obj)}')
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 108, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":107
 *                 f'cannot encode empty Tuple: expected a tuple, '
 *                 f'got {type(obj).__name__}')
 *         if len(obj) != 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot encode empty Tuple: expected 0 elements, '
 */
  }

  /* "gel/protocol/codecs/base.pyx":111
 *                 f'cannot encode empty Tuple: expected 0 elements, '
 *                 f'got {len(obj)}')
 *         buf.write_bytes(EMPTY_RECORD_DATA)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EMPTY_RECORD_DATA); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 111, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/base.pyx":102
 *         self.empty_tup = None
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         if type(obj) is not tuple:
 *             raise RuntimeError(
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.EmptyTupleCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":113
 *         buf.write_bytes(EMPTY_RECORD_DATA)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if elem_count != 0:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_15EmptyTupleCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  Py_ssize_t __pyx_v_elem_count;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/base.pyx":114
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         if elem_count != 0:
 *             raise RuntimeError(
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 114, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1)));

  /* "gel/protocol/codecs/base.pyx":115
 *     cdef decode(self, FRBuffer *buf):
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if elem_count != 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode empty Tuple: expected 0 elements, '
 */
  __pyx_t_2 = (__pyx_v_elem_count != 0);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/base.pyx":118
 *             raise RuntimeError(
 *                 f'cannot decode empty Tuple: expected 0 elements, '
 *                 f'got {elem_count}')             # <<<<<<<<<<<<<<
 * 
 *         if self.empty_tup is None:
 */
    __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_elem_count, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "gel/protocol/codecs/base.pyx":117
 *         if elem_count != 0:
 *             raise RuntimeError(
 *                 f'cannot decode empty Tuple: expected 0 elements, '             # <<<<<<<<<<<<<<
 *                 f'got {elem_count}')
 * 
 */
    __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_cannot_decode_empty_Tuple_expect, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/codecs/base.pyx":116
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if elem_count != 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'cannot decode empty Tuple: expected 0 elements, '
 *                 f'got {elem_count}')
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 116, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":115
 *     cdef decode(self, FRBuffer *buf):
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if elem_count != 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode empty Tuple: expected 0 elements, '
 */
  }

  /* "gel/protocol/codecs/base.pyx":120
 *                 f'got {elem_count}')
 * 
 *         if self.empty_tup is None:             # <<<<<<<<<<<<<<
 *             self.empty_tup = cpython.PyTuple_New(0)
 *         return self.empty_tup
 */
  __pyx_t_2 = (__pyx_v_self->empty_tup == Py_None);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/base.pyx":121
 * 
 *         if self.empty_tup is None:
 *             self.empty_tup = cpython.PyTuple_New(0)             # <<<<<<<<<<<<<<
 *         return self.empty_tup
 * 
 */
    __pyx_t_3 = PyTuple_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->empty_tup);
    __Pyx_DECREF(__pyx_v_self->empty_tup);
    __pyx_v_self->empty_tup = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "gel/protocol/codecs/base.pyx":120
 *                 f'got {elem_count}')
 * 
 *         if self.empty_tup is None:             # <<<<<<<<<<<<<<
 *             self.empty_tup = cpython.PyTuple_New(0)
 *         return self.empty_tup
 */
  }

  /* "gel/protocol/codecs/base.pyx":122
 *         if self.empty_tup is None:
 *             self.empty_tup = cpython.PyTuple_New(0)
 *         return self.empty_tup             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->empty_tup);
  __pyx_r = __pyx_v_self->empty_tup;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":113
 *         buf.write_bytes(EMPTY_RECORD_DATA)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if elem_count != 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.EmptyTupleCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":124
 *         return self.empty_tup
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15EmptyTupleCodec_3make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(1, 124, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 124, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.EmptyTupleCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_2make_type(((struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_describe_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/base.pyx":125
 * 
 *     def make_type(self, describe_context):
 *         return describe.TupleType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TupleType); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":126
 *     def make_type(self, describe_context):
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=None,
 *             element_types=()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.tid) < 0) __PYX_ERR(1, 126, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(1, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/base.pyx":127
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,             # <<<<<<<<<<<<<<
 *             element_types=()
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, Py_None) < 0) __PYX_ERR(1, 126, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":128
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 *             element_types=()             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_element_types, __pyx_empty_tuple) < 0) __PYX_ERR(1, 126, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":125
 * 
 *     def make_type(self, describe_context):
 *         return describe.TupleType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":124
 *         return self.empty_tup
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.EmptyTupleCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15EmptyTupleCodec_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_4__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.EmptyTupleCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15EmptyTupleCodec_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.EmptyTupleCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_6__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15EmptyTupleCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.EmptyTupleCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":134
 * cdef class NullCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.tid = NULL_CODEC_ID
 *         self.name = 'null-codec'
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_9NullCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_9NullCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9NullCodec___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_9NullCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/base.pyx":135
 * 
 *     def __cinit__(self):
 *         self.tid = NULL_CODEC_ID             # <<<<<<<<<<<<<<
 *         self.name = 'null-codec'
 * 
 */
  __Pyx_INCREF(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID);
  __Pyx_GIVEREF(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.tid);
  __pyx_v_self->__pyx_base.tid = __pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID;

  /* "gel/protocol/codecs/base.pyx":136
 *     def __cinit__(self):
 *         self.tid = NULL_CODEC_ID
 *         self.name = 'null-codec'             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_INCREF(__pyx_kp_u_null_codec);
  __Pyx_GIVEREF(__pyx_kp_u_null_codec);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.name);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.name);
  __pyx_v_self->__pyx_base.name = __pyx_kp_u_null_codec;

  /* "gel/protocol/codecs/base.pyx":134
 * cdef class NullCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.tid = NULL_CODEC_ID
 *         self.name = 'null-codec'
 */

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

/* "gel/protocol/codecs/base.pyx":138
 *         self.name = 'null-codec'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9NullCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9NullCodec_3make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9NullCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9NullCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 138, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(1, 138, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 138, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.NullCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9NullCodec_2make_type(((struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9NullCodec_2make_type(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_describe_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/base.pyx":139
 * 
 *     def make_type(self, describe_context):
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":138
 *         self.name = 'null-codec'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return None
 * 
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9NullCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9NullCodec_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9NullCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9NullCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9NullCodec_4__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9NullCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.NullCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9NullCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9NullCodec_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9NullCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9NullCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.NullCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9NullCodec_6__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9NullCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.NullCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":144
 * cdef class BaseRecordCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.fields_codecs = ()
 *         self.encoder_flags = 0
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/base.pyx":145
 * 
 *     def __cinit__(self):
 *         self.fields_codecs = ()             # <<<<<<<<<<<<<<
 *         self.encoder_flags = 0
 * 
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  __Pyx_GOTREF(__pyx_v_self->fields_codecs);
  __Pyx_DECREF(__pyx_v_self->fields_codecs);
  __pyx_v_self->fields_codecs = __pyx_empty_tuple;

  /* "gel/protocol/codecs/base.pyx":146
 *     def __cinit__(self):
 *         self.fields_codecs = ()
 *         self.encoder_flags = 0             # <<<<<<<<<<<<<<
 * 
 *     cdef _check_encoder(self):
 */
  __pyx_v_self->encoder_flags = 0;

  /* "gel/protocol/codecs/base.pyx":144
 * cdef class BaseRecordCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.fields_codecs = ()
 *         self.encoder_flags = 0
 */

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

/* "gel/protocol/codecs/base.pyx":148
 *         self.encoder_flags = 0
 * 
 *     cdef _check_encoder(self):             # <<<<<<<<<<<<<<
 *         if not (self.encoder_flags & RECORD_ENCODER_CHECKED):
 *             for codec in self.fields_codecs:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_15BaseRecordCodec__check_encoder(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self) {
  PyObject *__pyx_v_codec = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_encoder", 1);

  /* "gel/protocol/codecs/base.pyx":149
 * 
 *     cdef _check_encoder(self):
 *         if not (self.encoder_flags & RECORD_ENCODER_CHECKED):             # <<<<<<<<<<<<<<
 *             for codec in self.fields_codecs:
 *                 if not isinstance(
 */
  __pyx_t_1 = (!((__pyx_v_self->encoder_flags & __pyx_v_3gel_8protocol_8protocol_RECORD_ENCODER_CHECKED) != 0));
  if (__pyx_t_1) {

    /* "gel/protocol/codecs/base.pyx":150
 *     cdef _check_encoder(self):
 *         if not (self.encoder_flags & RECORD_ENCODER_CHECKED):
 *             for codec in self.fields_codecs:             # <<<<<<<<<<<<<<
 *                 if not isinstance(
 *                     codec,
 */
    if (unlikely(__pyx_v_self->fields_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(1, 150, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_self->fields_codecs; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 150, __pyx_L1_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 150, __pyx_L1_error)
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_codec, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "gel/protocol/codecs/base.pyx":153
 *                 if not isinstance(
 *                     codec,
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,             # <<<<<<<<<<<<<<
 *                      EnumCodec, RangeCodec, MultiRangeCodec),
 *                 ):
 */
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_codec, __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec); 
      if (!__pyx_t_5) {
      } else {
        __pyx_t_1 = __pyx_t_5;
        goto __pyx_L7_bool_binop_done;
      }

      /* "gel/protocol/codecs/base.pyx":152
 *             for codec in self.fields_codecs:
 *                 if not isinstance(
 *                     codec,             # <<<<<<<<<<<<<<
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,
 *                      EnumCodec, RangeCodec, MultiRangeCodec),
 */
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_codec, __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec); 
      if (!__pyx_t_5) {
      } else {
        __pyx_t_1 = __pyx_t_5;
        goto __pyx_L7_bool_binop_done;
      }

      /* "gel/protocol/codecs/base.pyx":153
 *                 if not isinstance(
 *                     codec,
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,             # <<<<<<<<<<<<<<
 *                      EnumCodec, RangeCodec, MultiRangeCodec),
 *                 ):
 */
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_codec, __pyx_ptype_3gel_8protocol_8protocol_TupleCodec); 
      if (!__pyx_t_5) {
      } else {
        __pyx_t_1 = __pyx_t_5;
        goto __pyx_L7_bool_binop_done;
      }

      /* "gel/protocol/codecs/base.pyx":152
 *             for codec in self.fields_codecs:
 *                 if not isinstance(
 *                     codec,             # <<<<<<<<<<<<<<
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,
 *                      EnumCodec, RangeCodec, MultiRangeCodec),
 */
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_codec, __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec); 
      if (!__pyx_t_5) {
      } else {
        __pyx_t_1 = __pyx_t_5;
        goto __pyx_L7_bool_binop_done;
      }

      /* "gel/protocol/codecs/base.pyx":154
 *                     codec,
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,
 *                      EnumCodec, RangeCodec, MultiRangeCodec),             # <<<<<<<<<<<<<<
 *                 ):
 *                     self.encoder_flags |= RECORD_ENCODER_INVALID
 */
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_codec, __pyx_ptype_3gel_8protocol_8protocol_EnumCodec); 
      if (!__pyx_t_5) {
      } else {
        __pyx_t_1 = __pyx_t_5;
        goto __pyx_L7_bool_binop_done;
      }

      /* "gel/protocol/codecs/base.pyx":152
 *             for codec in self.fields_codecs:
 *                 if not isinstance(
 *                     codec,             # <<<<<<<<<<<<<<
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,
 *                      EnumCodec, RangeCodec, MultiRangeCodec),
 */
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_codec, __pyx_ptype_3gel_8protocol_8protocol_RangeCodec); 
      if (!__pyx_t_5) {
      } else {
        __pyx_t_1 = __pyx_t_5;
        goto __pyx_L7_bool_binop_done;
      }

      /* "gel/protocol/codecs/base.pyx":154
 *                     codec,
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,
 *                      EnumCodec, RangeCodec, MultiRangeCodec),             # <<<<<<<<<<<<<<
 *                 ):
 *                     self.encoder_flags |= RECORD_ENCODER_INVALID
 */
      __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_codec, __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec); 
      __pyx_t_1 = __pyx_t_5;
      __pyx_L7_bool_binop_done:;

      /* "gel/protocol/codecs/base.pyx":151
 *         if not (self.encoder_flags & RECORD_ENCODER_CHECKED):
 *             for codec in self.fields_codecs:
 *                 if not isinstance(             # <<<<<<<<<<<<<<
 *                     codec,
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,
 */
      __pyx_t_5 = (!__pyx_t_1);
      if (__pyx_t_5) {

        /* "gel/protocol/codecs/base.pyx":156
 *                      EnumCodec, RangeCodec, MultiRangeCodec),
 *                 ):
 *                     self.encoder_flags |= RECORD_ENCODER_INVALID             # <<<<<<<<<<<<<<
 *                     break
 *             self.encoder_flags |= RECORD_ENCODER_CHECKED
 */
        __pyx_v_self->encoder_flags = (__pyx_v_self->encoder_flags | __pyx_v_3gel_8protocol_8protocol_RECORD_ENCODER_INVALID);

        /* "gel/protocol/codecs/base.pyx":157
 *                 ):
 *                     self.encoder_flags |= RECORD_ENCODER_INVALID
 *                     break             # <<<<<<<<<<<<<<
 *             self.encoder_flags |= RECORD_ENCODER_CHECKED
 * 
 */
        goto __pyx_L5_break;

        /* "gel/protocol/codecs/base.pyx":151
 *         if not (self.encoder_flags & RECORD_ENCODER_CHECKED):
 *             for codec in self.fields_codecs:
 *                 if not isinstance(             # <<<<<<<<<<<<<<
 *                     codec,
 *                     (ScalarCodec, ArrayCodec, TupleCodec, NamedTupleCodec,
 */
      }

      /* "gel/protocol/codecs/base.pyx":150
 *     cdef _check_encoder(self):
 *         if not (self.encoder_flags & RECORD_ENCODER_CHECKED):
 *             for codec in self.fields_codecs:             # <<<<<<<<<<<<<<
 *                 if not isinstance(
 *                     codec,
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L14_for_end;
    __pyx_L5_break:;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L14_for_end;
    __pyx_L14_for_end:;

    /* "gel/protocol/codecs/base.pyx":158
 *                     self.encoder_flags |= RECORD_ENCODER_INVALID
 *                     break
 *             self.encoder_flags |= RECORD_ENCODER_CHECKED             # <<<<<<<<<<<<<<
 * 
 *         if self.encoder_flags & RECORD_ENCODER_INVALID:
 */
    __pyx_v_self->encoder_flags = (__pyx_v_self->encoder_flags | __pyx_v_3gel_8protocol_8protocol_RECORD_ENCODER_CHECKED);

    /* "gel/protocol/codecs/base.pyx":149
 * 
 *     cdef _check_encoder(self):
 *         if not (self.encoder_flags & RECORD_ENCODER_CHECKED):             # <<<<<<<<<<<<<<
 *             for codec in self.fields_codecs:
 *                 if not isinstance(
 */
  }

  /* "gel/protocol/codecs/base.pyx":160
 *             self.encoder_flags |= RECORD_ENCODER_CHECKED
 * 
 *         if self.encoder_flags & RECORD_ENCODER_INVALID:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'argument tuples do not support objects')
 */
  __pyx_t_5 = ((__pyx_v_self->encoder_flags & __pyx_v_3gel_8protocol_8protocol_RECORD_ENCODER_INVALID) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "gel/protocol/codecs/base.pyx":161
 * 
 *         if self.encoder_flags & RECORD_ENCODER_INVALID:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'argument tuples do not support objects')
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 161, __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(1, 161, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":160
 *             self.encoder_flags |= RECORD_ENCODER_CHECKED
 * 
 *         if self.encoder_flags & RECORD_ENCODER_INVALID:             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'argument tuples do not support objects')
 */
  }

  /* "gel/protocol/codecs/base.pyx":148
 *         self.encoder_flags = 0
 * 
 *     cdef _check_encoder(self):             # <<<<<<<<<<<<<<
 *         if not (self.encoder_flags & RECORD_ENCODER_CHECKED):
 *             for codec in self.fields_codecs:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseRecordCodec._check_encoder", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_codec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":164
 *                 'argument tuples do not support objects')
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_15BaseRecordCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  Py_ssize_t __pyx_v_objlen;
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec = 0;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_value_repr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_t_21;
  char const *__pyx_t_22;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  PyObject *__pyx_t_28 = NULL;
  int32_t __pyx_t_29;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/base.pyx":171
 *             BaseCodec sub_codec
 * 
 *         self._check_encoder()             # <<<<<<<<<<<<<<
 * 
 *         if not _is_array_iterable(obj):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_encoder(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":173
 *         self._check_encoder()
 * 
 *         if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'a sized iterable container expected (got type {!r})'.format(
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 173, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/base.pyx":175
 *         if not _is_array_iterable(obj):
 *             raise TypeError(
 *                 'a sized iterable container expected (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                     type(obj).__name__))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_sized_iterable_container_expec, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "gel/protocol/codecs/base.pyx":176
 *             raise TypeError(
 *                 'a sized iterable container expected (got type {!r})'.format(
 *                     type(obj).__name__))             # <<<<<<<<<<<<<<
 * 
 *         objlen = len(obj)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "gel/protocol/codecs/base.pyx":174
 * 
 *         if not _is_array_iterable(obj):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'a sized iterable container expected (got type {!r})'.format(
 *                     type(obj).__name__))
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(1, 174, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":173
 *         self._check_encoder()
 * 
 *         if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'a sized iterable container expected (got type {!r})'.format(
 */
  }

  /* "gel/protocol/codecs/base.pyx":178
 *                     type(obj).__name__))
 * 
 *         objlen = len(obj)             # <<<<<<<<<<<<<<
 *         if objlen == 0:
 *             buf.write_bytes(EMPTY_RECORD_DATA)
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 178, __pyx_L1_error)
  __pyx_v_objlen = __pyx_t_8;

  /* "gel/protocol/codecs/base.pyx":179
 * 
 *         objlen = len(obj)
 *         if objlen == 0:             # <<<<<<<<<<<<<<
 *             buf.write_bytes(EMPTY_RECORD_DATA)
 *             return
 */
  __pyx_t_3 = (__pyx_v_objlen == 0);
  if (__pyx_t_3) {

    /* "gel/protocol/codecs/base.pyx":180
 *         objlen = len(obj)
 *         if objlen == 0:
 *             buf.write_bytes(EMPTY_RECORD_DATA)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EMPTY_RECORD_DATA); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(1, 180, __pyx_L1_error)
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 180, __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;

    /* "gel/protocol/codecs/base.pyx":181
 *         if objlen == 0:
 *             buf.write_bytes(EMPTY_RECORD_DATA)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if objlen > _MAXINT32:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "gel/protocol/codecs/base.pyx":179
 * 
 *         objlen = len(obj)
 *         if objlen == 0:             # <<<<<<<<<<<<<<
 *             buf.write_bytes(EMPTY_RECORD_DATA)
 *             return
 */
  }

  /* "gel/protocol/codecs/base.pyx":183
 *             return
 * 
 *         if objlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements for a tuple')
 * 
 */
  __pyx_t_3 = (__pyx_v_objlen > 0x7FFFFFFF);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/base.pyx":184
 * 
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements for a tuple')             # <<<<<<<<<<<<<<
 * 
 *         if objlen != len(self.fields_codecs):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 184, __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(1, 184, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":183
 *             return
 * 
 *         if objlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements for a tuple')
 * 
 */
  }

  /* "gel/protocol/codecs/base.pyx":186
 *             raise ValueError('too many elements for a tuple')
 * 
 *         if objlen != len(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '
 */
  __pyx_t_1 = __pyx_v_self->fields_codecs;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 186, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_v_objlen != __pyx_t_8);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/base.pyx":188
 *         if objlen != len(self.fields_codecs):
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '             # <<<<<<<<<<<<<<
 *                 f'got {objlen}')
 * 
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_expected);
    __pyx_t_8 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_expected);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_expected);
    __pyx_t_4 = __pyx_v_self->fields_codecs;
    __Pyx_INCREF(__pyx_t_4);
    if (unlikely(__pyx_t_4 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(1, 188, __pyx_L1_error)
    }
    __pyx_t_10 = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(1, 188, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u_elements_in_the_tuple_got);
    __pyx_t_8 += 28;
    __Pyx_GIVEREF(__pyx_kp_u_elements_in_the_tuple_got);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_elements_in_the_tuple_got);

    /* "gel/protocol/codecs/base.pyx":189
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '
 *                 f'got {objlen}')             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
 */
    __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_objlen, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "gel/protocol/codecs/base.pyx":188
 *         if objlen != len(self.fields_codecs):
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '             # <<<<<<<<<<<<<<
 *                 f'got {objlen}')
 * 
 */
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/base.pyx":187
 * 
 *         if objlen != len(self.fields_codecs):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '
 *                 f'got {objlen}')
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 187, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":186
 *             raise ValueError('too many elements for a tuple')
 * 
 *         if objlen != len(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '
 */
  }

  /* "gel/protocol/codecs/base.pyx":191
 *                 f'got {objlen}')
 * 
 *         elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         for i in range(objlen):
 *             item = obj[i]
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elem_data = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":192
 * 
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):             # <<<<<<<<<<<<<<
 *             item = obj[i]
 *             elem_data.write_int32(0)  # reserved bytes
 */
  __pyx_t_8 = __pyx_v_objlen;
  __pyx_t_10 = __pyx_t_8;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "gel/protocol/codecs/base.pyx":193
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):
 *             item = obj[i]             # <<<<<<<<<<<<<<
 *             elem_data.write_int32(0)  # reserved bytes
 *             if item is None:
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/base.pyx":194
 *         for i in range(objlen):
 *             item = obj[i]
 *             elem_data.write_int32(0)  # reserved bytes             # <<<<<<<<<<<<<<
 *             if item is None:
 *                 elem_data.write_int32(-1)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/base.pyx":195
 *             item = obj[i]
 *             elem_data.write_int32(0)  # reserved bytes
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
 */
    __pyx_t_3 = (__pyx_v_item == Py_None);
    if (__pyx_t_3) {

      /* "gel/protocol/codecs/base.pyx":196
 *             elem_data.write_int32(0)  # reserved bytes
 *             if item is None:
 *                 elem_data.write_int32(-1)             # <<<<<<<<<<<<<<
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/codecs/base.pyx":195
 *             item = obj[i]
 *             elem_data.write_int32(0)  # reserved bytes
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
 */
      goto __pyx_L9;
    }

    /* "gel/protocol/codecs/base.pyx":198
 *                 elem_data.write_int32(-1)
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])             # <<<<<<<<<<<<<<
 *                 try:
 *                     sub_codec.encode(elem_data, item)
 */
    /*else*/ {
      if (unlikely(__pyx_v_self->fields_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 198, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_self->fields_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "gel/protocol/codecs/base.pyx":199
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        /*try:*/ {

          /* "gel/protocol/codecs/base.pyx":200
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:
 *                     sub_codec.encode(elem_data, item)             # <<<<<<<<<<<<<<
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(item)
 */
          __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->encode(__pyx_v_sub_codec, __pyx_v_elem_data, __pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 200, __pyx_L10_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "gel/protocol/codecs/base.pyx":199
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:
 */
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L17_try_end;
        __pyx_L10_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "gel/protocol/codecs/base.pyx":201
 *                 try:
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:             # <<<<<<<<<<<<<<
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:
 */
        __pyx_t_15 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError);
        if (__pyx_t_15) {
          __Pyx_AddTraceback("gel.protocol.protocol.BaseRecordCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_5) < 0) __PYX_ERR(1, 201, __pyx_L12_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_1);
          __pyx_v_e = __pyx_t_1;
          /*try:*/ {

            /* "gel/protocol/codecs/base.pyx":202
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(item)             # <<<<<<<<<<<<<<
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
 */
            __pyx_t_6 = PyObject_Repr(__pyx_v_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 202, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_v_value_repr = __pyx_t_6;
            __pyx_t_6 = 0;

            /* "gel/protocol/codecs/base.pyx":203
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 */
            __pyx_t_16 = PyObject_Length(__pyx_v_value_repr); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(1, 203, __pyx_L23_error)
            __pyx_t_3 = (__pyx_t_16 > 40);
            if (__pyx_t_3) {

              /* "gel/protocol/codecs/base.pyx":204
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 */
              __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_value_repr, 0, 40, NULL, NULL, &__pyx_slice__16, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 204, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_6);
              __pyx_t_17 = PyNumber_Add(__pyx_t_6, __pyx_kp_u__17); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 204, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_DECREF_SET(__pyx_v_value_repr, __pyx_t_17);
              __pyx_t_17 = 0;

              /* "gel/protocol/codecs/base.pyx":203
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 */
            }

            /* "gel/protocol/codecs/base.pyx":205
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(
 */
            __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 205, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 205, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_18);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "gel/protocol/codecs/base.pyx":207
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(             # <<<<<<<<<<<<<<
 *                             n=i, v=value_repr, msg=e)) from e
 * 
 */
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_input_for_query_argument, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 207, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_6);

            /* "gel/protocol/codecs/base.pyx":208
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(
 *                             n=i, v=value_repr, msg=e)) from e             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 */
            __pyx_t_19 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 208, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_20 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 208, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_20);
            if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_n, __pyx_t_20) < 0) __PYX_ERR(1, 208, __pyx_L23_error)
            __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
            if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_v, __pyx_v_value_repr) < 0) __PYX_ERR(1, 208, __pyx_L23_error)
            if (PyDict_SetItem(__pyx_t_19, __pyx_n_s_msg, __pyx_v_e) < 0) __PYX_ERR(1, 208, __pyx_L23_error)

            /* "gel/protocol/codecs/base.pyx":207
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(             # <<<<<<<<<<<<<<
 *                             n=i, v=value_repr, msg=e)) from e
 * 
 */
            __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 207, __pyx_L23_error)
            __Pyx_GOTREF(__pyx_t_20);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            __pyx_t_19 = NULL;
            __pyx_t_7 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_18))) {
              __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_18);
              if (likely(__pyx_t_19)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_18);
                __Pyx_INCREF(__pyx_t_19);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_18, function);
                __pyx_t_7 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_19, __pyx_t_20};
              __pyx_t_17 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
              if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 205, __pyx_L23_error)
              __Pyx_GOTREF(__pyx_t_17);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            }

            /* "gel/protocol/codecs/base.pyx":208
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(
 *                             n=i, v=value_repr, msg=e)) from e             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 */
            __Pyx_Raise(__pyx_t_17, 0, 0, __pyx_v_e);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __PYX_ERR(1, 205, __pyx_L23_error)
          }

          /* "gel/protocol/codecs/base.pyx":201
 *                 try:
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:             # <<<<<<<<<<<<<<
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:
 */
          /*finally:*/ {
            __pyx_L23_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_27, &__pyx_t_28);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25) < 0)) __Pyx_ErrFetch(&__pyx_t_23, &__pyx_t_24, &__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_27);
              __Pyx_XGOTREF(__pyx_t_28);
              __pyx_t_15 = __pyx_lineno; __pyx_t_21 = __pyx_clineno; __pyx_t_22 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_XGIVEREF(__pyx_t_27);
                __Pyx_XGIVEREF(__pyx_t_28);
                __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_27, __pyx_t_28);
              }
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_XGIVEREF(__pyx_t_25);
              __Pyx_ErrRestore(__pyx_t_23, __pyx_t_24, __pyx_t_25);
              __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0; __pyx_t_28 = 0;
              __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_21; __pyx_filename = __pyx_t_22;
              goto __pyx_L12_except_error;
            }
          }
        }
        goto __pyx_L12_except_error;

        /* "gel/protocol/codecs/base.pyx":199
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:
 */
        __pyx_L12_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L17_try_end:;
      }
    }
    __pyx_L9:;
  }

  /* "gel/protocol/codecs/base.pyx":210
 *                             n=i, v=value_repr, msg=e)) from e
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length             # <<<<<<<<<<<<<<
 *         buf.write_int32(<int32_t><uint32_t>objlen)
 *         buf.write_buffer(elem_data)
 */
  __pyx_t_5 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_4, __pyx_t_5, 4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_29 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_29 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_29); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":211
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 *         buf.write_int32(<int32_t><uint32_t>objlen)             # <<<<<<<<<<<<<<
 *         buf.write_buffer(elem_data)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)((uint32_t)__pyx_v_objlen))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":212
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 *         buf.write_int32(<int32_t><uint32_t>objlen)
 *         buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":164
 *                 'argument tuples do not support objects')
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseRecordCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_value_repr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15BaseRecordCodec_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseRecordCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15BaseRecordCodec_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.BaseRecordCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15BaseRecordCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseRecordCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":217
 * cdef class BaseNamedRecordCodec(BaseRecordCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.descriptor = None
 * 
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/base.pyx":218
 * 
 *     def __cinit__(self):
 *         self.descriptor = None             # <<<<<<<<<<<<<<
 * 
 *     cdef dump(self, int level = 0):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->descriptor);
  __Pyx_DECREF(__pyx_v_self->descriptor);
  __pyx_v_self->descriptor = Py_None;

  /* "gel/protocol/codecs/base.pyx":217
 * cdef class BaseNamedRecordCodec(BaseRecordCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.descriptor = None
 * 
 */

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

/* "gel/protocol/codecs/base.pyx":220
 *         self.descriptor = None
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         buf = [f'{level * " "}{self.name}']
 *         for pos, codec in enumerate(self.fields_codecs):
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_20BaseNamedRecordCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_20BaseNamedRecordCodec_dump *__pyx_optional_args) {
  int __pyx_v_level = ((int)0);
  PyObject *__pyx_v_buf = NULL;
  PyObject *__pyx_v_pos = NULL;
  PyObject *__pyx_v_codec = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  int __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_level = __pyx_optional_args->level;
    }
  }

  /* "gel/protocol/codecs/base.pyx":221
 * 
 *     cdef dump(self, int level = 0):
 *         buf = [f'{level * " "}{self.name}']             # <<<<<<<<<<<<<<
 *         for pos, codec in enumerate(self.fields_codecs):
 *             name = datatypes.record_desc_pointer_name(self.descriptor, pos)
 */
  __pyx_t_1 = __Pyx_PySequence_Multiply_Left(__pyx_v_level, __pyx_kp_u__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.__pyx_base.name); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(1, 221, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_v_buf = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/base.pyx":222
 *     cdef dump(self, int level = 0):
 *         buf = [f'{level * " "}{self.name}']
 *         for pos, codec in enumerate(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             name = datatypes.record_desc_pointer_name(self.descriptor, pos)
 *             buf.append('{}{} := {}'.format(
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_2 = __pyx_int_0;
  __pyx_t_3 = __pyx_v_self->__pyx_base.fields_codecs; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 222, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 222, __pyx_L1_error)
    #else
    __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_codec, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_pos, __pyx_t_2);
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/base.pyx":223
 *         buf = [f'{level * " "}{self.name}']
 *         for pos, codec in enumerate(self.fields_codecs):
 *             name = datatypes.record_desc_pointer_name(self.descriptor, pos)             # <<<<<<<<<<<<<<
 *             buf.append('{}{} := {}'.format(
 *                 (level + 1) * " ",
 */
    __pyx_t_1 = __pyx_v_self->descriptor;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_pos); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 223, __pyx_L1_error)
    __pyx_t_6 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "gel/protocol/codecs/base.pyx":224
 *         for pos, codec in enumerate(self.fields_codecs):
 *             name = datatypes.record_desc_pointer_name(self.descriptor, pos)
 *             buf.append('{}{} := {}'.format(             # <<<<<<<<<<<<<<
 *                 (level + 1) * " ",
 *                 name,
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__18, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "gel/protocol/codecs/base.pyx":225
 *             name = datatypes.record_desc_pointer_name(self.descriptor, pos)
 *             buf.append('{}{} := {}'.format(
 *                 (level + 1) * " ",             # <<<<<<<<<<<<<<
 *                 name,
 *                 (<BaseCodec>codec).dump(level + 1).strip()))
 */
    __pyx_t_7 = __Pyx_PySequence_Multiply_Left((__pyx_v_level + 1), __pyx_kp_u__13); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "gel/protocol/codecs/base.pyx":227
 *                 (level + 1) * " ",
 *                 name,
 *                 (<BaseCodec>codec).dump(level + 1).strip()))             # <<<<<<<<<<<<<<
 *         return '\n'.join(buf)
 * 
 */
    __pyx_t_10.__pyx_n = 1;
    __pyx_t_10.level = (__pyx_v_level + 1);
    __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec)->__pyx_vtab)->dump(((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec), &__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_strip); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = NULL;
    __pyx_t_12 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
        __pyx_t_12 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_12, 0+__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __pyx_t_11 = NULL;
    __pyx_t_12 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_12 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_11, __pyx_t_7, __pyx_v_name, __pyx_t_8};
      __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_12, 3+__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }

    /* "gel/protocol/codecs/base.pyx":224
 *         for pos, codec in enumerate(self.fields_codecs):
 *             name = datatypes.record_desc_pointer_name(self.descriptor, pos)
 *             buf.append('{}{} := {}'.format(             # <<<<<<<<<<<<<<
 *                 (level + 1) * " ",
 *                 name,
 */
    __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_buf, __pyx_t_6); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(1, 224, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "gel/protocol/codecs/base.pyx":222
 *     cdef dump(self, int level = 0):
 *         buf = [f'{level * " "}{self.name}']
 *         for pos, codec in enumerate(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             name = datatypes.record_desc_pointer_name(self.descriptor, pos)
 *             buf.append('{}{} := {}'.format(
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/base.pyx":228
 *                 name,
 *                 (<BaseCodec>codec).dump(level + 1).strip()))
 *         return '\n'.join(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__19, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":220
 *         self.descriptor = None
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         buf = [f'{level * " "}{self.name}']
 *         for pos, codec in enumerate(self.fields_codecs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseNamedRecordCodec.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_pos);
  __Pyx_XDECREF(__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":230
 *         return '\n'.join(buf)
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_20BaseNamedRecordCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  Py_ssize_t __pyx_v_objlen;
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec = 0;
  Py_ssize_t __pyx_v_is_dict;
  Py_ssize_t __pyx_v_is_namedtuple;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_value_repr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  int32_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/base.pyx":239
 *             Py_ssize_t is_namedtuple
 * 
 *         self._check_encoder()             # <<<<<<<<<<<<<<
 * 
 *         # We check in this order (dict, _is_array_iterable,
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._check_encoder(((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":244
 *         # MappingABC) so that in the common case of dict or tuple, we
 *         # never do an ABC check.
 *         if cpython.PyDict_Check(obj):             # <<<<<<<<<<<<<<
 *             is_dict = True
 *         elif _is_array_iterable(obj):
 */
  __pyx_t_2 = PyDict_Check(__pyx_v_obj);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/base.pyx":245
 *         # never do an ABC check.
 *         if cpython.PyDict_Check(obj):
 *             is_dict = True             # <<<<<<<<<<<<<<
 *         elif _is_array_iterable(obj):
 *             is_dict = False
 */
    __pyx_v_is_dict = 1;

    /* "gel/protocol/codecs/base.pyx":244
 *         # MappingABC) so that in the common case of dict or tuple, we
 *         # never do an ABC check.
 *         if cpython.PyDict_Check(obj):             # <<<<<<<<<<<<<<
 *             is_dict = True
 *         elif _is_array_iterable(obj):
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/codecs/base.pyx":246
 *         if cpython.PyDict_Check(obj):
 *             is_dict = True
 *         elif _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *             is_dict = False
 *         elif isinstance(obj, MappingABC):
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/base.pyx":247
 *             is_dict = True
 *         elif _is_array_iterable(obj):
 *             is_dict = False             # <<<<<<<<<<<<<<
 *         elif isinstance(obj, MappingABC):
 *             is_dict = True
 */
    __pyx_v_is_dict = 0;

    /* "gel/protocol/codecs/base.pyx":246
 *         if cpython.PyDict_Check(obj):
 *             is_dict = True
 *         elif _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *             is_dict = False
 *         elif isinstance(obj, MappingABC):
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/codecs/base.pyx":248
 *         elif _is_array_iterable(obj):
 *             is_dict = False
 *         elif isinstance(obj, MappingABC):             # <<<<<<<<<<<<<<
 *             is_dict = True
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_MappingABC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_2)) {

    /* "gel/protocol/codecs/base.pyx":249
 *             is_dict = False
 *         elif isinstance(obj, MappingABC):
 *             is_dict = True             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError(
 */
    __pyx_v_is_dict = 1;

    /* "gel/protocol/codecs/base.pyx":248
 *         elif _is_array_iterable(obj):
 *             is_dict = False
 *         elif isinstance(obj, MappingABC):             # <<<<<<<<<<<<<<
 *             is_dict = True
 *         else:
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/codecs/base.pyx":251
 *             is_dict = True
 *         else:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'a sized iterable container or mapping '
 *                 'expected (got type {!r})'.format(
 */
  /*else*/ {

    /* "gel/protocol/codecs/base.pyx":253
 *             raise TypeError(
 *                 'a sized iterable container or mapping '
 *                 'expected (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                     type(obj).__name__))
 *         is_namedtuple = not is_dict and hasattr(obj, '_fields')
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_sized_iterable_container_or_ma, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "gel/protocol/codecs/base.pyx":254
 *                 'a sized iterable container or mapping '
 *                 'expected (got type {!r})'.format(
 *                     type(obj).__name__))             # <<<<<<<<<<<<<<
 *         is_namedtuple = not is_dict and hasattr(obj, '_fields')
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }

    /* "gel/protocol/codecs/base.pyx":251
 *             is_dict = True
 *         else:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'a sized iterable container or mapping '
 *                 'expected (got type {!r})'.format(
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 251, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "gel/protocol/codecs/base.pyx":255
 *                 'expected (got type {!r})'.format(
 *                     type(obj).__name__))
 *         is_namedtuple = not is_dict and hasattr(obj, '_fields')             # <<<<<<<<<<<<<<
 * 
 *         objlen = len(obj)
 */
  __pyx_t_2 = (!(__pyx_v_is_dict != 0));
  if (__pyx_t_2) {
  } else {
    __pyx_t_7 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_HasAttr(__pyx_v_obj, __pyx_n_u_fields); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 255, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_v_is_namedtuple = __pyx_t_7;

  /* "gel/protocol/codecs/base.pyx":257
 *         is_namedtuple = not is_dict and hasattr(obj, '_fields')
 * 
 *         objlen = len(obj)             # <<<<<<<<<<<<<<
 *         if objlen == 0:
 *             buf.write_bytes(EMPTY_RECORD_DATA)
 */
  __pyx_t_7 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 257, __pyx_L1_error)
  __pyx_v_objlen = __pyx_t_7;

  /* "gel/protocol/codecs/base.pyx":258
 * 
 *         objlen = len(obj)
 *         if objlen == 0:             # <<<<<<<<<<<<<<
 *             buf.write_bytes(EMPTY_RECORD_DATA)
 *             return
 */
  __pyx_t_2 = (__pyx_v_objlen == 0);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/base.pyx":259
 *         objlen = len(obj)
 *         if objlen == 0:
 *             buf.write_bytes(EMPTY_RECORD_DATA)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EMPTY_RECORD_DATA); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 259, __pyx_L1_error)
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/base.pyx":260
 *         if objlen == 0:
 *             buf.write_bytes(EMPTY_RECORD_DATA)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if objlen > _MAXINT32:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "gel/protocol/codecs/base.pyx":258
 * 
 *         objlen = len(obj)
 *         if objlen == 0:             # <<<<<<<<<<<<<<
 *             buf.write_bytes(EMPTY_RECORD_DATA)
 *             return
 */
  }

  /* "gel/protocol/codecs/base.pyx":262
 *             return
 * 
 *         if objlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements for a tuple')
 * 
 */
  __pyx_t_2 = (__pyx_v_objlen > 0x7FFFFFFF);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/base.pyx":263
 * 
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements for a tuple')             # <<<<<<<<<<<<<<
 * 
 *         if objlen != len(self.fields_codecs):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 263, __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(1, 263, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":262
 *             return
 * 
 *         if objlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements for a tuple')
 * 
 */
  }

  /* "gel/protocol/codecs/base.pyx":265
 *             raise ValueError('too many elements for a tuple')
 * 
 *         if objlen != len(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.fields_codecs;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 265, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_v_objlen != __pyx_t_7);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/base.pyx":267
 *         if objlen != len(self.fields_codecs):
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '             # <<<<<<<<<<<<<<
 *                 f'got {objlen}')
 * 
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u_expected);
    __pyx_t_7 += 9;
    __Pyx_GIVEREF(__pyx_kp_u_expected);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_expected);
    __pyx_t_3 = __pyx_v_self->__pyx_base.fields_codecs;
    __Pyx_INCREF(__pyx_t_3);
    if (unlikely(__pyx_t_3 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(1, 267, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 267, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_9, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_kp_u_elements_in_the_tuple_got);
    __pyx_t_7 += 28;
    __Pyx_GIVEREF(__pyx_kp_u_elements_in_the_tuple_got);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_elements_in_the_tuple_got);

    /* "gel/protocol/codecs/base.pyx":268
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '
 *                 f'got {objlen}')             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
 */
    __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_objlen, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/codecs/base.pyx":267
 *         if objlen != len(self.fields_codecs):
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '             # <<<<<<<<<<<<<<
 *                 f'got {objlen}')
 * 
 */
    __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/base.pyx":266
 * 
 *         if objlen != len(self.fields_codecs):
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '
 *                 f'got {objlen}')
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(1, 266, __pyx_L1_error)

    /* "gel/protocol/codecs/base.pyx":265
 *             raise ValueError('too many elements for a tuple')
 * 
 *         if objlen != len(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'expected {len(self.fields_codecs)} elements in the tuple, '
 */
  }

  /* "gel/protocol/codecs/base.pyx":270
 *                 f'got {objlen}')
 * 
 *         elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         for i in range(objlen):
 *             if is_dict:
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elem_data = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":271
 * 
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):             # <<<<<<<<<<<<<<
 *             if is_dict:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 */
  __pyx_t_7 = __pyx_v_objlen;
  __pyx_t_9 = __pyx_t_7;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "gel/protocol/codecs/base.pyx":272
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):
 *             if is_dict:             # <<<<<<<<<<<<<<
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:
 */
    __pyx_t_2 = (__pyx_v_is_dict != 0);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/base.pyx":273
 *         for i in range(objlen):
 *             if is_dict:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)             # <<<<<<<<<<<<<<
 *                 try:
 *                     item = obj[name]
 */
      __pyx_t_1 = __pyx_v_self->descriptor;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "gel/protocol/codecs/base.pyx":274
 *             if is_dict:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:             # <<<<<<<<<<<<<<
 *                     item = obj[name]
 *                 except KeyError:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        /*try:*/ {

          /* "gel/protocol/codecs/base.pyx":275
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:
 *                     item = obj[name]             # <<<<<<<<<<<<<<
 *                 except KeyError:
 *                     raise ValueError(
 */
          __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_obj, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
          __pyx_t_3 = 0;

          /* "gel/protocol/codecs/base.pyx":274
 *             if is_dict:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:             # <<<<<<<<<<<<<<
 *                     item = obj[name]
 *                 except KeyError:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L19_try_end;
        __pyx_L12_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "gel/protocol/codecs/base.pyx":276
 *                 try:
 *                     item = obj[name]
 *                 except KeyError:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         f"named tuple dict is missing '{name}' key",
 */
        __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_14) {
          __Pyx_AddTraceback("gel.protocol.protocol.BaseNamedRecordCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 276, __pyx_L14_except_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_4);

          /* "gel/protocol/codecs/base.pyx":278
 *                 except KeyError:
 *                     raise ValueError(
 *                         f"named tuple dict is missing '{name}' key",             # <<<<<<<<<<<<<<
 *                     ) from None
 *             elif is_namedtuple:
 */
          __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 278, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_15 = 0;
          __pyx_t_8 = 127;
          __Pyx_INCREF(__pyx_kp_u_named_tuple_dict_is_missing);
          __pyx_t_15 += 29;
          __Pyx_GIVEREF(__pyx_kp_u_named_tuple_dict_is_missing);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_named_tuple_dict_is_missing);
          __pyx_t_16 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 278, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) : __pyx_t_8;
          __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16);
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_16);
          __pyx_t_16 = 0;
          __Pyx_INCREF(__pyx_kp_u_key);
          __pyx_t_15 += 5;
          __Pyx_GIVEREF(__pyx_kp_u_key);
          PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_key);
          __pyx_t_16 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_15, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 278, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "gel/protocol/codecs/base.pyx":277
 *                     item = obj[name]
 *                 except KeyError:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         f"named tuple dict is missing '{name}' key",
 *                     ) from None
 */
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 277, __pyx_L14_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "gel/protocol/codecs/base.pyx":279
 *                     raise ValueError(
 *                         f"named tuple dict is missing '{name}' key",
 *                     ) from None             # <<<<<<<<<<<<<<
 *             elif is_namedtuple:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 */
          __Pyx_Raise(__pyx_t_5, 0, 0, Py_None);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __PYX_ERR(1, 277, __pyx_L14_except_error)
        }
        goto __pyx_L14_except_error;

        /* "gel/protocol/codecs/base.pyx":274
 *             if is_dict:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:             # <<<<<<<<<<<<<<
 *                     item = obj[name]
 *                 except KeyError:
 */
        __pyx_L14_except_error:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        goto __pyx_L1_error;
        __pyx_L19_try_end:;
      }

      /* "gel/protocol/codecs/base.pyx":272
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):
 *             if is_dict:             # <<<<<<<<<<<<<<
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:
 */
      goto __pyx_L11;
    }

    /* "gel/protocol/codecs/base.pyx":280
 *                         f"named tuple dict is missing '{name}' key",
 *                     ) from None
 *             elif is_namedtuple:             # <<<<<<<<<<<<<<
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:
 */
    __pyx_t_2 = (__pyx_v_is_namedtuple != 0);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/base.pyx":281
 *                     ) from None
 *             elif is_namedtuple:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)             # <<<<<<<<<<<<<<
 *                 try:
 *                     item = getattr(obj, name)
 */
      __pyx_t_4 = __pyx_v_self->descriptor;
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name(__pyx_t_4, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/base.pyx":282
 *             elif is_namedtuple:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:             # <<<<<<<<<<<<<<
 *                     item = getattr(obj, name)
 *                 except AttributeError:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_11);
        /*try:*/ {

          /* "gel/protocol/codecs/base.pyx":283
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:
 *                     item = getattr(obj, name)             # <<<<<<<<<<<<<<
 *                 except AttributeError:
 *                     raise ValueError(
 */
          __pyx_t_1 = __Pyx_GetAttr(__pyx_v_obj, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 283, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
          __pyx_t_1 = 0;

          /* "gel/protocol/codecs/base.pyx":282
 *             elif is_namedtuple:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:             # <<<<<<<<<<<<<<
 *                     item = getattr(obj, name)
 *                 except AttributeError:
 */
        }
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L29_try_end;
        __pyx_L22_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "gel/protocol/codecs/base.pyx":284
 *                 try:
 *                     item = getattr(obj, name)
 *                 except AttributeError:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         f"named tuple is missing '{name}' attribute",
 */
        __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
        if (__pyx_t_14) {
          __Pyx_AddTraceback("gel.protocol.protocol.BaseNamedRecordCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(1, 284, __pyx_L24_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);

          /* "gel/protocol/codecs/base.pyx":286
 *                 except AttributeError:
 *                     raise ValueError(
 *                         f"named tuple is missing '{name}' attribute",             # <<<<<<<<<<<<<<
 *                     ) from None
 *             else:
 */
          __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 286, __pyx_L24_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_15 = 0;
          __pyx_t_8 = 127;
          __Pyx_INCREF(__pyx_kp_u_named_tuple_is_missing);
          __pyx_t_15 += 24;
          __Pyx_GIVEREF(__pyx_kp_u_named_tuple_is_missing);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_named_tuple_is_missing);
          __pyx_t_16 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 286, __pyx_L24_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) : __pyx_t_8;
          __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16);
          __Pyx_GIVEREF(__pyx_t_16);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_16);
          __pyx_t_16 = 0;
          __Pyx_INCREF(__pyx_kp_u_attribute);
          __pyx_t_15 += 11;
          __Pyx_GIVEREF(__pyx_kp_u_attribute);
          PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_attribute);
          __pyx_t_16 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_15, __pyx_t_8); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 286, __pyx_L24_except_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "gel/protocol/codecs/base.pyx":285
 *                     item = getattr(obj, name)
 *                 except AttributeError:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         f"named tuple is missing '{name}' attribute",
 *                     ) from None
 */
          __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_16); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 285, __pyx_L24_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

          /* "gel/protocol/codecs/base.pyx":287
 *                     raise ValueError(
 *                         f"named tuple is missing '{name}' attribute",
 *                     ) from None             # <<<<<<<<<<<<<<
 *             else:
 *                 item = obj[i]
 */
          __Pyx_Raise(__pyx_t_5, 0, 0, Py_None);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __PYX_ERR(1, 285, __pyx_L24_except_error)
        }
        goto __pyx_L24_except_error;

        /* "gel/protocol/codecs/base.pyx":282
 *             elif is_namedtuple:
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:             # <<<<<<<<<<<<<<
 *                     item = getattr(obj, name)
 *                 except AttributeError:
 */
        __pyx_L24_except_error:;
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
        goto __pyx_L1_error;
        __pyx_L29_try_end:;
      }

      /* "gel/protocol/codecs/base.pyx":280
 *                         f"named tuple dict is missing '{name}' key",
 *                     ) from None
 *             elif is_namedtuple:             # <<<<<<<<<<<<<<
 *                 name = datatypes.record_desc_pointer_name(self.descriptor, i)
 *                 try:
 */
      goto __pyx_L11;
    }

    /* "gel/protocol/codecs/base.pyx":289
 *                     ) from None
 *             else:
 *                 item = obj[i]             # <<<<<<<<<<<<<<
 * 
 *             elem_data.write_int32(0)  # reserved bytes
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L11:;

    /* "gel/protocol/codecs/base.pyx":291
 *                 item = obj[i]
 * 
 *             elem_data.write_int32(0)  # reserved bytes             # <<<<<<<<<<<<<<
 *             if item is None:
 *                 elem_data.write_int32(-1)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/codecs/base.pyx":292
 * 
 *             elem_data.write_int32(0)  # reserved bytes
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
 */
    __pyx_t_2 = (__pyx_v_item == Py_None);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/base.pyx":293
 *             elem_data.write_int32(0)  # reserved bytes
 *             if item is None:
 *                 elem_data.write_int32(-1)             # <<<<<<<<<<<<<<
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "gel/protocol/codecs/base.pyx":292
 * 
 *             elem_data.write_int32(0)  # reserved bytes
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 elem_data.write_int32(-1)
 *             else:
 */
      goto __pyx_L32;
    }

    /* "gel/protocol/codecs/base.pyx":295
 *                 elem_data.write_int32(-1)
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])             # <<<<<<<<<<<<<<
 *                 try:
 *                     sub_codec.encode(elem_data, item)
 */
    /*else*/ {
      if (unlikely(__pyx_v_self->__pyx_base.fields_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 295, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx_base.fields_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __pyx_t_3;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "gel/protocol/codecs/base.pyx":296
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        /*try:*/ {

          /* "gel/protocol/codecs/base.pyx":297
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:
 *                     sub_codec.encode(elem_data, item)             # <<<<<<<<<<<<<<
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(item)
 */
          __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->encode(__pyx_v_sub_codec, __pyx_v_elem_data, __pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 297, __pyx_L33_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "gel/protocol/codecs/base.pyx":296
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L40_try_end;
        __pyx_L33_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "gel/protocol/codecs/base.pyx":298
 *                 try:
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:             # <<<<<<<<<<<<<<
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:
 */
        __pyx_t_14 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError);
        if (__pyx_t_14) {
          __Pyx_AddTraceback("gel.protocol.protocol.BaseNamedRecordCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(1, 298, __pyx_L35_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __pyx_v_e = __pyx_t_3;
          /*try:*/ {

            /* "gel/protocol/codecs/base.pyx":299
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(item)             # <<<<<<<<<<<<<<
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
 */
            __pyx_t_5 = PyObject_Repr(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 299, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_v_value_repr = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "gel/protocol/codecs/base.pyx":300
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 */
            __pyx_t_15 = PyObject_Length(__pyx_v_value_repr); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(1, 300, __pyx_L46_error)
            __pyx_t_2 = (__pyx_t_15 > 40);
            if (__pyx_t_2) {

              /* "gel/protocol/codecs/base.pyx":301
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 */
              __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_value_repr, 0, 40, NULL, NULL, &__pyx_slice__16, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 301, __pyx_L46_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_16 = PyNumber_Add(__pyx_t_5, __pyx_kp_u__17); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 301, __pyx_L46_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF_SET(__pyx_v_value_repr, __pyx_t_16);
              __pyx_t_16 = 0;

              /* "gel/protocol/codecs/base.pyx":300
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 */
            }

            /* "gel/protocol/codecs/base.pyx":302
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(
 */
            __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 302, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 302, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "gel/protocol/codecs/base.pyx":304
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(             # <<<<<<<<<<<<<<
 *                             n=i, v=value_repr, msg=e)) from e
 * 
 */
            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_input_for_query_argument, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 304, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_5);

            /* "gel/protocol/codecs/base.pyx":305
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(
 *                             n=i, v=value_repr, msg=e)) from e             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 */
            __pyx_t_18 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 305, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_18);
            __pyx_t_19 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 305, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_19);
            if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_n, __pyx_t_19) < 0) __PYX_ERR(1, 305, __pyx_L46_error)
            __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
            if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_v, __pyx_v_value_repr) < 0) __PYX_ERR(1, 305, __pyx_L46_error)
            if (PyDict_SetItem(__pyx_t_18, __pyx_n_s_msg, __pyx_v_e) < 0) __PYX_ERR(1, 305, __pyx_L46_error)

            /* "gel/protocol/codecs/base.pyx":304
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(             # <<<<<<<<<<<<<<
 *                             n=i, v=value_repr, msg=e)) from e
 * 
 */
            __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 304, __pyx_L46_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __pyx_t_18 = NULL;
            __pyx_t_6 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_17))) {
              __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_17);
              if (likely(__pyx_t_18)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
                __Pyx_INCREF(__pyx_t_18);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_17, function);
                __pyx_t_6 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_19};
              __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 302, __pyx_L46_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            }

            /* "gel/protocol/codecs/base.pyx":305
 *                         'invalid input for query argument'
 *                         ' ${n}: {v} ({msg})'.format(
 *                             n=i, v=value_repr, msg=e)) from e             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 */
            __Pyx_Raise(__pyx_t_16, 0, 0, __pyx_v_e);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __PYX_ERR(1, 302, __pyx_L46_error)
          }

          /* "gel/protocol/codecs/base.pyx":298
 *                 try:
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:             # <<<<<<<<<<<<<<
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:
 */
          /*finally:*/ {
            __pyx_L46_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_27);
              __pyx_t_14 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_XGIVEREF(__pyx_t_27);
                __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
              }
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
              __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
              __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
              goto __pyx_L35_except_error;
            }
          }
        }
        goto __pyx_L35_except_error;

        /* "gel/protocol/codecs/base.pyx":296
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, item)
 *                 except (TypeError, ValueError) as e:
 */
        __pyx_L35_except_error:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        goto __pyx_L1_error;
        __pyx_L40_try_end:;
      }
    }
    __pyx_L32:;
  }

  /* "gel/protocol/codecs/base.pyx":307
 *                             n=i, v=value_repr, msg=e)) from e
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length             # <<<<<<<<<<<<<<
 *         buf.write_int32(<int32_t><uint32_t>objlen)
 *         buf.write_buffer(elem_data)
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AddCObj(__pyx_int_4, __pyx_t_1, 4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_28 = __Pyx_PyInt_As_int32_t(__pyx_t_3); if (unlikely((__pyx_t_28 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_28); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/base.pyx":308
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 *         buf.write_int32(<int32_t><uint32_t>objlen)             # <<<<<<<<<<<<<<
 *         buf.write_buffer(elem_data)
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)((uint32_t)__pyx_v_objlen))); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/base.pyx":309
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 *         buf.write_int32(<int32_t><uint32_t>objlen)
 *         buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 * @cython.final
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/base.pyx":230
 *         return '\n'.join(buf)
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseNamedRecordCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_value_repr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_20BaseNamedRecordCodec_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseNamedRecordCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_20BaseNamedRecordCodec_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.BaseNamedRecordCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_20BaseNamedRecordCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseNamedRecordCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":314
 * cdef class EdegDBCodecContext(pgproto.CodecContext):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._codec = codecs.lookup('utf-8')
 * 
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/base.pyx":315
 * 
 *     def __cinit__(self):
 *         self._codec = codecs.lookup('utf-8')             # <<<<<<<<<<<<<<
 * 
 *     cpdef get_text_codec(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_codecs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_utf_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_codec);
  __Pyx_DECREF(__pyx_v_self->_codec);
  __pyx_v_self->_codec = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/base.pyx":314
 * cdef class EdegDBCodecContext(pgproto.CodecContext):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._codec = codecs.lookup('utf-8')
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.EdegDBCodecContext.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":317
 *         self._codec = codecs.lookup('utf-8')
 * 
 *     cpdef get_text_codec(self):             # <<<<<<<<<<<<<<
 *         return self._codec
 * 
 */

static PyObject *__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_3get_text_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_18EdegDBCodecContext_get_text_codec(struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_text_codec", 1);

  /* "gel/protocol/codecs/base.pyx":318
 * 
 *     cpdef get_text_codec(self):
 *         return self._codec             # <<<<<<<<<<<<<<
 * 
 *     cdef is_encoding_utf8(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_codec);
  __pyx_r = __pyx_v_self->_codec;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":317
 *         self._codec = codecs.lookup('utf-8')
 * 
 *     cpdef get_text_codec(self):             # <<<<<<<<<<<<<<
 *         return self._codec
 * 
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_3get_text_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_18EdegDBCodecContext_3get_text_codec = {"get_text_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_3get_text_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_3get_text_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_text_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_text_codec", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_text_codec", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_2get_text_codec(((struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_2get_text_codec(struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_text_codec", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_18EdegDBCodecContext_get_text_codec(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.EdegDBCodecContext.get_text_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/base.pyx":320
 *         return self._codec
 * 
 *     cdef is_encoding_utf8(self):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_18EdegDBCodecContext_is_encoding_utf8(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_encoding_utf8", 1);

  /* "gel/protocol/codecs/base.pyx":321
 * 
 *     cdef is_encoding_utf8(self):
 *         return True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "gel/protocol/codecs/base.pyx":320
 *         return self._codec
 * 
 *     cdef is_encoding_utf8(self):             # <<<<<<<<<<<<<<
 *         return True
 * 
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_18EdegDBCodecContext_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_4__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.EdegDBCodecContext.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_18EdegDBCodecContext_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.EdegDBCodecContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_6__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_18EdegDBCodecContext_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.EdegDBCodecContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/scalar.pyx":23
 * cdef class ScalarCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_encoder = NULL
 *         self.c_decoder = NULL
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ScalarCodec___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_11ScalarCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self) {
  int __pyx_r;

  /* "gel/protocol/codecs/scalar.pyx":24
 * 
 *     def __cinit__(self):
 *         self.c_encoder = NULL             # <<<<<<<<<<<<<<
 *         self.c_decoder = NULL
 * 
 */
  __pyx_v_self->c_encoder = NULL;

  /* "gel/protocol/codecs/scalar.pyx":25
 *     def __cinit__(self):
 *         self.c_encoder = NULL
 *         self.c_decoder = NULL             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */
  __pyx_v_self->c_decoder = NULL;

  /* "gel/protocol/codecs/scalar.pyx":23
 * cdef class ScalarCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_encoder = NULL
 *         self.c_decoder = NULL
 */

  /* function exit code */
  __pyx_r = 0;
  return __pyx_r;
}

/* "gel/protocol/codecs/scalar.pyx":27
 *         self.c_decoder = NULL
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         self.c_encoder(DEFAULT_CODEC_CONTEXT, buf, obj)
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/scalar.pyx":28
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         self.c_encoder(DEFAULT_CODEC_CONTEXT, buf, obj)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_3gel_8protocol_8protocol_DEFAULT_CODEC_CONTEXT);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_self->c_encoder(((struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *)__pyx_t_1), __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 28, __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;

  /* "gel/protocol/codecs/scalar.pyx":27
 *         self.c_decoder = NULL
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         self.c_encoder(DEFAULT_CODEC_CONTEXT, buf, obj)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/scalar.pyx":30
 *         self.c_encoder(DEFAULT_CODEC_CONTEXT, buf, obj)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self.c_decoder(DEFAULT_CODEC_CONTEXT, buf)
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/scalar.pyx":31
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         return self.c_decoder(DEFAULT_CODEC_CONTEXT, buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef derive(self, bytes tid):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_3gel_8protocol_8protocol_DEFAULT_CODEC_CONTEXT);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_self->c_decoder(((struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *)__pyx_t_1), __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/scalar.pyx":30
 *         self.c_encoder(DEFAULT_CODEC_CONTEXT, buf, obj)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self.c_decoder(DEFAULT_CODEC_CONTEXT, buf)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/scalar.pyx":33
 *         return self.c_decoder(DEFAULT_CODEC_CONTEXT, buf)
 * 
 *     cdef derive(self, bytes tid):             # <<<<<<<<<<<<<<
 *         cdef ScalarCodec rv
 *         rv = ScalarCodec.new(tid, self.name, self.c_encoder, self.c_decoder)
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_derive(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, PyObject *__pyx_v_tid) {
  struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_rv = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("derive", 1);

  /* "gel/protocol/codecs/scalar.pyx":35
 *     cdef derive(self, bytes tid):
 *         cdef ScalarCodec rv
 *         rv = ScalarCodec.new(tid, self.name, self.c_encoder, self.c_decoder)             # <<<<<<<<<<<<<<
 *         rv.base_codec = self
 *         return rv
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.name;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_new(__pyx_v_tid, ((PyObject*)__pyx_t_1), __pyx_v_self->c_encoder, __pyx_v_self->c_decoder)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec))))) __PYX_ERR(13, 35, __pyx_L1_error)
  __pyx_v_rv = ((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/scalar.pyx":36
 *         cdef ScalarCodec rv
 *         rv = ScalarCodec.new(tid, self.name, self.c_encoder, self.c_decoder)
 *         rv.base_codec = self             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self);
  __Pyx_GOTREF((PyObject *)__pyx_v_rv->base_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_rv->base_codec);
  __pyx_v_rv->base_codec = __pyx_v_self;

  /* "gel/protocol/codecs/scalar.pyx":37
 *         rv = ScalarCodec.new(tid, self.name, self.c_encoder, self.c_decoder)
 *         rv.base_codec = self
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_rv);
  __pyx_r = ((PyObject *)__pyx_v_rv);
  goto __pyx_L0;

  /* "gel/protocol/codecs/scalar.pyx":33
 *         return self.c_decoder(DEFAULT_CODEC_CONTEXT, buf)
 * 
 *     cdef derive(self, bytes tid):             # <<<<<<<<<<<<<<
 *         cdef ScalarCodec rv
 *         rv = ScalarCodec.new(tid, self.name, self.c_encoder, self.c_decoder)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.derive", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/scalar.pyx":40
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, str name,             # <<<<<<<<<<<<<<
 *                        pgproto.encode_func encoder,
 *                        pgproto.decode_func decoder):
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_name, __pyx_t_3gel_7pgproto_7pgproto_encode_func __pyx_v_encoder, __pyx_t_3gel_7pgproto_7pgproto_decode_func __pyx_v_decoder) {
  struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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("new", 1);

  /* "gel/protocol/codecs/scalar.pyx":46
 *             ScalarCodec codec
 * 
 *         codec = ScalarCodec.__new__(ScalarCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_ScalarCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 46, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/scalar.pyx":48
 *         codec = ScalarCodec.__new__(ScalarCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = name
 *         codec.c_encoder = encoder
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.tid);
  __pyx_v_codec->__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/scalar.pyx":49
 * 
 *         codec.tid = tid
 *         codec.name = name             # <<<<<<<<<<<<<<
 *         codec.c_encoder = encoder
 *         codec.c_decoder = decoder
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.name);
  __pyx_v_codec->__pyx_base.name = __pyx_v_name;

  /* "gel/protocol/codecs/scalar.pyx":50
 *         codec.tid = tid
 *         codec.name = name
 *         codec.c_encoder = encoder             # <<<<<<<<<<<<<<
 *         codec.c_decoder = decoder
 * 
 */
  __pyx_v_codec->c_encoder = __pyx_v_encoder;

  /* "gel/protocol/codecs/scalar.pyx":51
 *         codec.name = name
 *         codec.c_encoder = encoder
 *         codec.c_decoder = decoder             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __pyx_v_codec->c_decoder = __pyx_v_decoder;

  /* "gel/protocol/codecs/scalar.pyx":53
 *         codec.c_decoder = decoder
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/scalar.pyx":40
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, str name,             # <<<<<<<<<<<<<<
 *                        pgproto.encode_func encoder,
 *                        pgproto.decode_func decoder):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/scalar.pyx":55
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         if self.base_codec is None:
 *             return describe.BaseScalarType(
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11ScalarCodec_3make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(13, 55, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(13, 55, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(13, 55, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_2make_type(((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/scalar.pyx":56
 * 
 *     def make_type(self, describe_context):
 *         if self.base_codec is None:             # <<<<<<<<<<<<<<
 *             return describe.BaseScalarType(
 *                 desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->base_codec) == Py_None);
  if (__pyx_t_1) {

    /* "gel/protocol/codecs/scalar.pyx":57
 *     def make_type(self, describe_context):
 *         if self.base_codec is None:
 *             return describe.BaseScalarType(             # <<<<<<<<<<<<<<
 *                 desc_id=uuid.UUID(bytes=self.tid),
 *                 name=self.name,
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_describe); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_BaseScalarType); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/codecs/scalar.pyx":58
 *         if self.base_codec is None:
 *             return describe.BaseScalarType(
 *                 desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *                 name=self.name,
 *             )
 */
    __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_uuid); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_UUID); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.tid) < 0) __PYX_ERR(13, 58, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_desc_id, __pyx_t_6) < 0) __PYX_ERR(13, 58, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "gel/protocol/codecs/scalar.pyx":59
 *             return describe.BaseScalarType(
 *                 desc_id=uuid.UUID(bytes=self.tid),
 *                 name=self.name,             # <<<<<<<<<<<<<<
 *             )
 *         else:
 */
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->__pyx_base.name) < 0) __PYX_ERR(13, 58, __pyx_L1_error)

    /* "gel/protocol/codecs/scalar.pyx":57
 *     def make_type(self, describe_context):
 *         if self.base_codec is None:
 *             return describe.BaseScalarType(             # <<<<<<<<<<<<<<
 *                 desc_id=uuid.UUID(bytes=self.tid),
 *                 name=self.name,
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "gel/protocol/codecs/scalar.pyx":56
 * 
 *     def make_type(self, describe_context):
 *         if self.base_codec is None:             # <<<<<<<<<<<<<<
 *             return describe.BaseScalarType(
 *                 desc_id=uuid.UUID(bytes=self.tid),
 */
  }

  /* "gel/protocol/codecs/scalar.pyx":62
 *             )
 *         else:
 *             return describe.ScalarType(             # <<<<<<<<<<<<<<
 *                 desc_id=uuid.UUID(bytes=self.tid),
 *                 name=self.type_name,
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_describe); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ScalarType); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "gel/protocol/codecs/scalar.pyx":63
 *         else:
 *             return describe.ScalarType(
 *                 desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *                 name=self.type_name,
 *                 base_type=self.base_codec.make_type(describe_context),
 */
    __pyx_t_6 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(13, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.tid) < 0) __PYX_ERR(13, 63, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(13, 63, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "gel/protocol/codecs/scalar.pyx":64
 *             return describe.ScalarType(
 *                 desc_id=uuid.UUID(bytes=self.tid),
 *                 name=self.type_name,             # <<<<<<<<<<<<<<
 *                 base_type=self.base_codec.make_type(describe_context),
 *             )
 */
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_name, __pyx_v_self->__pyx_base.type_name) < 0) __PYX_ERR(13, 63, __pyx_L1_error)

    /* "gel/protocol/codecs/scalar.pyx":65
 *                 desc_id=uuid.UUID(bytes=self.tid),
 *                 name=self.type_name,
 *                 base_type=self.base_codec.make_type(describe_context),             # <<<<<<<<<<<<<<
 *             )
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->base_codec), __pyx_n_s_make_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_describe_context};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 65, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_base_type, __pyx_t_5) < 0) __PYX_ERR(13, 63, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "gel/protocol/codecs/scalar.pyx":62
 *             )
 *         else:
 *             return describe.ScalarType(             # <<<<<<<<<<<<<<
 *                 desc_id=uuid.UUID(bytes=self.tid),
 *                 name=self.type_name,
 */
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "gel/protocol/codecs/scalar.pyx":55
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         if self.base_codec is None:
 *             return describe.BaseScalarType(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11ScalarCodec_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_4__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11ScalarCodec_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_6__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ScalarCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.ScalarCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/tuple.pyx":23
 * cdef class TupleCodec(BaseRecordCodec):
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_10TupleCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_elem_count;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_elem_codec = 0;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_v_fields_codecs = 0;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char const *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/tuple.pyx":31
 *             BaseCodec elem_codec
 *             FRBuffer elem_buf
 *             tuple fields_codecs = (<BaseRecordCodec>self).fields_codecs             # <<<<<<<<<<<<<<
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self)->fields_codecs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fields_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/tuple.pyx":33
 *             tuple fields_codecs = (<BaseRecordCodec>self).fields_codecs
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *         if elem_count != len(fields_codecs):
 */
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(14, 33, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_2)));

  /* "gel/protocol/codecs/tuple.pyx":35
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_count != len(fields_codecs):             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode Tuple: expected {len(fields_codecs)} '
 */
  if (unlikely(__pyx_v_fields_codecs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(14, 35, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v_fields_codecs); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(14, 35, __pyx_L1_error)
  __pyx_t_4 = (__pyx_v_elem_count != __pyx_t_3);
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/codecs/tuple.pyx":37
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(
 *                 f'cannot decode Tuple: expected {len(fields_codecs)} '             # <<<<<<<<<<<<<<
 *                 f'elements, got {elem_count}')
 * 
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot_decode_Tuple_expected);
    __pyx_t_3 += 30;
    __Pyx_GIVEREF(__pyx_kp_u_cannot_decode_Tuple_expected);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_decode_Tuple_expected);
    if (unlikely(__pyx_v_fields_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(14, 37, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyTuple_GET_SIZE(__pyx_v_fields_codecs); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(14, 37, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_elements_got);
    __pyx_t_3 += 15;
    __Pyx_GIVEREF(__pyx_kp_u_elements_got);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_elements_got);

    /* "gel/protocol/codecs/tuple.pyx":38
 *             raise RuntimeError(
 *                 f'cannot decode Tuple: expected {len(fields_codecs)} '
 *                 f'elements, got {elem_count}')             # <<<<<<<<<<<<<<
 * 
 *         result = cpython.PyTuple_New(elem_count)
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_elem_count, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "gel/protocol/codecs/tuple.pyx":37
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(
 *                 f'cannot decode Tuple: expected {len(fields_codecs)} '             # <<<<<<<<<<<<<<
 *                 f'elements, got {elem_count}')
 * 
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/tuple.pyx":36
 * 
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'cannot decode Tuple: expected {len(fields_codecs)} '
 *                 f'elements, got {elem_count}')
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(14, 36, __pyx_L1_error)

    /* "gel/protocol/codecs/tuple.pyx":35
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_count != len(fields_codecs):             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode Tuple: expected {len(fields_codecs)} '
 */
  }

  /* "gel/protocol/codecs/tuple.pyx":40
 *                 f'elements, got {elem_count}')
 * 
 *         result = cpython.PyTuple_New(elem_count)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(elem_count):
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/tuple.pyx":42
 *         result = cpython.PyTuple_New(elem_count)
 * 
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             frb_read(buf, 4)  # reserved
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_3 = __pyx_v_elem_count;
  __pyx_t_6 = __pyx_t_3;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "gel/protocol/codecs/tuple.pyx":43
 * 
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # reserved             # <<<<<<<<<<<<<<
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 */
    __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(14, 43, __pyx_L1_error)

    /* "gel/protocol/codecs/tuple.pyx":44
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # reserved
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *             if elem_len == -1:
 */
    __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(14, 44, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_2);

    /* "gel/protocol/codecs/tuple.pyx":46
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
    __pyx_t_4 = (__pyx_v_elem_len == -1L);
    if (__pyx_t_4) {

      /* "gel/protocol/codecs/tuple.pyx":47
 * 
 *             if elem_len == -1:
 *                 elem = None             # <<<<<<<<<<<<<<
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

      /* "gel/protocol/codecs/tuple.pyx":46
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
      goto __pyx_L6;
    }

    /* "gel/protocol/codecs/tuple.pyx":49
 *                 elem = None
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]             # <<<<<<<<<<<<<<
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 */
    /*else*/ {
      if (unlikely(__pyx_v_fields_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(14, 49, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_fields_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __pyx_t_1;
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "gel/protocol/codecs/tuple.pyx":51
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 */
      __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_9 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(14, 51, __pyx_L1_error)

      /* "gel/protocol/codecs/tuple.pyx":50
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 *                 elem = elem_codec.decode(             # <<<<<<<<<<<<<<
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):
 */
      __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_elem_codec->__pyx_vtab)->decode(__pyx_v_elem_codec, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "gel/protocol/codecs/tuple.pyx":52
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(14, 52, __pyx_L1_error)
      __pyx_t_4 = (__pyx_t_10 != 0);
      if (unlikely(__pyx_t_4)) {

        /* "gel/protocol/codecs/tuple.pyx":55
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 *                         f'tuple element decoding: {frb_get_len(&elem_buf)}')             # <<<<<<<<<<<<<<
 * 
 *             cpython.Py_INCREF(elem)
 */
        __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(14, 55, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 55, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "gel/protocol/codecs/tuple.pyx":54
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                         f'tuple element decoding: {frb_get_len(&elem_buf)}')
 * 
 */
        __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 54, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "gel/protocol/codecs/tuple.pyx":53
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in buffer after '
 *                         f'tuple element decoding: {frb_get_len(&elem_buf)}')
 */
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(14, 53, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(14, 53, __pyx_L1_error)

        /* "gel/protocol/codecs/tuple.pyx":52
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      }
    }
    __pyx_L6:;

    /* "gel/protocol/codecs/tuple.pyx":57
 *                         f'tuple element decoding: {frb_get_len(&elem_buf)}')
 * 
 *             cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *             cpython.PyTuple_SET_ITEM(result, i, elem)
 * 
 */
    Py_INCREF(__pyx_v_elem);

    /* "gel/protocol/codecs/tuple.pyx":58
 * 
 *             cpython.Py_INCREF(elem)
 *             cpython.PyTuple_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
  }

  /* "gel/protocol/codecs/tuple.pyx":60
 *             cpython.PyTuple_SET_ITEM(result, i, elem)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cdef dump(self, int level = 0):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/protocol/codecs/tuple.pyx":23
 * cdef class TupleCodec(BaseRecordCodec):
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XDECREF(__pyx_v_fields_codecs);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/tuple.pyx":62
 *         return result
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         buf = [f'{level * " "}{self.name}']
 *         for codec in self.fields_codecs:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_10TupleCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_10TupleCodec_dump *__pyx_optional_args) {
  int __pyx_v_level = ((int)0);
  PyObject *__pyx_v_buf = NULL;
  PyObject *__pyx_v_codec = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_level = __pyx_optional_args->level;
    }
  }

  /* "gel/protocol/codecs/tuple.pyx":63
 * 
 *     cdef dump(self, int level = 0):
 *         buf = [f'{level * " "}{self.name}']             # <<<<<<<<<<<<<<
 *         for codec in self.fields_codecs:
 *             buf.append((<BaseCodec>codec).dump(level + 1))
 */
  __pyx_t_1 = __Pyx_PySequence_Multiply_Left(__pyx_v_level, __pyx_kp_u__13); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.__pyx_base.name); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(14, 63, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_v_buf = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/tuple.pyx":64
 *     cdef dump(self, int level = 0):
 *         buf = [f'{level * " "}{self.name}']
 *         for codec in self.fields_codecs:             # <<<<<<<<<<<<<<
 *             buf.append((<BaseCodec>codec).dump(level + 1))
 *         return '\n'.join(buf)
 */
  if (unlikely(__pyx_v_self->__pyx_base.fields_codecs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(14, 64, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_v_self->__pyx_base.fields_codecs; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_4 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 64, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(14, 64, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_codec, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/codecs/tuple.pyx":65
 *         buf = [f'{level * " "}{self.name}']
 *         for codec in self.fields_codecs:
 *             buf.append((<BaseCodec>codec).dump(level + 1))             # <<<<<<<<<<<<<<
 *         return '\n'.join(buf)
 * 
 */
    __pyx_t_5.__pyx_n = 1;
    __pyx_t_5.level = (__pyx_v_level + 1);
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec)->__pyx_vtab)->dump(((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec), &__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 65, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_buf, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(14, 65, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/codecs/tuple.pyx":64
 *     cdef dump(self, int level = 0):
 *         buf = [f'{level * " "}{self.name}']
 *         for codec in self.fields_codecs:             # <<<<<<<<<<<<<<
 *             buf.append((<BaseCodec>codec).dump(level + 1))
 *         return '\n'.join(buf)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/tuple.pyx":66
 *         for codec in self.fields_codecs:
 *             buf.append((<BaseCodec>codec).dump(level + 1))
 *         return '\n'.join(buf)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__19, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/tuple.pyx":62
 *         return result
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         buf = [f'{level * " "}{self.name}']
 *         for codec in self.fields_codecs:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_codec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/tuple.pyx":69
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple fields_codecs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             TupleCodec codec
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10TupleCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_fields_codecs) {
  struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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("new", 1);

  /* "gel/protocol/codecs/tuple.pyx":73
 *             TupleCodec codec
 * 
 *         codec = TupleCodec.__new__(TupleCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_TupleCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_TupleCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 73, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/tuple.pyx":75
 *         codec = TupleCodec.__new__(TupleCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = 'Tuple'
 *         codec.fields_codecs = fields_codecs
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.tid);
  __pyx_v_codec->__pyx_base.__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/tuple.pyx":76
 * 
 *         codec.tid = tid
 *         codec.name = 'Tuple'             # <<<<<<<<<<<<<<
 *         codec.fields_codecs = fields_codecs
 * 
 */
  __Pyx_INCREF(__pyx_n_u_Tuple);
  __Pyx_GIVEREF(__pyx_n_u_Tuple);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.name);
  __pyx_v_codec->__pyx_base.__pyx_base.name = __pyx_n_u_Tuple;

  /* "gel/protocol/codecs/tuple.pyx":77
 *         codec.tid = tid
 *         codec.name = 'Tuple'
 *         codec.fields_codecs = fields_codecs             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __Pyx_INCREF(__pyx_v_fields_codecs);
  __Pyx_GIVEREF(__pyx_v_fields_codecs);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.fields_codecs);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.fields_codecs);
  __pyx_v_codec->__pyx_base.fields_codecs = __pyx_v_fields_codecs;

  /* "gel/protocol/codecs/tuple.pyx":79
 *         codec.fields_codecs = fields_codecs
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/tuple.pyx":69
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple fields_codecs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             TupleCodec codec
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/tuple.pyx":81
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10TupleCodec_1make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(14, 81, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(14, 81, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(14, 81, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10TupleCodec_make_type(((struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_10TupleCodec_9make_type_2generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/codecs/tuple.pyx":86
 *             name=self.type_name,
 *             element_types=tuple(
 *                 codec.make_type(describe_context)             # <<<<<<<<<<<<<<
 *                 for codec in self.fields_codecs
 *             )
 */

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10TupleCodec_9make_type_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 86, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *) __pyx_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope);
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_10TupleCodec_9make_type_2generator19, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_make_type_locals_genexpr, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(14, 86, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.make_type.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_10TupleCodec_9make_type_2generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(14, 86, __pyx_L1_error)

  /* "gel/protocol/codecs/tuple.pyx":87
 *             element_types=tuple(
 *                 codec.make_type(describe_context)
 *                 for codec in self.fields_codecs             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(14, 87, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(14, 87, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(14, 87, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(14, 87, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_codec);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_codec, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/codecs/tuple.pyx":86
 *             name=self.type_name,
 *             element_types=tuple(
 *                 codec.make_type(describe_context)             # <<<<<<<<<<<<<<
 *                 for codec in self.fields_codecs
 *             )
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_codec, __pyx_n_s_make_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_describe_context)) { __Pyx_RaiseClosureNameError("describe_context"); __PYX_ERR(14, 86, __pyx_L1_error) }
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_describe_context};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(14, 86, __pyx_L1_error)

    /* "gel/protocol/codecs/tuple.pyx":87
 *             element_types=tuple(
 *                 codec.make_type(describe_context)
 *                 for codec in self.fields_codecs             # <<<<<<<<<<<<<<
 *             )
 *         )
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/codecs/tuple.pyx":86
 *             name=self.type_name,
 *             element_types=tuple(
 *                 codec.make_type(describe_context)             # <<<<<<<<<<<<<<
 *                 for codec in self.fields_codecs
 *             )
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/tuple.pyx":81
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10TupleCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *__pyx_cur_scope;
  PyObject *__pyx_gb_3gel_8protocol_8protocol_10TupleCodec_9make_type_2generator19 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct__make_type(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 81, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_describe_context = __pyx_v_describe_context;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_describe_context);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_describe_context);

  /* "gel/protocol/codecs/tuple.pyx":82
 * 
 *     def make_type(self, describe_context):
 *         return describe.TupleType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TupleType); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/tuple.pyx":83
 *     def make_type(self, describe_context):
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=self.type_name,
 *             element_types=tuple(
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.__pyx_base.tid) < 0) __PYX_ERR(14, 83, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(14, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/tuple.pyx":84
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,             # <<<<<<<<<<<<<<
 *             element_types=tuple(
 *                 codec.make_type(describe_context)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->__pyx_base.__pyx_base.type_name) < 0) __PYX_ERR(14, 83, __pyx_L1_error)

  /* "gel/protocol/codecs/tuple.pyx":86
 *             name=self.type_name,
 *             element_types=tuple(
 *                 codec.make_type(describe_context)             # <<<<<<<<<<<<<<
 *                 for codec in self.fields_codecs
 *             )
 */
  __pyx_t_5 = __pyx_pf_3gel_8protocol_8protocol_10TupleCodec_9make_type_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_self->__pyx_base.fields_codecs); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "gel/protocol/codecs/tuple.pyx":85
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 *             element_types=tuple(             # <<<<<<<<<<<<<<
 *                 codec.make_type(describe_context)
 *                 for codec in self.fields_codecs
 */
  __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_element_types, __pyx_t_3) < 0) __PYX_ERR(14, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/tuple.pyx":82
 * 
 *     def make_type(self, describe_context):
 *         return describe.TupleType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/tuple.pyx":81
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_3gel_8protocol_8protocol_10TupleCodec_9make_type_2generator19);
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10TupleCodec_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10TupleCodec_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10TupleCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10TupleCodec_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10TupleCodec_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10TupleCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.TupleCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/namedtuple.pyx":23
 * cdef class NamedTupleCodec(BaseNamedRecordCodec):
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_15NamedTupleCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_elem_count;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_elem_codec = 0;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_v_fields_codecs = 0;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char const *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/namedtuple.pyx":31
 *             BaseCodec elem_codec
 *             FRBuffer elem_buf
 *             tuple fields_codecs = (<BaseRecordCodec>self).fields_codecs             # <<<<<<<<<<<<<<
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self)->fields_codecs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fields_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":33
 *             tuple fields_codecs = (<BaseRecordCodec>self).fields_codecs
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *         if elem_count != len(fields_codecs):
 */
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(3, 33, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_2)));

  /* "gel/protocol/codecs/namedtuple.pyx":35
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_count != len(fields_codecs):             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode NamedTuple: expected {len(fields_codecs)} '
 */
  if (unlikely(__pyx_v_fields_codecs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 35, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v_fields_codecs); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 35, __pyx_L1_error)
  __pyx_t_4 = (__pyx_v_elem_count != __pyx_t_3);
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/codecs/namedtuple.pyx":37
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(
 *                 f'cannot decode NamedTuple: expected {len(fields_codecs)} '             # <<<<<<<<<<<<<<
 *                 f'elements, got {elem_count}')
 * 
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot_decode_NamedTuple_expecte);
    __pyx_t_3 += 35;
    __Pyx_GIVEREF(__pyx_kp_u_cannot_decode_NamedTuple_expecte);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_decode_NamedTuple_expecte);
    if (unlikely(__pyx_v_fields_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(3, 37, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyTuple_GET_SIZE(__pyx_v_fields_codecs); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 37, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_elements_got);
    __pyx_t_3 += 15;
    __Pyx_GIVEREF(__pyx_kp_u_elements_got);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_elements_got);

    /* "gel/protocol/codecs/namedtuple.pyx":38
 *             raise RuntimeError(
 *                 f'cannot decode NamedTuple: expected {len(fields_codecs)} '
 *                 f'elements, got {elem_count}')             # <<<<<<<<<<<<<<
 * 
 *         result = datatypes.namedtuple_new(self.namedtuple_type)
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_elem_count, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "gel/protocol/codecs/namedtuple.pyx":37
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(
 *                 f'cannot decode NamedTuple: expected {len(fields_codecs)} '             # <<<<<<<<<<<<<<
 *                 f'elements, got {elem_count}')
 * 
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/namedtuple.pyx":36
 * 
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'cannot decode NamedTuple: expected {len(fields_codecs)} '
 *                 f'elements, got {elem_count}')
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(3, 36, __pyx_L1_error)

    /* "gel/protocol/codecs/namedtuple.pyx":35
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_count != len(fields_codecs):             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode NamedTuple: expected {len(fields_codecs)} '
 */
  }

  /* "gel/protocol/codecs/namedtuple.pyx":40
 *                 f'elements, got {elem_count}')
 * 
 *         result = datatypes.namedtuple_new(self.namedtuple_type)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(elem_count):
 */
  __pyx_t_1 = __pyx_v_self->namedtuple_type;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = __pyx_f_3gel_9datatypes_9datatypes_namedtuple_new(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":42
 *         result = datatypes.namedtuple_new(self.namedtuple_type)
 * 
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             frb_read(buf, 4)  # reserved
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_3 = __pyx_v_elem_count;
  __pyx_t_6 = __pyx_t_3;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "gel/protocol/codecs/namedtuple.pyx":43
 * 
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # reserved             # <<<<<<<<<<<<<<
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 */
    __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(3, 43, __pyx_L1_error)

    /* "gel/protocol/codecs/namedtuple.pyx":44
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # reserved
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *             if elem_len == -1:
 */
    __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(3, 44, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_2);

    /* "gel/protocol/codecs/namedtuple.pyx":46
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
    __pyx_t_4 = (__pyx_v_elem_len == -1L);
    if (__pyx_t_4) {

      /* "gel/protocol/codecs/namedtuple.pyx":47
 * 
 *             if elem_len == -1:
 *                 elem = None             # <<<<<<<<<<<<<<
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

      /* "gel/protocol/codecs/namedtuple.pyx":46
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
      goto __pyx_L6;
    }

    /* "gel/protocol/codecs/namedtuple.pyx":49
 *                 elem = None
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]             # <<<<<<<<<<<<<<
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 */
    /*else*/ {
      if (unlikely(__pyx_v_fields_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 49, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v_fields_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = __pyx_t_7;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/namedtuple.pyx":51
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 */
      __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_9 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(3, 51, __pyx_L1_error)

      /* "gel/protocol/codecs/namedtuple.pyx":50
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 *                 elem = elem_codec.decode(             # <<<<<<<<<<<<<<
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_elem_codec->__pyx_vtab)->decode(__pyx_v_elem_codec, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 50, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/namedtuple.pyx":52
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after named '
 */
      __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 52, __pyx_L1_error)
      __pyx_t_4 = (__pyx_t_10 != 0);
      if (unlikely(__pyx_t_4)) {

        /* "gel/protocol/codecs/namedtuple.pyx":55
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after named '
 *                         f'tuple element decoding: {frb_get_len(&elem_buf)}')             # <<<<<<<<<<<<<<
 * 
 *             cpython.Py_INCREF(elem)
 */
        __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 55, __pyx_L1_error)
        __pyx_t_1 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 55, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);

        /* "gel/protocol/codecs/namedtuple.pyx":54
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after named '             # <<<<<<<<<<<<<<
 *                         f'tuple element decoding: {frb_get_len(&elem_buf)}')
 * 
 */
        __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 54, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "gel/protocol/codecs/namedtuple.pyx":53
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in buffer after named '
 *                         f'tuple element decoding: {frb_get_len(&elem_buf)}')
 */
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 53, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(3, 53, __pyx_L1_error)

        /* "gel/protocol/codecs/namedtuple.pyx":52
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after named '
 */
      }
    }
    __pyx_L6:;

    /* "gel/protocol/codecs/namedtuple.pyx":57
 *                         f'tuple element decoding: {frb_get_len(&elem_buf)}')
 * 
 *             cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *             cpython.PyTuple_SET_ITEM(result, i, elem)
 * 
 */
    Py_INCREF(__pyx_v_elem);

    /* "gel/protocol/codecs/namedtuple.pyx":58
 * 
 *             cpython.Py_INCREF(elem)
 *             cpython.PyTuple_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
  }

  /* "gel/protocol/codecs/namedtuple.pyx":60
 *             cpython.PyTuple_SET_ITEM(result, i, elem)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/protocol/codecs/namedtuple.pyx":23
 * cdef class NamedTupleCodec(BaseNamedRecordCodec):
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.NamedTupleCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XDECREF(__pyx_v_fields_codecs);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/namedtuple.pyx":63
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple fields_names, tuple fields_codecs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             NamedTupleCodec codec
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_15NamedTupleCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_fields_names, PyObject *__pyx_v_fields_codecs) {
  struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new", 1);

  /* "gel/protocol/codecs/namedtuple.pyx":67
 *             NamedTupleCodec codec
 * 
 *         codec = NamedTupleCodec.__new__(NamedTupleCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_NamedTupleCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 67, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":69
 *         codec = NamedTupleCodec.__new__(NamedTupleCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = 'NamedTuple'
 *         codec.descriptor = datatypes.record_desc_new(
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid);
  __pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/namedtuple.pyx":70
 * 
 *         codec.tid = tid
 *         codec.name = 'NamedTuple'             # <<<<<<<<<<<<<<
 *         codec.descriptor = datatypes.record_desc_new(
 *             fields_names, <object>NULL, <object>NULL)
 */
  __Pyx_INCREF(__pyx_n_u_NamedTuple);
  __Pyx_GIVEREF(__pyx_n_u_NamedTuple);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name);
  __pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name = __pyx_n_u_NamedTuple;

  /* "gel/protocol/codecs/namedtuple.pyx":71
 *         codec.tid = tid
 *         codec.name = 'NamedTuple'
 *         codec.descriptor = datatypes.record_desc_new(             # <<<<<<<<<<<<<<
 *             fields_names, <object>NULL, <object>NULL)
 *         codec.fields_codecs = fields_codecs
 */
  __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_new(__pyx_v_fields_names, ((PyObject *)NULL), ((PyObject *)NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.descriptor);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.descriptor);
  __pyx_v_codec->__pyx_base.descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":73
 *         codec.descriptor = datatypes.record_desc_new(
 *             fields_names, <object>NULL, <object>NULL)
 *         codec.fields_codecs = fields_codecs             # <<<<<<<<<<<<<<
 *         codec.namedtuple_type = datatypes.namedtuple_type_new(codec.descriptor)
 * 
 */
  __Pyx_INCREF(__pyx_v_fields_codecs);
  __Pyx_GIVEREF(__pyx_v_fields_codecs);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.fields_codecs);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.fields_codecs);
  __pyx_v_codec->__pyx_base.__pyx_base.fields_codecs = __pyx_v_fields_codecs;

  /* "gel/protocol/codecs/namedtuple.pyx":74
 *             fields_names, <object>NULL, <object>NULL)
 *         codec.fields_codecs = fields_codecs
 *         codec.namedtuple_type = datatypes.namedtuple_type_new(codec.descriptor)             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __pyx_t_1 = __pyx_v_codec->__pyx_base.descriptor;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_3gel_9datatypes_9datatypes_namedtuple_type_new(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_codec->namedtuple_type);
  __Pyx_DECREF(__pyx_v_codec->namedtuple_type);
  __pyx_v_codec->namedtuple_type = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":76
 *         codec.namedtuple_type = datatypes.namedtuple_type_new(codec.descriptor)
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/namedtuple.pyx":63
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple fields_names, tuple fields_codecs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             NamedTupleCodec codec
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.NamedTupleCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/namedtuple.pyx":78
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.NamedTupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15NamedTupleCodec_1make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 78, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(3, 78, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(3, 78, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.NamedTupleCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_make_type(((struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  PyObject *__pyx_8genexpr1__pyx_v_field = NULL;
  PyObject *__pyx_8genexpr1__pyx_v_codec = 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;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  unsigned int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/namedtuple.pyx":79
 * 
 *     def make_type(self, describe_context):
 *         return describe.NamedTupleType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NamedTupleType); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":80
 *     def make_type(self, describe_context):
 *         return describe.NamedTupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=self.type_name,
 *             element_types={
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.tid) < 0) __PYX_ERR(3, 80, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(3, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":81
 *         return describe.NamedTupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,             # <<<<<<<<<<<<<<
 *             element_types={
 *                 field: codec.make_type(describe_context)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.type_name) < 0) __PYX_ERR(3, 80, __pyx_L1_error)
  { /* enter inner scope */

    /* "gel/protocol/codecs/namedtuple.pyx":82
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 *             element_types={             # <<<<<<<<<<<<<<
 *                 field: codec.make_type(describe_context)
 *                 for field, codec in zip(
 */
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 82, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "gel/protocol/codecs/namedtuple.pyx":85
 *                 field: codec.make_type(describe_context)
 *                 for field, codec in zip(
 *                     self.namedtuple_type._fields, self.fields_codecs             # <<<<<<<<<<<<<<
 *                 )
 *             }
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->namedtuple_type, __pyx_n_s_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 85, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "gel/protocol/codecs/namedtuple.pyx":84
 *             element_types={
 *                 field: codec.make_type(describe_context)
 *                 for field, codec in zip(             # <<<<<<<<<<<<<<
 *                     self.namedtuple_type._fields, self.fields_codecs
 *                 )
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 84, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(3, 84, __pyx_L5_error);
    __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base.fields_codecs);
    __Pyx_GIVEREF(__pyx_v_self->__pyx_base.__pyx_base.fields_codecs);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->__pyx_base.__pyx_base.fields_codecs)) __PYX_ERR(3, 84, __pyx_L5_error);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 84, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4);
      __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 84, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 84, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 84, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(3, 84, __pyx_L5_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 84, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
            #if !CYTHON_ASSUME_SAFE_MACROS
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(3, 84, __pyx_L5_error)
            #endif
            if (__pyx_t_6 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(3, 84, __pyx_L5_error)
          #else
          __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 84, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_7(__pyx_t_4);
        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(3, 84, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      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(3, 84, __pyx_L5_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 84, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 84, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_9);
        #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(3, 84, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10);
        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(3, 84, __pyx_L5_error)
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L9_unpacking_done;
        __pyx_L8_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(3, 84, __pyx_L5_error)
        __pyx_L9_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_field, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_codec, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "gel/protocol/codecs/namedtuple.pyx":83
 *             name=self.type_name,
 *             element_types={
 *                 field: codec.make_type(describe_context)             # <<<<<<<<<<<<<<
 *                 for field, codec in zip(
 *                     self.namedtuple_type._fields, self.fields_codecs
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr1__pyx_v_codec, __pyx_n_s_make_type); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 83, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = NULL;
      __pyx_t_12 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_12 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_describe_context};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 83, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_8genexpr1__pyx_v_field, (PyObject*)__pyx_t_3))) __PYX_ERR(3, 83, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "gel/protocol/codecs/namedtuple.pyx":84
 *             element_types={
 *                 field: codec.make_type(describe_context)
 *                 for field, codec in zip(             # <<<<<<<<<<<<<<
 *                     self.namedtuple_type._fields, self.fields_codecs
 *                 )
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_codec); __pyx_8genexpr1__pyx_v_codec = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field); __pyx_8genexpr1__pyx_v_field = 0;
    goto __pyx_L11_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_codec); __pyx_8genexpr1__pyx_v_codec = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field); __pyx_8genexpr1__pyx_v_field = 0;
    goto __pyx_L1_error;
    __pyx_L11_exit_scope:;
  } /* exit inner scope */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_element_types, __pyx_t_5) < 0) __PYX_ERR(3, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":79
 * 
 *     def make_type(self, describe_context):
 *         return describe.NamedTupleType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/namedtuple.pyx":78
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.NamedTupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("gel.protocol.protocol.NamedTupleCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_field);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_codec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15NamedTupleCodec_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.NamedTupleCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15NamedTupleCodec_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.NamedTupleCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15NamedTupleCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.NamedTupleCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/object.pyx":34
 * cdef class ObjectCodec(BaseNamedRecordCodec):
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  Py_ssize_t __pyx_v_objlen;
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec = 0;
  PyObject *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_value_repr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  unsigned int __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  Py_UCS4 __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  int32_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/object.pyx":37
 *         cdef:
 *             WriteBuffer elem_data
 *             Py_ssize_t objlen = 0             # <<<<<<<<<<<<<<
 *             Py_ssize_t i
 *             BaseCodec sub_codec
 */
  __pyx_v_objlen = 0;

  /* "gel/protocol/codecs/object.pyx":40
 *             Py_ssize_t i
 *             BaseCodec sub_codec
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor             # <<<<<<<<<<<<<<
 * 
 *         if not self.is_sparse:
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self)->descriptor;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":42
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         if not self.is_sparse:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
  __pyx_t_2 = (!__pyx_v_self->is_sparse);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/object.pyx":43
 * 
 *         if not self.is_sparse:
 *             raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
 */
    __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
    __PYX_ERR(4, 43, __pyx_L1_error)

    /* "gel/protocol/codecs/object.pyx":42
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         if not self.is_sparse:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
  }

  /* "gel/protocol/codecs/object.pyx":45
 *             raise NotImplementedError
 * 
 *         elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         for name, arg in obj.items():
 *             try:
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elem_data = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":46
 * 
 *         elem_data = WriteBuffer.new()
 *         for name, arg in obj.items():             # <<<<<<<<<<<<<<
 *             try:
 *                 i = descriptor.get_pos(name)
 */
  __pyx_t_3 = 0;
  if (unlikely(__pyx_v_obj == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(4, 46, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_obj, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 46, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_6;
  __pyx_t_6 = 0;
  while (1) {
    __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_3, &__pyx_t_6, &__pyx_t_7, NULL, __pyx_t_5);
    if (unlikely(__pyx_t_8 == 0)) break;
    if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(4, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "gel/protocol/codecs/object.pyx":47
 *         elem_data = WriteBuffer.new()
 *         for name, arg in obj.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 i = descriptor.get_pos(name)
 *             except LookupError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "gel/protocol/codecs/object.pyx":48
 *         for name, arg in obj.items():
 *             try:
 *                 i = descriptor.get_pos(name)             # <<<<<<<<<<<<<<
 *             except LookupError:
 *                 raise self._make_missing_args_error_message(obj) from None
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_descriptor, __pyx_n_s_get_pos); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 48, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_12 = NULL;
        __pyx_t_13 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
            __pyx_t_13 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_name};
          __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 48, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 48, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_i = __pyx_t_14;

        /* "gel/protocol/codecs/object.pyx":47
 *         elem_data = WriteBuffer.new()
 *         for name, arg in obj.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 i = descriptor.get_pos(name)
 *             except LookupError:
 */
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L13_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "gel/protocol/codecs/object.pyx":49
 *             try:
 *                 i = descriptor.get_pos(name)
 *             except LookupError:             # <<<<<<<<<<<<<<
 *                 raise self._make_missing_args_error_message(obj) from None
 *             objlen += 1
 */
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_LookupError);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_12) < 0) __PYX_ERR(4, 49, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_12);

        /* "gel/protocol/codecs/object.pyx":50
 *                 i = descriptor.get_pos(name)
 *             except LookupError:
 *                 raise self._make_missing_args_error_message(obj) from None             # <<<<<<<<<<<<<<
 *             objlen += 1
 *             elem_data.write_int32(i)
 */
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_missing_args_error_message); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 50, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_17 = NULL;
        __pyx_t_13 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_16))) {
          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
          if (likely(__pyx_t_17)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
            __Pyx_INCREF(__pyx_t_17);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_16, function);
            __pyx_t_13 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_v_obj};
          __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 50, __pyx_L8_except_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        }
        __Pyx_Raise(__pyx_t_15, 0, 0, Py_None);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __PYX_ERR(4, 50, __pyx_L8_except_error)
      }
      goto __pyx_L8_except_error;

      /* "gel/protocol/codecs/object.pyx":47
 *         elem_data = WriteBuffer.new()
 *         for name, arg in obj.items():
 *             try:             # <<<<<<<<<<<<<<
 *                 i = descriptor.get_pos(name)
 *             except LookupError:
 */
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L13_try_end:;
    }

    /* "gel/protocol/codecs/object.pyx":51
 *             except LookupError:
 *                 raise self._make_missing_args_error_message(obj) from None
 *             objlen += 1             # <<<<<<<<<<<<<<
 *             elem_data.write_int32(i)
 *             if arg is not None:
 */
    __pyx_v_objlen = (__pyx_v_objlen + 1);

    /* "gel/protocol/codecs/object.pyx":52
 *                 raise self._make_missing_args_error_message(obj) from None
 *             objlen += 1
 *             elem_data.write_int32(i)             # <<<<<<<<<<<<<<
 *             if arg is not None:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 */
    __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, __pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "gel/protocol/codecs/object.pyx":53
 *             objlen += 1
 *             elem_data.write_int32(i)
 *             if arg is not None:             # <<<<<<<<<<<<<<
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:
 */
    __pyx_t_2 = (__pyx_v_arg != Py_None);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/object.pyx":54
 *             elem_data.write_int32(i)
 *             if arg is not None:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])             # <<<<<<<<<<<<<<
 *                 try:
 *                     sub_codec.encode(elem_data, arg)
 */
      if (unlikely(__pyx_v_self->__pyx_base.__pyx_base.fields_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 54, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx_base.__pyx_base.fields_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = __pyx_t_12;
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "gel/protocol/codecs/object.pyx":55
 *             if arg is not None:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "gel/protocol/codecs/object.pyx":56
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:
 *                     sub_codec.encode(elem_data, arg)             # <<<<<<<<<<<<<<
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(arg)
 */
          __pyx_t_6 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->encode(__pyx_v_sub_codec, __pyx_v_elem_data, __pyx_v_arg); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 56, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "gel/protocol/codecs/object.pyx":55
 *             if arg is not None:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L24_try_end;
        __pyx_L17_error:;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "gel/protocol/codecs/object.pyx":57
 *                 try:
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:             # <<<<<<<<<<<<<<
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:
 */
        __pyx_t_8 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError);
        if (__pyx_t_8) {
          __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_12, &__pyx_t_7) < 0) __PYX_ERR(4, 57, __pyx_L19_except_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_12);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_12);
          __pyx_v_e = __pyx_t_12;
          /*try:*/ {

            /* "gel/protocol/codecs/object.pyx":58
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(arg)             # <<<<<<<<<<<<<<
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
 */
            __pyx_t_15 = PyObject_Repr(__pyx_v_arg); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 58, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_v_value_repr = __pyx_t_15;
            __pyx_t_15 = 0;

            /* "gel/protocol/codecs/object.pyx":59
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 */
            __pyx_t_14 = PyObject_Length(__pyx_v_value_repr); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(4, 59, __pyx_L30_error)
            __pyx_t_2 = (__pyx_t_14 > 40);
            if (__pyx_t_2) {

              /* "gel/protocol/codecs/object.pyx":60
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for state argument '
 */
              __pyx_t_15 = __Pyx_PyObject_GetSlice(__pyx_v_value_repr, 0, 40, NULL, NULL, &__pyx_slice__16, 0, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 60, __pyx_L30_error)
              __Pyx_GOTREF(__pyx_t_15);
              __pyx_t_16 = PyNumber_Add(__pyx_t_15, __pyx_kp_u__17); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 60, __pyx_L30_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF_SET(__pyx_v_value_repr, __pyx_t_16);
              __pyx_t_16 = 0;

              /* "gel/protocol/codecs/object.pyx":59
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 */
            }

            /* "gel/protocol/codecs/object.pyx":61
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *                         'invalid input for state argument '
 *                         f' {name} := {value_repr} ({e})') from e
 */
            __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_errors); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 61, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 61, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

            /* "gel/protocol/codecs/object.pyx":62
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for state argument '             # <<<<<<<<<<<<<<
 *                         f' {name} := {value_repr} ({e})') from e
 *             else:
 */
            __pyx_t_15 = PyTuple_New(7); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 62, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_14 = 0;
            __pyx_t_18 = 127;
            __Pyx_INCREF(__pyx_kp_u_invalid_input_for_state_argument);
            __pyx_t_14 += 34;
            __Pyx_GIVEREF(__pyx_kp_u_invalid_input_for_state_argument);
            PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_kp_u_invalid_input_for_state_argument);

            /* "gel/protocol/codecs/object.pyx":63
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for state argument '
 *                         f' {name} := {value_repr} ({e})') from e             # <<<<<<<<<<<<<<
 *             else:
 *                 elem_data.write_int32(-1)
 */
            __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 63, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u__20);
            __pyx_t_14 += 4;
            __Pyx_GIVEREF(__pyx_kp_u__20);
            PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_kp_u__20);
            __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_v_value_repr, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 63, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u__21);
            __pyx_t_14 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__21);
            PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_kp_u__21);
            __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 63, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_14 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_kp_u__9);

            /* "gel/protocol/codecs/object.pyx":62
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for state argument '             # <<<<<<<<<<<<<<
 *                         f' {name} := {value_repr} ({e})') from e
 *             else:
 */
            __pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_15, 7, __pyx_t_14, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 62, __pyx_L30_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __pyx_t_15 = NULL;
            __pyx_t_13 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_17))) {
              __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_17);
              if (likely(__pyx_t_15)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
                __Pyx_INCREF(__pyx_t_15);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_17, function);
                __pyx_t_13 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_19};
              __pyx_t_16 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 61, __pyx_L30_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            }

            /* "gel/protocol/codecs/object.pyx":63
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for state argument '
 *                         f' {name} := {value_repr} ({e})') from e             # <<<<<<<<<<<<<<
 *             else:
 *                 elem_data.write_int32(-1)
 */
            __Pyx_Raise(__pyx_t_16, 0, 0, __pyx_v_e);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __PYX_ERR(4, 61, __pyx_L30_error)
          }

          /* "gel/protocol/codecs/object.pyx":57
 *                 try:
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:             # <<<<<<<<<<<<<<
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:
 */
          /*finally:*/ {
            __pyx_L30_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_27);
              __pyx_t_8 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_XGIVEREF(__pyx_t_27);
                __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
              }
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
              __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
              __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
              goto __pyx_L19_except_error;
            }
          }
        }
        goto __pyx_L19_except_error;

        /* "gel/protocol/codecs/object.pyx":55
 *             if arg is not None:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:
 */
        __pyx_L19_except_error:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L24_try_end:;
      }

      /* "gel/protocol/codecs/object.pyx":53
 *             objlen += 1
 *             elem_data.write_int32(i)
 *             if arg is not None:             # <<<<<<<<<<<<<<
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:
 */
      goto __pyx_L16;
    }

    /* "gel/protocol/codecs/object.pyx":65
 *                         f' {name} := {value_repr} ({e})') from e
 *             else:
 *                 elem_data.write_int32(-1)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 */
    /*else*/ {
      __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 65, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __pyx_L16:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":67
 *                 elem_data.write_int32(-1)
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length             # <<<<<<<<<<<<<<
 *         buf.write_int32(<int32_t><uint32_t>objlen)
 *         buf.write_buffer(elem_data)
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyInt_AddCObj(__pyx_int_4, __pyx_t_1, 4, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_28 = __Pyx_PyInt_As_int32_t(__pyx_t_7); if (unlikely((__pyx_t_28 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_28); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "gel/protocol/codecs/object.pyx":68
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 *         buf.write_int32(<int32_t><uint32_t>objlen)             # <<<<<<<<<<<<<<
 *         buf.write_buffer(elem_data)
 * 
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)((uint32_t)__pyx_v_objlen))); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "gel/protocol/codecs/object.pyx":69
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 *         buf.write_int32(<int32_t><uint32_t>objlen)
 *         buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 *     cdef encode_args(self, WriteBuffer buf, dict obj):
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "gel/protocol/codecs/object.pyx":34
 * cdef class ObjectCodec(BaseNamedRecordCodec):
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_XDECREF(__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_value_repr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/object.pyx":71
 *         buf.write_buffer(elem_data)
 * 
 *     cdef encode_args(self, WriteBuffer buf, dict obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_encode_args(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  Py_ssize_t __pyx_v_objlen;
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec = 0;
  PyObject *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_card = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_v_value_repr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_UCS4 __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  char const *__pyx_t_21;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  PyObject *__pyx_t_27 = NULL;
  int32_t __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_args", 1);

  /* "gel/protocol/codecs/object.pyx":77
 *             Py_ssize_t i
 *             BaseCodec sub_codec
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor             # <<<<<<<<<<<<<<
 * 
 *         if self.is_sparse:
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self)->descriptor;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":79
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         if self.is_sparse:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
  if (unlikely(__pyx_v_self->is_sparse)) {

    /* "gel/protocol/codecs/object.pyx":80
 * 
 *         if self.is_sparse:
 *             raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         self._check_encoder()
 */
    __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
    __PYX_ERR(4, 80, __pyx_L1_error)

    /* "gel/protocol/codecs/object.pyx":79
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         if self.is_sparse:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
  }

  /* "gel/protocol/codecs/object.pyx":82
 *             raise NotImplementedError
 * 
 *         self._check_encoder()             # <<<<<<<<<<<<<<
 * 
 *         objlen = len(obj)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_ObjectCodec *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._check_encoder(((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":84
 *         self._check_encoder()
 * 
 *         objlen = len(obj)             # <<<<<<<<<<<<<<
 *         if objlen != len(self.fields_codecs):
 *             raise self._make_missing_args_error_message(obj)
 */
  if (unlikely(__pyx_v_obj == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 84, __pyx_L1_error)
  }
  __pyx_t_2 = PyDict_Size(__pyx_v_obj); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(4, 84, __pyx_L1_error)
  __pyx_v_objlen = __pyx_t_2;

  /* "gel/protocol/codecs/object.pyx":85
 * 
 *         objlen = len(obj)
 *         if objlen != len(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             raise self._make_missing_args_error_message(obj)
 * 
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.fields_codecs;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 85, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(4, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_v_objlen != __pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/object.pyx":86
 *         objlen = len(obj)
 *         if objlen != len(self.fields_codecs):
 *             raise self._make_missing_args_error_message(obj)             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_missing_args_error_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_obj};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 86, __pyx_L1_error)

    /* "gel/protocol/codecs/object.pyx":85
 * 
 *         objlen = len(obj)
 *         if objlen != len(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             raise self._make_missing_args_error_message(obj)
 * 
 */
  }

  /* "gel/protocol/codecs/object.pyx":88
 *             raise self._make_missing_args_error_message(obj)
 * 
 *         elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         for i in range(objlen):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elem_data = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":89
 * 
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):             # <<<<<<<<<<<<<<
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             try:
 */
  __pyx_t_2 = __pyx_v_objlen;
  __pyx_t_7 = __pyx_t_2;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "gel/protocol/codecs/object.pyx":90
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)             # <<<<<<<<<<<<<<
 *             try:
 *                 arg = obj[name]
 */
    __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name(__pyx_v_descriptor, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/object.pyx":91
 *         for i in range(objlen):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             try:             # <<<<<<<<<<<<<<
 *                 arg = obj[name]
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "gel/protocol/codecs/object.pyx":92
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             try:
 *                 arg = obj[name]             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 raise self._make_missing_args_error_message(obj) from None
 */
        if (unlikely(__pyx_v_obj == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(4, 92, __pyx_L7_error)
        }
        __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_obj, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 92, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "gel/protocol/codecs/object.pyx":91
 *         for i in range(objlen):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             try:             # <<<<<<<<<<<<<<
 *                 arg = obj[name]
 *             except KeyError:
 */
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L14_try_end;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "gel/protocol/codecs/object.pyx":93
 *             try:
 *                 arg = obj[name]
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 raise self._make_missing_args_error_message(obj) from None
 * 
 */
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_12) {
        __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.encode_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(4, 93, __pyx_L9_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_5);

        /* "gel/protocol/codecs/object.pyx":94
 *                 arg = obj[name]
 *             except KeyError:
 *                 raise self._make_missing_args_error_message(obj) from None             # <<<<<<<<<<<<<<
 * 
 *             card = datatypes.record_desc_pointer_card(descriptor, i)
 */
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_make_missing_args_error_message); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 94, __pyx_L9_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
          if (likely(__pyx_t_15)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_15);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_14, function);
            __pyx_t_6 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_v_obj};
          __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 94, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        }
        __Pyx_Raise(__pyx_t_13, 0, 0, Py_None);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __PYX_ERR(4, 94, __pyx_L9_except_error)
      }
      goto __pyx_L9_except_error;

      /* "gel/protocol/codecs/object.pyx":91
 *         for i in range(objlen):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             try:             # <<<<<<<<<<<<<<
 *                 arg = obj[name]
 *             except KeyError:
 */
      __pyx_L9_except_error:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L14_try_end:;
    }

    /* "gel/protocol/codecs/object.pyx":96
 *                 raise self._make_missing_args_error_message(obj) from None
 * 
 *             card = datatypes.record_desc_pointer_card(descriptor, i)             # <<<<<<<<<<<<<<
 * 
 *             elem_data.write_int32(0)  # reserved bytes
 */
    __pyx_t_5 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_card(__pyx_v_descriptor, __pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_card, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "gel/protocol/codecs/object.pyx":98
 *             card = datatypes.record_desc_pointer_card(descriptor, i)
 * 
 *             elem_data.write_int32(0)  # reserved bytes             # <<<<<<<<<<<<<<
 *             if arg is None:
 *                 if card in {datatypes.EdgeFieldCardinality.ONE,
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "gel/protocol/codecs/object.pyx":99
 * 
 *             elem_data.write_int32(0)  # reserved bytes
 *             if arg is None:             # <<<<<<<<<<<<<<
 *                 if card in {datatypes.EdgeFieldCardinality.ONE,
 *                             datatypes.EdgeFieldCardinality.AT_LEAST_ONE}:
 */
    __pyx_t_3 = (__pyx_v_arg == Py_None);
    if (__pyx_t_3) {

      /* "gel/protocol/codecs/object.pyx":100
 *             elem_data.write_int32(0)  # reserved bytes
 *             if arg is None:
 *                 if card in {datatypes.EdgeFieldCardinality.ONE,             # <<<<<<<<<<<<<<
 *                             datatypes.EdgeFieldCardinality.AT_LEAST_ONE}:
 *                     raise errors.InvalidArgumentError(
 */
      __Pyx_INCREF(__pyx_v_card);
      __pyx_t_5 = __pyx_v_card;
      __pyx_t_4 = __Pyx_PyInt_From_EdgeFieldCardinality(ONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 100, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(4, 100, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!__pyx_t_16) {
      } else {
        __pyx_t_3 = __pyx_t_16;
        goto __pyx_L19_bool_binop_done;
      }

      /* "gel/protocol/codecs/object.pyx":101
 *             if arg is None:
 *                 if card in {datatypes.EdgeFieldCardinality.ONE,
 *                             datatypes.EdgeFieldCardinality.AT_LEAST_ONE}:             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidArgumentError(
 *                         f'argument ${name} is required, but received None'
 */
      __pyx_t_1 = __Pyx_PyInt_From_EdgeFieldCardinality(AT_LEAST_ONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 100, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/codecs/object.pyx":100
 *             elem_data.write_int32(0)  # reserved bytes
 *             if arg is None:
 *                 if card in {datatypes.EdgeFieldCardinality.ONE,             # <<<<<<<<<<<<<<
 *                             datatypes.EdgeFieldCardinality.AT_LEAST_ONE}:
 *                     raise errors.InvalidArgumentError(
 */
      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(4, 100, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_3 = __pyx_t_16;
      __pyx_L19_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_16 = __pyx_t_3;
      if (unlikely(__pyx_t_16)) {

        /* "gel/protocol/codecs/object.pyx":102
 *                 if card in {datatypes.EdgeFieldCardinality.ONE,
 *                             datatypes.EdgeFieldCardinality.AT_LEAST_ONE}:
 *                     raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *                         f'argument ${name} is required, but received None'
 *                     )
 */
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 102, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 102, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "gel/protocol/codecs/object.pyx":103
 *                             datatypes.EdgeFieldCardinality.AT_LEAST_ONE}:
 *                     raise errors.InvalidArgumentError(
 *                         f'argument ${name} is required, but received None'             # <<<<<<<<<<<<<<
 *                     )
 *                 elem_data.write_int32(-1)
 */
        __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 103, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_17 = 0;
        __pyx_t_18 = 127;
        __Pyx_INCREF(__pyx_kp_u_argument);
        __pyx_t_17 += 10;
        __Pyx_GIVEREF(__pyx_kp_u_argument);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_argument);
        __pyx_t_13 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 103, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_13) : __pyx_t_18;
        __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_13);
        __pyx_t_13 = 0;
        __Pyx_INCREF(__pyx_kp_u_is_required_but_received_None);
        __pyx_t_17 += 31;
        __Pyx_GIVEREF(__pyx_kp_u_is_required_but_received_None);
        PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_required_but_received_None);
        __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 103, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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_6 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_13};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 102, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(4, 102, __pyx_L1_error)

        /* "gel/protocol/codecs/object.pyx":100
 *             elem_data.write_int32(0)  # reserved bytes
 *             if arg is None:
 *                 if card in {datatypes.EdgeFieldCardinality.ONE,             # <<<<<<<<<<<<<<
 *                             datatypes.EdgeFieldCardinality.AT_LEAST_ONE}:
 *                     raise errors.InvalidArgumentError(
 */
      }

      /* "gel/protocol/codecs/object.pyx":105
 *                         f'argument ${name} is required, but received None'
 *                     )
 *                 elem_data.write_int32(-1)             # <<<<<<<<<<<<<<
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 */
      __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_elem_data->__pyx_vtab)->write_int32(__pyx_v_elem_data, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "gel/protocol/codecs/object.pyx":99
 * 
 *             elem_data.write_int32(0)  # reserved bytes
 *             if arg is None:             # <<<<<<<<<<<<<<
 *                 if card in {datatypes.EdgeFieldCardinality.ONE,
 *                             datatypes.EdgeFieldCardinality.AT_LEAST_ONE}:
 */
      goto __pyx_L17;
    }

    /* "gel/protocol/codecs/object.pyx":107
 *                 elem_data.write_int32(-1)
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])             # <<<<<<<<<<<<<<
 *                 try:
 *                     sub_codec.encode(elem_data, arg)
 */
    /*else*/ {
      if (unlikely(__pyx_v_self->__pyx_base.__pyx_base.fields_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 107, __pyx_L1_error)
      }
      __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_self->__pyx_base.__pyx_base.fields_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __pyx_t_5;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/object.pyx":108
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "gel/protocol/codecs/object.pyx":109
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:
 *                     sub_codec.encode(elem_data, arg)             # <<<<<<<<<<<<<<
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(arg)
 */
          __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->encode(__pyx_v_sub_codec, __pyx_v_elem_data, __pyx_v_arg); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 109, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "gel/protocol/codecs/object.pyx":108
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L28_try_end;
        __pyx_L21_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "gel/protocol/codecs/object.pyx":110
 *                 try:
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:             # <<<<<<<<<<<<<<
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:
 */
        __pyx_t_12 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError);
        if (__pyx_t_12) {
          __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.encode_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_13) < 0) __PYX_ERR(4, 110, __pyx_L23_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_5);
          __pyx_v_e = __pyx_t_5;
          /*try:*/ {

            /* "gel/protocol/codecs/object.pyx":111
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(arg)             # <<<<<<<<<<<<<<
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
 */
            __pyx_t_4 = PyObject_Repr(__pyx_v_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 111, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_v_value_repr = __pyx_t_4;
            __pyx_t_4 = 0;

            /* "gel/protocol/codecs/object.pyx":112
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 */
            __pyx_t_17 = PyObject_Length(__pyx_v_value_repr); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(4, 112, __pyx_L34_error)
            __pyx_t_16 = (__pyx_t_17 > 40);
            if (__pyx_t_16) {

              /* "gel/protocol/codecs/object.pyx":113
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 */
              __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_value_repr, 0, 40, NULL, NULL, &__pyx_slice__16, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 113, __pyx_L34_error)
              __Pyx_GOTREF(__pyx_t_4);
              __pyx_t_14 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__17); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 113, __pyx_L34_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF_SET(__pyx_v_value_repr, __pyx_t_14);
              __pyx_t_14 = 0;

              /* "gel/protocol/codecs/object.pyx":112
 *                 except (TypeError, ValueError) as e:
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:             # <<<<<<<<<<<<<<
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 */
            }

            /* "gel/protocol/codecs/object.pyx":114
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(             # <<<<<<<<<<<<<<
 *                         'invalid input for query argument'
 *                         f' ${name}: {value_repr} ({e})') from e
 */
            __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 114, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 114, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "gel/protocol/codecs/object.pyx":115
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'             # <<<<<<<<<<<<<<
 *                         f' ${name}: {value_repr} ({e})') from e
 * 
 */
            __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 115, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_17 = 0;
            __pyx_t_18 = 127;
            __Pyx_INCREF(__pyx_kp_u_invalid_input_for_query_argument_2);
            __pyx_t_17 += 34;
            __Pyx_GIVEREF(__pyx_kp_u_invalid_input_for_query_argument_2);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_invalid_input_for_query_argument_2);

            /* "gel/protocol/codecs/object.pyx":116
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 *                         f' ${name}: {value_repr} ({e})') from e             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 */
            __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 116, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u__4);
            __pyx_t_17 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__4);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__4);
            __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_v_value_repr, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 116, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u__21);
            __pyx_t_17 += 2;
            __Pyx_GIVEREF(__pyx_kp_u__21);
            PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__21);
            __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_v_e, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 116, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_19);
            __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
            __pyx_t_17 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_19);
            __Pyx_GIVEREF(__pyx_t_19);
            PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_19);
            __pyx_t_19 = 0;
            __Pyx_INCREF(__pyx_kp_u__9);
            __pyx_t_17 += 1;
            __Pyx_GIVEREF(__pyx_kp_u__9);
            PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_kp_u__9);

            /* "gel/protocol/codecs/object.pyx":115
 *                         value_repr = value_repr[:40] + '...'
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'             # <<<<<<<<<<<<<<
 *                         f' ${name}: {value_repr} ({e})') from e
 * 
 */
            __pyx_t_19 = __Pyx_PyUnicode_Join(__pyx_t_4, 7, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 115, __pyx_L34_error)
            __Pyx_GOTREF(__pyx_t_19);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = NULL;
            __pyx_t_6 = 0;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_4)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_4);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
                __pyx_t_6 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_19};
              __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
              if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 114, __pyx_L34_error)
              __Pyx_GOTREF(__pyx_t_14);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }

            /* "gel/protocol/codecs/object.pyx":116
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 *                         f' ${name}: {value_repr} ({e})') from e             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 */
            __Pyx_Raise(__pyx_t_14, 0, 0, __pyx_v_e);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __PYX_ERR(4, 114, __pyx_L34_error)
          }

          /* "gel/protocol/codecs/object.pyx":110
 *                 try:
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:             # <<<<<<<<<<<<<<
 *                     value_repr = repr(arg)
 *                     if len(value_repr) > 40:
 */
          /*finally:*/ {
            __pyx_L34_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
              if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __Pyx_XGOTREF(__pyx_t_26);
              __Pyx_XGOTREF(__pyx_t_27);
              __pyx_t_12 = __pyx_lineno; __pyx_t_20 = __pyx_clineno; __pyx_t_21 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
              }
              if (PY_MAJOR_VERSION >= 3) {
                __Pyx_XGIVEREF(__pyx_t_25);
                __Pyx_XGIVEREF(__pyx_t_26);
                __Pyx_XGIVEREF(__pyx_t_27);
                __Pyx_ExceptionReset(__pyx_t_25, __pyx_t_26, __pyx_t_27);
              }
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_XGIVEREF(__pyx_t_24);
              __Pyx_ErrRestore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
              __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0; __pyx_t_27 = 0;
              __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_20; __pyx_filename = __pyx_t_21;
              goto __pyx_L23_except_error;
            }
          }
        }
        goto __pyx_L23_except_error;

        /* "gel/protocol/codecs/object.pyx":108
 *             else:
 *                 sub_codec = <BaseCodec>(self.fields_codecs[i])
 *                 try:             # <<<<<<<<<<<<<<
 *                     sub_codec.encode(elem_data, arg)
 *                 except (TypeError, ValueError) as e:
 */
        __pyx_L23_except_error:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L28_try_end:;
      }
    }
    __pyx_L17:;
  }

  /* "gel/protocol/codecs/object.pyx":118
 *                         f' ${name}: {value_repr} ({e})') from e
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length             # <<<<<<<<<<<<<<
 *         buf.write_int32(<int32_t><uint32_t>objlen)
 *         buf.write_buffer(elem_data)
 */
  __pyx_t_13 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_5 = __Pyx_PyInt_AddCObj(__pyx_int_4, __pyx_t_13, 4, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_28 = __Pyx_PyInt_As_int32_t(__pyx_t_5); if (unlikely((__pyx_t_28 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_28); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/object.pyx":119
 * 
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 *         buf.write_int32(<int32_t><uint32_t>objlen)             # <<<<<<<<<<<<<<
 *         buf.write_buffer(elem_data)
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)((uint32_t)__pyx_v_objlen))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/object.pyx":120
 *         buf.write_int32(4 + elem_data.len())  # buffer length
 *         buf.write_int32(<int32_t><uint32_t>objlen)
 *         buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 *     def _make_missing_args_error_message(self, args):
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/object.pyx":71
 *         buf.write_buffer(elem_data)
 * 
 *     cdef encode_args(self, WriteBuffer buf, dict obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.encode_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_XDECREF(__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_card);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_value_repr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/object.pyx":122
 *         buf.write_buffer(elem_data)
 * 
 *     def _make_missing_args_error_message(self, args):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_1_make_missing_args_error_message(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_1_make_missing_args_error_message = {"_make_missing_args_error_message", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_1_make_missing_args_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_1_make_missing_args_error_message(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_args = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_make_missing_args_error_message (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 122, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_make_missing_args_error_message") < 0)) __PYX_ERR(4, 122, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_args = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_make_missing_args_error_message", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 122, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec._make_missing_args_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ObjectCodec__make_missing_args_error_message(((struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)__pyx_v_self), __pyx_v_args);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec__make_missing_args_error_message(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, PyObject *__pyx_v_args) {
  PyObject *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_required_args = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_passed_args = NULL;
  PyObject *__pyx_v_missed_args = NULL;
  PyObject *__pyx_v_extra_args = NULL;
  PyObject *__pyx_v_required = NULL;
  PyObject *__pyx_v_error_message = NULL;
  PyObject *__pyx_v_passed_args_repr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_make_missing_args_error_message", 1);

  /* "gel/protocol/codecs/object.pyx":123
 * 
 *     def _make_missing_args_error_message(self, args):
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor             # <<<<<<<<<<<<<<
 * 
 *         required_args = set()
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self)->descriptor;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":125
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         required_args = set()             # <<<<<<<<<<<<<<
 * 
 *         for i in range(len(self.fields_codecs)):
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_required_args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":127
 *         required_args = set()
 * 
 *         for i in range(len(self.fields_codecs)):             # <<<<<<<<<<<<<<
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             required_args.add(name)
 */
  __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.fields_codecs;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 127, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(4, 127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "gel/protocol/codecs/object.pyx":128
 * 
 *         for i in range(len(self.fields_codecs)):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)             # <<<<<<<<<<<<<<
 *             required_args.add(name)
 * 
 */
    __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name(__pyx_v_descriptor, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/object.pyx":129
 *         for i in range(len(self.fields_codecs)):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             required_args.add(name)             # <<<<<<<<<<<<<<
 * 
 *         passed_args = set(args.keys())
 */
    __pyx_t_5 = PySet_Add(__pyx_v_required_args, __pyx_v_name); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 129, __pyx_L1_error)
  }

  /* "gel/protocol/codecs/object.pyx":131
 *             required_args.add(name)
 * 
 *         passed_args = set(args.keys())             # <<<<<<<<<<<<<<
 *         missed_args = required_args - passed_args
 *         extra_args = passed_args - required_args
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_keys); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_t_6 = PySet_New(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_passed_args = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "gel/protocol/codecs/object.pyx":132
 * 
 *         passed_args = set(args.keys())
 *         missed_args = required_args - passed_args             # <<<<<<<<<<<<<<
 *         extra_args = passed_args - required_args
 *         required = 'acceptable' if self.is_sparse else 'expected'
 */
  __pyx_t_6 = PyNumber_Subtract(__pyx_v_required_args, __pyx_v_passed_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_missed_args = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "gel/protocol/codecs/object.pyx":133
 *         passed_args = set(args.keys())
 *         missed_args = required_args - passed_args
 *         extra_args = passed_args - required_args             # <<<<<<<<<<<<<<
 *         required = 'acceptable' if self.is_sparse else 'expected'
 * 
 */
  __pyx_t_6 = PyNumber_Subtract(__pyx_v_passed_args, __pyx_v_required_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_extra_args = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "gel/protocol/codecs/object.pyx":134
 *         missed_args = required_args - passed_args
 *         extra_args = passed_args - required_args
 *         required = 'acceptable' if self.is_sparse else 'expected'             # <<<<<<<<<<<<<<
 * 
 *         error_message = f'{required} {required_args} arguments'
 */
  if (__pyx_v_self->is_sparse) {
    __Pyx_INCREF(__pyx_n_u_acceptable);
    __pyx_t_6 = __pyx_n_u_acceptable;
  } else {
    __Pyx_INCREF(__pyx_n_u_expected_2);
    __pyx_t_6 = __pyx_n_u_expected_2;
  }
  __pyx_v_required = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "gel/protocol/codecs/object.pyx":136
 *         required = 'acceptable' if self.is_sparse else 'expected'
 * 
 *         error_message = f'{required} {required_args} arguments'             # <<<<<<<<<<<<<<
 * 
 *         passed_args_repr = repr(passed_args) if passed_args else 'nothing'
 */
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = 0;
  __pyx_t_9 = 127;
  __pyx_t_1 = __Pyx_PyUnicode_Unicode(__pyx_v_required); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u__13);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__13);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__13);
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_required_args, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_9;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __Pyx_INCREF(__pyx_kp_u_arguments);
  __pyx_t_2 += 10;
  __Pyx_GIVEREF(__pyx_kp_u_arguments);
  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_kp_u_arguments);
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_6, 4, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_error_message = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":138
 *         error_message = f'{required} {required_args} arguments'
 * 
 *         passed_args_repr = repr(passed_args) if passed_args else 'nothing'             # <<<<<<<<<<<<<<
 *         error_message += f', got {passed_args_repr}'
 * 
 */
  __pyx_t_10 = (PySet_GET_SIZE(__pyx_v_passed_args) != 0);
  if (__pyx_t_10) {
    __pyx_t_6 = PyObject_Repr(__pyx_v_passed_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __pyx_t_6;
    __pyx_t_6 = 0;
  } else {
    __Pyx_INCREF(__pyx_n_u_nothing);
    __pyx_t_1 = __pyx_n_u_nothing;
  }
  __pyx_v_passed_args_repr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":139
 * 
 *         passed_args_repr = repr(passed_args) if passed_args else 'nothing'
 *         error_message += f', got {passed_args_repr}'             # <<<<<<<<<<<<<<
 * 
 *         if not self.is_sparse:
 */
  __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_passed_args_repr, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_got_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_error_message, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_error_message, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":141
 *         error_message += f', got {passed_args_repr}'
 * 
 *         if not self.is_sparse:             # <<<<<<<<<<<<<<
 *             missed_args = set(required_args) - set(passed_args)
 *             if missed_args:
 */
  __pyx_t_10 = (!__pyx_v_self->is_sparse);
  if (__pyx_t_10) {

    /* "gel/protocol/codecs/object.pyx":142
 * 
 *         if not self.is_sparse:
 *             missed_args = set(required_args) - set(passed_args)             # <<<<<<<<<<<<<<
 *             if missed_args:
 *                 error_message += f', missed {missed_args}'
 */
    __pyx_t_1 = PySet_New(__pyx_v_required_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PySet_New(__pyx_v_passed_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_missed_args, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "gel/protocol/codecs/object.pyx":143
 *         if not self.is_sparse:
 *             missed_args = set(required_args) - set(passed_args)
 *             if missed_args:             # <<<<<<<<<<<<<<
 *                 error_message += f', missed {missed_args}'
 * 
 */
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_missed_args); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(4, 143, __pyx_L1_error)
    if (__pyx_t_10) {

      /* "gel/protocol/codecs/object.pyx":144
 *             missed_args = set(required_args) - set(passed_args)
 *             if missed_args:
 *                 error_message += f', missed {missed_args}'             # <<<<<<<<<<<<<<
 * 
 *         extra_args = set(passed_args) - set(required_args)
 */
      __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_missed_args, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_missed, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_error_message, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_error_message, ((PyObject*)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "gel/protocol/codecs/object.pyx":143
 *         if not self.is_sparse:
 *             missed_args = set(required_args) - set(passed_args)
 *             if missed_args:             # <<<<<<<<<<<<<<
 *                 error_message += f', missed {missed_args}'
 * 
 */
    }

    /* "gel/protocol/codecs/object.pyx":141
 *         error_message += f', got {passed_args_repr}'
 * 
 *         if not self.is_sparse:             # <<<<<<<<<<<<<<
 *             missed_args = set(required_args) - set(passed_args)
 *             if missed_args:
 */
  }

  /* "gel/protocol/codecs/object.pyx":146
 *                 error_message += f', missed {missed_args}'
 * 
 *         extra_args = set(passed_args) - set(required_args)             # <<<<<<<<<<<<<<
 *         if extra_args:
 *             error_message += f', extra {extra_args}'
 */
  __pyx_t_7 = PySet_New(__pyx_v_passed_args); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PySet_New(__pyx_v_required_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_extra_args, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":147
 * 
 *         extra_args = set(passed_args) - set(required_args)
 *         if extra_args:             # <<<<<<<<<<<<<<
 *             error_message += f', extra {extra_args}'
 * 
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_extra_args); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(4, 147, __pyx_L1_error)
  if (__pyx_t_10) {

    /* "gel/protocol/codecs/object.pyx":148
 *         extra_args = set(passed_args) - set(required_args)
 *         if extra_args:
 *             error_message += f', extra {extra_args}'             # <<<<<<<<<<<<<<
 * 
 *         return errors.QueryArgumentError(error_message)
 */
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_extra_args, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_extra, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyUnicode_ConcatInPlace(__pyx_v_error_message, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_error_message, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/object.pyx":147
 * 
 *         extra_args = set(passed_args) - set(required_args)
 *         if extra_args:             # <<<<<<<<<<<<<<
 *             error_message += f', extra {extra_args}'
 * 
 */
  }

  /* "gel/protocol/codecs/object.pyx":150
 *             error_message += f', extra {extra_args}'
 * 
 *         return errors.QueryArgumentError(error_message)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_QueryArgumentError); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_error_message};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/object.pyx":122
 *         buf.write_buffer(elem_data)
 * 
 *     def _make_missing_args_error_message(self, args):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec._make_missing_args_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_required_args);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_passed_args);
  __Pyx_XDECREF(__pyx_v_missed_args);
  __Pyx_XDECREF(__pyx_v_extra_args);
  __Pyx_XDECREF(__pyx_v_required);
  __Pyx_XDECREF(__pyx_v_error_message);
  __Pyx_XDECREF(__pyx_v_passed_args_repr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/object.pyx":152
 *         return errors.QueryArgumentError(error_message)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_elem_count;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_elem_codec = 0;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_v_fields_codecs = 0;
  PyObject *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char const *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/object.pyx":160
 *             BaseCodec elem_codec
 *             FRBuffer elem_buf
 *             tuple fields_codecs = (<BaseRecordCodec>self).fields_codecs             # <<<<<<<<<<<<<<
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self)->fields_codecs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fields_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":161
 *             FRBuffer elem_buf
 *             tuple fields_codecs = (<BaseRecordCodec>self).fields_codecs
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor             # <<<<<<<<<<<<<<
 * 
 *         if self.is_sparse:
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self)->descriptor;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":163
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         if self.is_sparse:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
  if (unlikely(__pyx_v_self->is_sparse)) {

    /* "gel/protocol/codecs/object.pyx":164
 * 
 *         if self.is_sparse:
 *             raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 */
    __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
    __PYX_ERR(4, 164, __pyx_L1_error)

    /* "gel/protocol/codecs/object.pyx":163
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         if self.is_sparse:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError
 * 
 */
  }

  /* "gel/protocol/codecs/object.pyx":166
 *             raise NotImplementedError
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *         if elem_count != len(fields_codecs):
 */
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(4, 166, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_2)));

  /* "gel/protocol/codecs/object.pyx":168
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_count != len(fields_codecs):             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode Object: expected {len(fields_codecs)} '
 */
  if (unlikely(__pyx_v_fields_codecs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(4, 168, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v_fields_codecs); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 168, __pyx_L1_error)
  __pyx_t_4 = (__pyx_v_elem_count != __pyx_t_3);
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/codecs/object.pyx":170
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(
 *                 f'cannot decode Object: expected {len(fields_codecs)} '             # <<<<<<<<<<<<<<
 *                 f'elements, got {elem_count}')
 * 
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot_decode_Object_expected);
    __pyx_t_3 += 31;
    __Pyx_GIVEREF(__pyx_kp_u_cannot_decode_Object_expected);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_decode_Object_expected);
    if (unlikely(__pyx_v_fields_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(4, 170, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyTuple_GET_SIZE(__pyx_v_fields_codecs); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(4, 170, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_elements_got);
    __pyx_t_3 += 15;
    __Pyx_GIVEREF(__pyx_kp_u_elements_got);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_elements_got);

    /* "gel/protocol/codecs/object.pyx":171
 *             raise RuntimeError(
 *                 f'cannot decode Object: expected {len(fields_codecs)} '
 *                 f'elements, got {elem_count}')             # <<<<<<<<<<<<<<
 * 
 *         result = datatypes.object_new(descriptor)
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_elem_count, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "gel/protocol/codecs/object.pyx":170
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(
 *                 f'cannot decode Object: expected {len(fields_codecs)} '             # <<<<<<<<<<<<<<
 *                 f'elements, got {elem_count}')
 * 
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/object.pyx":169
 * 
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'cannot decode Object: expected {len(fields_codecs)} '
 *                 f'elements, got {elem_count}')
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(4, 169, __pyx_L1_error)

    /* "gel/protocol/codecs/object.pyx":168
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_count != len(fields_codecs):             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode Object: expected {len(fields_codecs)} '
 */
  }

  /* "gel/protocol/codecs/object.pyx":173
 *                 f'elements, got {elem_count}')
 * 
 *         result = datatypes.object_new(descriptor)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(elem_count):
 */
  __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_object_new(__pyx_v_descriptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":175
 *         result = datatypes.object_new(descriptor)
 * 
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             frb_read(buf, 4)  # reserved
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_3 = __pyx_v_elem_count;
  __pyx_t_6 = __pyx_t_3;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "gel/protocol/codecs/object.pyx":176
 * 
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # reserved             # <<<<<<<<<<<<<<
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 */
    __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(4, 176, __pyx_L1_error)

    /* "gel/protocol/codecs/object.pyx":177
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # reserved
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *             if elem_len == -1:
 */
    __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(4, 177, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_2);

    /* "gel/protocol/codecs/object.pyx":179
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
    __pyx_t_4 = (__pyx_v_elem_len == -1L);
    if (__pyx_t_4) {

      /* "gel/protocol/codecs/object.pyx":180
 * 
 *             if elem_len == -1:
 *                 elem = None             # <<<<<<<<<<<<<<
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

      /* "gel/protocol/codecs/object.pyx":179
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/object.pyx":182
 *                 elem = None
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]             # <<<<<<<<<<<<<<
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 */
    /*else*/ {
      if (unlikely(__pyx_v_fields_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(4, 182, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_fields_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __pyx_t_1;
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "gel/protocol/codecs/object.pyx":184
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 */
      __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_9 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(4, 184, __pyx_L1_error)

      /* "gel/protocol/codecs/object.pyx":183
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 *                 elem = elem_codec.decode(             # <<<<<<<<<<<<<<
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):
 */
      __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_elem_codec->__pyx_vtab)->decode(__pyx_v_elem_codec, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "gel/protocol/codecs/object.pyx":185
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 185, __pyx_L1_error)
      __pyx_t_4 = (__pyx_t_10 != 0);
      if (unlikely(__pyx_t_4)) {

        /* "gel/protocol/codecs/object.pyx":188
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 *                         f'object element decoding: {frb_get_len(&elem_buf)}')             # <<<<<<<<<<<<<<
 * 
 *             datatypes.object_set(result, i, elem)
 */
        __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 188, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "gel/protocol/codecs/object.pyx":187
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                         f'object element decoding: {frb_get_len(&elem_buf)}')
 * 
 */
        __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "gel/protocol/codecs/object.pyx":186
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in buffer after '
 *                         f'object element decoding: {frb_get_len(&elem_buf)}')
 */
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(4, 186, __pyx_L1_error)

        /* "gel/protocol/codecs/object.pyx":185
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      }
    }
    __pyx_L7:;

    /* "gel/protocol/codecs/object.pyx":190
 *                         f'object element decoding: {frb_get_len(&elem_buf)}')
 * 
 *             datatypes.object_set(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_7 = __pyx_f_3gel_9datatypes_9datatypes_object_set(__pyx_v_result, __pyx_v_i, __pyx_v_elem); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "gel/protocol/codecs/object.pyx":192
 *             datatypes.object_set(result, i, elem)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def get_dataclass_fields(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/protocol/codecs/object.pyx":152
 *         return errors.QueryArgumentError(error_message)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XDECREF(__pyx_v_fields_codecs);
  __Pyx_XDECREF(__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/object.pyx":194
 *         return result
 * 
 *     def get_dataclass_fields(self):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_3get_dataclass_fields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_3get_dataclass_fields = {"get_dataclass_fields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_3get_dataclass_fields, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_3get_dataclass_fields(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_dataclass_fields (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_dataclass_fields", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_dataclass_fields", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_2get_dataclass_fields(((struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_2get_dataclass_fields(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self) {
  PyObject *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_rv = NULL;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_field = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_dataclass_fields", 1);

  /* "gel/protocol/codecs/object.pyx":195
 * 
 *     def get_dataclass_fields(self):
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor             # <<<<<<<<<<<<<<
 * 
 *         rv = self.cached_dataclass_fields
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self)->descriptor;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":197
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         rv = self.cached_dataclass_fields             # <<<<<<<<<<<<<<
 *         if rv is None:
 *             rv = {}
 */
  __pyx_t_1 = __pyx_v_self->cached_dataclass_fields;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_rv = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":198
 * 
 *         rv = self.cached_dataclass_fields
 *         if rv is None:             # <<<<<<<<<<<<<<
 *             rv = {}
 * 
 */
  __pyx_t_2 = (__pyx_v_rv == Py_None);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/object.pyx":199
 *         rv = self.cached_dataclass_fields
 *         if rv is None:
 *             rv = {}             # <<<<<<<<<<<<<<
 * 
 *             for i in range(len(self.fields_codecs)):
 */
    __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/object.pyx":201
 *             rv = {}
 * 
 *             for i in range(len(self.fields_codecs)):             # <<<<<<<<<<<<<<
 *                 name = datatypes.record_desc_pointer_name(descriptor, i)
 *                 field = rv[name] = dataclasses.field()
 */
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base.fields_codecs;
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_t_1 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(4, 201, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 201, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_i = __pyx_t_5;

      /* "gel/protocol/codecs/object.pyx":202
 * 
 *             for i in range(len(self.fields_codecs)):
 *                 name = datatypes.record_desc_pointer_name(descriptor, i)             # <<<<<<<<<<<<<<
 *                 field = rv[name] = dataclasses.field()
 *                 field.name = name
 */
      __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name(__pyx_v_descriptor, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/object.pyx":203
 *             for i in range(len(self.fields_codecs)):
 *                 name = datatypes.record_desc_pointer_name(descriptor, i)
 *                 field = rv[name] = dataclasses.field()             # <<<<<<<<<<<<<<
 *                 field.name = name
 *                 field._field_type = dataclasses._FIELD
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_dataclasses); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_field); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 203, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_1);
      if (unlikely((PyObject_SetItem(__pyx_v_rv, __pyx_v_name, __pyx_t_1) < 0))) __PYX_ERR(4, 203, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/codecs/object.pyx":204
 *                 name = datatypes.record_desc_pointer_name(descriptor, i)
 *                 field = rv[name] = dataclasses.field()
 *                 field.name = name             # <<<<<<<<<<<<<<
 *                 field._field_type = dataclasses._FIELD
 * 
 */
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_field, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(4, 204, __pyx_L1_error)

      /* "gel/protocol/codecs/object.pyx":205
 *                 field = rv[name] = dataclasses.field()
 *                 field.name = name
 *                 field._field_type = dataclasses._FIELD             # <<<<<<<<<<<<<<
 * 
 *             self.cached_dataclass_fields = rv
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dataclasses); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_FIELD); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_field, __pyx_n_s_field_type, __pyx_t_7) < 0) __PYX_ERR(4, 205, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }

    /* "gel/protocol/codecs/object.pyx":207
 *                 field._field_type = dataclasses._FIELD
 * 
 *             self.cached_dataclass_fields = rv             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
    __Pyx_INCREF(__pyx_v_rv);
    __Pyx_GIVEREF(__pyx_v_rv);
    __Pyx_GOTREF(__pyx_v_self->cached_dataclass_fields);
    __Pyx_DECREF(__pyx_v_self->cached_dataclass_fields);
    __pyx_v_self->cached_dataclass_fields = __pyx_v_rv;

    /* "gel/protocol/codecs/object.pyx":198
 * 
 *         rv = self.cached_dataclass_fields
 *         if rv is None:             # <<<<<<<<<<<<<<
 *             rv = {}
 * 
 */
  }

  /* "gel/protocol/codecs/object.pyx":208
 * 
 *             self.cached_dataclass_fields = rv
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "gel/protocol/codecs/object.pyx":194
 *         return result
 * 
 *     def get_dataclass_fields(self):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.get_dataclass_fields", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/object.pyx":211
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple names, tuple flags, tuple cards,             # <<<<<<<<<<<<<<
 *                        tuple codecs, bint is_sparse):
 *         cdef:
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_names, PyObject *__pyx_v_flags, PyObject *__pyx_v_cards, PyObject *__pyx_v_codecs, int __pyx_v_is_sparse) {
  struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new", 1);

  /* "gel/protocol/codecs/object.pyx":216
 *             ObjectCodec codec
 * 
 *         codec = ObjectCodec.__new__(ObjectCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_ObjectCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 216, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":218
 *         codec = ObjectCodec.__new__(ObjectCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         if is_sparse:
 *             codec.name = 'SparseObject'
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid);
  __pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/object.pyx":219
 * 
 *         codec.tid = tid
 *         if is_sparse:             # <<<<<<<<<<<<<<
 *             codec.name = 'SparseObject'
 *         else:
 */
  if (__pyx_v_is_sparse) {

    /* "gel/protocol/codecs/object.pyx":220
 *         codec.tid = tid
 *         if is_sparse:
 *             codec.name = 'SparseObject'             # <<<<<<<<<<<<<<
 *         else:
 *             codec.name = 'Object'
 */
    __Pyx_INCREF(__pyx_n_u_SparseObject);
    __Pyx_GIVEREF(__pyx_n_u_SparseObject);
    __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name);
    __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name);
    __pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name = __pyx_n_u_SparseObject;

    /* "gel/protocol/codecs/object.pyx":219
 * 
 *         codec.tid = tid
 *         if is_sparse:             # <<<<<<<<<<<<<<
 *             codec.name = 'SparseObject'
 *         else:
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/codecs/object.pyx":222
 *             codec.name = 'SparseObject'
 *         else:
 *             codec.name = 'Object'             # <<<<<<<<<<<<<<
 *         codec.is_sparse = is_sparse
 *         codec.descriptor = datatypes.record_desc_new(names, flags, cards)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_n_u_Object);
    __Pyx_GIVEREF(__pyx_n_u_Object);
    __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name);
    __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name);
    __pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name = __pyx_n_u_Object;
  }
  __pyx_L3:;

  /* "gel/protocol/codecs/object.pyx":223
 *         else:
 *             codec.name = 'Object'
 *         codec.is_sparse = is_sparse             # <<<<<<<<<<<<<<
 *         codec.descriptor = datatypes.record_desc_new(names, flags, cards)
 *         codec.descriptor.set_dataclass_fields_func(codec.get_dataclass_fields)
 */
  __pyx_v_codec->is_sparse = __pyx_v_is_sparse;

  /* "gel/protocol/codecs/object.pyx":224
 *             codec.name = 'Object'
 *         codec.is_sparse = is_sparse
 *         codec.descriptor = datatypes.record_desc_new(names, flags, cards)             # <<<<<<<<<<<<<<
 *         codec.descriptor.set_dataclass_fields_func(codec.get_dataclass_fields)
 *         codec.fields_codecs = codecs
 */
  __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_new(__pyx_v_names, __pyx_v_flags, __pyx_v_cards); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.descriptor);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.descriptor);
  __pyx_v_codec->__pyx_base.descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":225
 *         codec.is_sparse = is_sparse
 *         codec.descriptor = datatypes.record_desc_new(names, flags, cards)
 *         codec.descriptor.set_dataclass_fields_func(codec.get_dataclass_fields)             # <<<<<<<<<<<<<<
 *         codec.fields_codecs = codecs
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec->__pyx_base.descriptor, __pyx_n_s_set_dataclass_fields_func); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_codec), __pyx_n_s_get_dataclass_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":226
 *         codec.descriptor = datatypes.record_desc_new(names, flags, cards)
 *         codec.descriptor.set_dataclass_fields_func(codec.get_dataclass_fields)
 *         codec.fields_codecs = codecs             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __Pyx_INCREF(__pyx_v_codecs);
  __Pyx_GIVEREF(__pyx_v_codecs);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.fields_codecs);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.fields_codecs);
  __pyx_v_codec->__pyx_base.__pyx_base.fields_codecs = __pyx_v_codecs;

  /* "gel/protocol/codecs/object.pyx":228
 *         codec.fields_codecs = codecs
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/object.pyx":211
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple names, tuple flags, tuple cards,             # <<<<<<<<<<<<<<
 *                        tuple codecs, bint is_sparse):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/object.pyx":230
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_5make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_5make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_5make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_5make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(4, 230, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(4, 230, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(4, 230, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_4make_type(((struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_4make_type(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  PyObject *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_elements = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_codec = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_is_implicit = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/object.pyx":231
 * 
 *     def make_type(self, describe_context):
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor             # <<<<<<<<<<<<<<
 * 
 *         elements = {}
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self)->descriptor;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":233
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         elements = {}             # <<<<<<<<<<<<<<
 *         for i, codec in enumerate(self.fields_codecs):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elements = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":234
 * 
 *         elements = {}
 *         for i, codec in enumerate(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             is_implicit = datatypes.record_desc_pointer_is_implicit(
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.fields_codecs; __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(4, 234, __pyx_L1_error)
      #endif
      if (__pyx_t_3 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(4, 234, __pyx_L1_error)
    #else
    __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_codec, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 234, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "gel/protocol/codecs/object.pyx":235
 *         elements = {}
 *         for i, codec in enumerate(self.fields_codecs):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)             # <<<<<<<<<<<<<<
 *             is_implicit = datatypes.record_desc_pointer_is_implicit(
 *                 descriptor, i
 */
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 235, __pyx_L1_error)
    __pyx_t_4 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name(__pyx_v_descriptor, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "gel/protocol/codecs/object.pyx":237
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             is_implicit = datatypes.record_desc_pointer_is_implicit(
 *                 descriptor, i             # <<<<<<<<<<<<<<
 *             )
 *             if is_implicit and name == "__tname__":
 */
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 237, __pyx_L1_error)

    /* "gel/protocol/codecs/object.pyx":236
 *         for i, codec in enumerate(self.fields_codecs):
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             is_implicit = datatypes.record_desc_pointer_is_implicit(             # <<<<<<<<<<<<<<
 *                 descriptor, i
 *             )
 */
    __pyx_t_4 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_implicit(__pyx_v_descriptor, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_is_implicit, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "gel/protocol/codecs/object.pyx":239
 *                 descriptor, i
 *             )
 *             if is_implicit and name == "__tname__":             # <<<<<<<<<<<<<<
 *                 continue
 *             elements[name] = describe.Element(
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_is_implicit); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(4, 239, __pyx_L1_error)
    if (__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_7 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_tname, Py_EQ)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(4, 239, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_7;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_6) {

      /* "gel/protocol/codecs/object.pyx":240
 *             )
 *             if is_implicit and name == "__tname__":
 *                 continue             # <<<<<<<<<<<<<<
 *             elements[name] = describe.Element(
 *                 type=codec.make_type(describe_context),
 */
      goto __pyx_L3_continue;

      /* "gel/protocol/codecs/object.pyx":239
 *                 descriptor, i
 *             )
 *             if is_implicit and name == "__tname__":             # <<<<<<<<<<<<<<
 *                 continue
 *             elements[name] = describe.Element(
 */
    }

    /* "gel/protocol/codecs/object.pyx":241
 *             if is_implicit and name == "__tname__":
 *                 continue
 *             elements[name] = describe.Element(             # <<<<<<<<<<<<<<
 *                 type=codec.make_type(describe_context),
 *                 cardinality=CARDS_MAP[
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_describe); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Element); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "gel/protocol/codecs/object.pyx":242
 *                 continue
 *             elements[name] = describe.Element(
 *                 type=codec.make_type(describe_context),             # <<<<<<<<<<<<<<
 *                 cardinality=CARDS_MAP[
 *                     datatypes.record_desc_pointer_card(descriptor, i)
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_codec, __pyx_n_s_make_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = NULL;
    __pyx_t_12 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_12 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_describe_context};
      __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 242, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_type, __pyx_t_9) < 0) __PYX_ERR(4, 242, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "gel/protocol/codecs/object.pyx":243
 *             elements[name] = describe.Element(
 *                 type=codec.make_type(describe_context),
 *                 cardinality=CARDS_MAP[             # <<<<<<<<<<<<<<
 *                     datatypes.record_desc_pointer_card(descriptor, i)
 *                 ],
 */
    if (unlikely(__pyx_v_3gel_8protocol_8protocol_CARDS_MAP == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(4, 243, __pyx_L1_error)
    }

    /* "gel/protocol/codecs/object.pyx":244
 *                 type=codec.make_type(describe_context),
 *                 cardinality=CARDS_MAP[
 *                     datatypes.record_desc_pointer_card(descriptor, i)             # <<<<<<<<<<<<<<
 *                 ],
 *                 is_implicit=is_implicit,
 */
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 244, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_card(__pyx_v_descriptor, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);

    /* "gel/protocol/codecs/object.pyx":243
 *             elements[name] = describe.Element(
 *                 type=codec.make_type(describe_context),
 *                 cardinality=CARDS_MAP[             # <<<<<<<<<<<<<<
 *                     datatypes.record_desc_pointer_card(descriptor, i)
 *                 ],
 */
    __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_3gel_8protocol_8protocol_CARDS_MAP, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_cardinality, __pyx_t_10) < 0) __PYX_ERR(4, 242, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "gel/protocol/codecs/object.pyx":246
 *                     datatypes.record_desc_pointer_card(descriptor, i)
 *                 ],
 *                 is_implicit=is_implicit,             # <<<<<<<<<<<<<<
 *                 kind=(
 *                     enums.ElementKind.LINK
 */
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_is_implicit, __pyx_v_is_implicit) < 0) __PYX_ERR(4, 242, __pyx_L1_error)

    /* "gel/protocol/codecs/object.pyx":249
 *                 kind=(
 *                     enums.ElementKind.LINK
 *                     if datatypes.record_desc_pointer_is_link(descriptor, i)             # <<<<<<<<<<<<<<
 *                     else (
 *                         enums.ElementKind.LINK_PROPERTY
 */
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 249, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_link(__pyx_v_descriptor, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 249, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(4, 249, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_6) {

      /* "gel/protocol/codecs/object.pyx":248
 *                 is_implicit=is_implicit,
 *                 kind=(
 *                     enums.ElementKind.LINK             # <<<<<<<<<<<<<<
 *                     if datatypes.record_desc_pointer_is_link(descriptor, i)
 *                     else (
 */
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_enums); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ElementKind); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_LINK); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_10 = __pyx_t_9;
      __pyx_t_9 = 0;
    } else {

      /* "gel/protocol/codecs/object.pyx":253
 *                         enums.ElementKind.LINK_PROPERTY
 *                         if datatypes.record_desc_pointer_is_link_prop(
 *                             descriptor, i             # <<<<<<<<<<<<<<
 *                         )
 *                         else enums.ElementKind.PROPERTY
 */
      __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 253, __pyx_L1_error)

      /* "gel/protocol/codecs/object.pyx":252
 *                     else (
 *                         enums.ElementKind.LINK_PROPERTY
 *                         if datatypes.record_desc_pointer_is_link_prop(             # <<<<<<<<<<<<<<
 *                             descriptor, i
 *                         )
 */
      __pyx_t_11 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_link_prop(__pyx_v_descriptor, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(4, 252, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_7) {

        /* "gel/protocol/codecs/object.pyx":251
 *                     if datatypes.record_desc_pointer_is_link(descriptor, i)
 *                     else (
 *                         enums.ElementKind.LINK_PROPERTY             # <<<<<<<<<<<<<<
 *                         if datatypes.record_desc_pointer_is_link_prop(
 *                             descriptor, i
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_enums); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ElementKind); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_LINK_PROPERTY); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_9 = __pyx_t_11;
        __pyx_t_11 = 0;
      } else {

        /* "gel/protocol/codecs/object.pyx":255
 *                             descriptor, i
 *                         )
 *                         else enums.ElementKind.PROPERTY             # <<<<<<<<<<<<<<
 *                     )
 *                 )
 */
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_enums); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ElementKind); if (unlikely(!__pyx_t_13)) __PYX_ERR(4, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_PROPERTY); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_9 = __pyx_t_11;
        __pyx_t_11 = 0;
      }
      __pyx_t_10 = __pyx_t_9;
      __pyx_t_9 = 0;
    }
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_kind, __pyx_t_10) < 0) __PYX_ERR(4, 242, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "gel/protocol/codecs/object.pyx":241
 *             if is_implicit and name == "__tname__":
 *                 continue
 *             elements[name] = describe.Element(             # <<<<<<<<<<<<<<
 *                 type=codec.make_type(describe_context),
 *                 cardinality=CARDS_MAP[
 */
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 241, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely((PyDict_SetItem(__pyx_v_elements, __pyx_v_name, __pyx_t_10) < 0))) __PYX_ERR(4, 241, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "gel/protocol/codecs/object.pyx":234
 * 
 *         elements = {}
 *         for i, codec in enumerate(self.fields_codecs):             # <<<<<<<<<<<<<<
 *             name = datatypes.record_desc_pointer_name(descriptor, i)
 *             is_implicit = datatypes.record_desc_pointer_is_implicit(
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":260
 *             )
 * 
 *         return describe.ObjectType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ObjectType); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/object.pyx":261
 * 
 *         return describe.ObjectType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=None,
 *             elements=elements,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_uuid); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base.tid) < 0) __PYX_ERR(4, 261, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_8) < 0) __PYX_ERR(4, 261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "gel/protocol/codecs/object.pyx":262
 *         return describe.ObjectType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,             # <<<<<<<<<<<<<<
 *             elements=elements,
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, Py_None) < 0) __PYX_ERR(4, 261, __pyx_L1_error)

  /* "gel/protocol/codecs/object.pyx":263
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 *             elements=elements,             # <<<<<<<<<<<<<<
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_elements, __pyx_v_elements) < 0) __PYX_ERR(4, 261, __pyx_L1_error)

  /* "gel/protocol/codecs/object.pyx":260
 *             )
 * 
 *         return describe.ObjectType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 */
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/object.pyx":230
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_elements);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_is_implicit);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_6__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_8__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11ObjectCodec_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.ObjectCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/array.pyx":29
 *     # Base codec for arrays & sets.
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sub_codec = None
 *         self.cardinality = -1
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/array.pyx":30
 * 
 *     def __cinit__(self):
 *         self.sub_codec = None             # <<<<<<<<<<<<<<
 *         self.cardinality = -1
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_self->sub_codec);
  __pyx_v_self->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);

  /* "gel/protocol/codecs/array.pyx":31
 *     def __cinit__(self):
 *         self.sub_codec = None
 *         self.cardinality = -1             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */
  __pyx_v_self->cardinality = -1;

  /* "gel/protocol/codecs/array.pyx":29
 *     # Base codec for arrays & sets.
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sub_codec = None
 *         self.cardinality = -1
 */

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

/* "gel/protocol/codecs/array.pyx":33
 *         self.cardinality = -1
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  int32_t __pyx_v_ndims;
  Py_ssize_t __pyx_v_objlen;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_t_18;
  char const *__pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  int32_t __pyx_t_26;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/array.pyx":36
 *         cdef:
 *             WriteBuffer elem_data
 *             int32_t ndims = 1             # <<<<<<<<<<<<<<
 *             Py_ssize_t objlen
 *             Py_ssize_t i
 */
  __pyx_v_ndims = 1;

  /* "gel/protocol/codecs/array.pyx":41
 * 
 *         if not isinstance(
 *             self.sub_codec,             # <<<<<<<<<<<<<<
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 *              RangeCodec, MultiRangeCodec)
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_2);

  /* "gel/protocol/codecs/array.pyx":42
 *         if not isinstance(
 *             self.sub_codec,
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,             # <<<<<<<<<<<<<<
 *              RangeCodec, MultiRangeCodec)
 *         ):
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":41
 * 
 *         if not isinstance(
 *             self.sub_codec,             # <<<<<<<<<<<<<<
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 *              RangeCodec, MultiRangeCodec)
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_2);

  /* "gel/protocol/codecs/array.pyx":42
 *         if not isinstance(
 *             self.sub_codec,
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,             # <<<<<<<<<<<<<<
 *              RangeCodec, MultiRangeCodec)
 *         ):
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_TupleCodec); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":41
 * 
 *         if not isinstance(
 *             self.sub_codec,             # <<<<<<<<<<<<<<
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 *              RangeCodec, MultiRangeCodec)
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_2);

  /* "gel/protocol/codecs/array.pyx":42
 *         if not isinstance(
 *             self.sub_codec,
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,             # <<<<<<<<<<<<<<
 *              RangeCodec, MultiRangeCodec)
 *         ):
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":41
 * 
 *         if not isinstance(
 *             self.sub_codec,             # <<<<<<<<<<<<<<
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 *              RangeCodec, MultiRangeCodec)
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_2);

  /* "gel/protocol/codecs/array.pyx":42
 *         if not isinstance(
 *             self.sub_codec,
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,             # <<<<<<<<<<<<<<
 *              RangeCodec, MultiRangeCodec)
 *         ):
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_EnumCodec); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":41
 * 
 *         if not isinstance(
 *             self.sub_codec,             # <<<<<<<<<<<<<<
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 *              RangeCodec, MultiRangeCodec)
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_2);

  /* "gel/protocol/codecs/array.pyx":43
 *             self.sub_codec,
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 *              RangeCodec, MultiRangeCodec)             # <<<<<<<<<<<<<<
 *         ):
 *             raise TypeError(
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_RangeCodec); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":41
 * 
 *         if not isinstance(
 *             self.sub_codec,             # <<<<<<<<<<<<<<
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 *              RangeCodec, MultiRangeCodec)
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_2);

  /* "gel/protocol/codecs/array.pyx":43
 *             self.sub_codec,
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 *              RangeCodec, MultiRangeCodec)             # <<<<<<<<<<<<<<
 *         ):
 *             raise TypeError(
 */
  __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;

  /* "gel/protocol/codecs/array.pyx":40
 *             Py_ssize_t i
 * 
 *         if not isinstance(             # <<<<<<<<<<<<<<
 *             self.sub_codec,
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 */
  __pyx_t_3 = (!__pyx_t_1);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/array.pyx":46
 *         ):
 *             raise TypeError(
 *                 'only arrays of scalars are supported (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                     type(self.sub_codec).__name__
 *                 )
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_only_arrays_of_scalars_are_suppo, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "gel/protocol/codecs/array.pyx":47
 *             raise TypeError(
 *                 'only arrays of scalars are supported (got type {!r})'.format(
 *                     type(self.sub_codec).__name__             # <<<<<<<<<<<<<<
 *                 )
 *             )
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self->sub_codec))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "gel/protocol/codecs/array.pyx":45
 *              RangeCodec, MultiRangeCodec)
 *         ):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'only arrays of scalars are supported (got type {!r})'.format(
 *                     type(self.sub_codec).__name__
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(5, 45, __pyx_L1_error)

    /* "gel/protocol/codecs/array.pyx":40
 *             Py_ssize_t i
 * 
 *         if not isinstance(             # <<<<<<<<<<<<<<
 *             self.sub_codec,
 *             (ScalarCodec, TupleCodec, NamedTupleCodec, EnumCodec,
 */
  }

  /* "gel/protocol/codecs/array.pyx":51
 *             )
 * 
 *         if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'a sized iterable container expected (got type {!r})'.format(
 */
  __pyx_t_4 = __pyx_f_3gel_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(5, 51, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = (!__pyx_t_3);
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/array.pyx":53
 *         if not _is_array_iterable(obj):
 *             raise TypeError(
 *                 'a sized iterable container expected (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                     type(obj).__name__))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_sized_iterable_container_expec, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "gel/protocol/codecs/array.pyx":54
 *             raise TypeError(
 *                 'a sized iterable container expected (got type {!r})'.format(
 *                     type(obj).__name__))             # <<<<<<<<<<<<<<
 * 
 *         objlen = len(obj)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }

    /* "gel/protocol/codecs/array.pyx":52
 * 
 *         if not _is_array_iterable(obj):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'a sized iterable container expected (got type {!r})'.format(
 *                     type(obj).__name__))
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 52, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(5, 52, __pyx_L1_error)

    /* "gel/protocol/codecs/array.pyx":51
 *             )
 * 
 *         if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'a sized iterable container expected (got type {!r})'.format(
 */
  }

  /* "gel/protocol/codecs/array.pyx":56
 *                     type(obj).__name__))
 * 
 *         objlen = len(obj)             # <<<<<<<<<<<<<<
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements in array value')
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(5, 56, __pyx_L1_error)
  __pyx_v_objlen = __pyx_t_8;

  /* "gel/protocol/codecs/array.pyx":57
 * 
 *         objlen = len(obj)
 *         if objlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements in array value')
 * 
 */
  __pyx_t_1 = (__pyx_v_objlen > 0x7FFFFFFF);
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/array.pyx":58
 *         objlen = len(obj)
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements in array value')             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 58, __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(5, 58, __pyx_L1_error)

    /* "gel/protocol/codecs/array.pyx":57
 * 
 *         objlen = len(obj)
 *         if objlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements in array value')
 * 
 */
  }

  /* "gel/protocol/codecs/array.pyx":60
 *             raise ValueError('too many elements in array value')
 * 
 *         elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         for i in range(objlen):
 *             item = obj[i]
 */
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_elem_data = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/array.pyx":61
 * 
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):             # <<<<<<<<<<<<<<
 *             item = obj[i]
 *             if item is None:
 */
  __pyx_t_8 = __pyx_v_objlen;
  __pyx_t_9 = __pyx_t_8;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "gel/protocol/codecs/array.pyx":62
 *         elem_data = WriteBuffer.new()
 *         for i in range(objlen):
 *             item = obj[i]             # <<<<<<<<<<<<<<
 *             if item is None:
 *                 raise ValueError(
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "gel/protocol/codecs/array.pyx":63
 *         for i in range(objlen):
 *             item = obj[i]
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "invalid array element at index {}: "
 */
    __pyx_t_1 = (__pyx_v_item == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "gel/protocol/codecs/array.pyx":66
 *                 raise ValueError(
 *                     "invalid array element at index {}: "
 *                     "None is not allowed".format(i)             # <<<<<<<<<<<<<<
 *                 )
 *             else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_array_element_at_index_N, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 66, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 66, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 66, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }

      /* "gel/protocol/codecs/array.pyx":64
 *             item = obj[i]
 *             if item is None:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     "invalid array element at index {}: "
 *                     "None is not allowed".format(i)
 */
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 64, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(5, 64, __pyx_L1_error)

      /* "gel/protocol/codecs/array.pyx":63
 *         for i in range(objlen):
 *             item = obj[i]
 *             if item is None:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     "invalid array element at index {}: "
 */
    }

    /* "gel/protocol/codecs/array.pyx":69
 *                 )
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.sub_codec.encode(elem_data, item)
 *                 except TypeError as e:
 */
    /*else*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        /*try:*/ {

          /* "gel/protocol/codecs/array.pyx":70
 *             else:
 *                 try:
 *                     self.sub_codec.encode(elem_data, item)             # <<<<<<<<<<<<<<
 *                 except TypeError as e:
 *                     raise ValueError(
 */
          __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self->sub_codec->__pyx_vtab)->encode(__pyx_v_self->sub_codec, __pyx_v_elem_data, __pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 70, __pyx_L15_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "gel/protocol/codecs/array.pyx":69
 *                 )
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.sub_codec.encode(elem_data, item)
 *                 except TypeError as e:
 */
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L22_try_end;
        __pyx_L15_error:;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "gel/protocol/codecs/array.pyx":71
 *                 try:
 *                     self.sub_codec.encode(elem_data, item)
 *                 except TypeError as e:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(
 */
        __pyx_t_14 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
        if (__pyx_t_14) {
          __Pyx_AddTraceback("gel.protocol.protocol.BaseArrayCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(5, 71, __pyx_L17_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_2);
          __pyx_v_e = __pyx_t_2;
          /*try:*/ {

            /* "gel/protocol/codecs/array.pyx":73
 *                 except TypeError as e:
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(             # <<<<<<<<<<<<<<
 *                             e.args[0])) from None
 * 
 */
            __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_array_element, __pyx_n_s_format); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 73, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_15);

            /* "gel/protocol/codecs/array.pyx":74
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(
 *                             e.args[0])) from None             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(12 + 8 * ndims + elem_data.len())  # buffer length
 */
            __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 74, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_16, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 74, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_16 = NULL;
            __pyx_t_7 = 0;
            #if CYTHON_UNPACK_METHODS
            if (likely(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_7 = 1;
              }
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_t_17};
              __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 73, __pyx_L28_error)
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            }

            /* "gel/protocol/codecs/array.pyx":72
 *                     self.sub_codec.encode(elem_data, item)
 *                 except TypeError as e:
 *                     raise ValueError(             # <<<<<<<<<<<<<<
 *                         'invalid array element: {}'.format(
 *                             e.args[0])) from None
 */
            __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 72, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_15);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "gel/protocol/codecs/array.pyx":74
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(
 *                             e.args[0])) from None             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(12 + 8 * ndims + elem_data.len())  # buffer length
 */
            __Pyx_Raise(__pyx_t_15, 0, 0, Py_None);
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            __PYX_ERR(5, 72, __pyx_L28_error)
          }

          /* "gel/protocol/codecs/array.pyx":71
 *                 try:
 *                     self.sub_codec.encode(elem_data, item)
 *                 except TypeError as e:             # <<<<<<<<<<<<<<
 *                     raise ValueError(
 *                         'invalid array element: {}'.format(
 */
          /*finally:*/ {
            __pyx_L28_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 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_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_20);
              __Pyx_XGOTREF(__pyx_t_21);
              __Pyx_XGOTREF(__pyx_t_22);
              __Pyx_XGOTREF(__pyx_t_23);
              __Pyx_XGOTREF(__pyx_t_24);
              __Pyx_XGOTREF(__pyx_t_25);
              __pyx_t_14 = __pyx_lineno; __pyx_t_18 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
              {
                __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 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_20);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
              __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0;
              __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_18; __pyx_filename = __pyx_t_19;
              goto __pyx_L17_except_error;
            }
          }
        }
        goto __pyx_L17_except_error;

        /* "gel/protocol/codecs/array.pyx":69
 *                 )
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.sub_codec.encode(elem_data, item)
 *                 except TypeError as e:
 */
        __pyx_L17_except_error:;
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        goto __pyx_L1_error;
        __pyx_L22_try_end:;
      }
    }
  }

  /* "gel/protocol/codecs/array.pyx":76
 *                             e.args[0])) from None
 * 
 *         buf.write_int32(12 + 8 * ndims + elem_data.len())  # buffer length             # <<<<<<<<<<<<<<
 *         buf.write_int32(ndims)  # number of dimensions
 *         buf.write_int32(0)  # flags
 */
  __pyx_t_5 = __Pyx_PyInt_From_long((12 + (8 * __pyx_v_ndims))); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_26 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_26 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_26); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/array.pyx":77
 * 
 *         buf.write_int32(12 + 8 * ndims + elem_data.len())  # buffer length
 *         buf.write_int32(ndims)  # number of dimensions             # <<<<<<<<<<<<<<
 *         buf.write_int32(0)  # flags
 *         buf.write_int32(0)  # reserved
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_ndims); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/array.pyx":78
 *         buf.write_int32(12 + 8 * ndims + elem_data.len())  # buffer length
 *         buf.write_int32(ndims)  # number of dimensions
 *         buf.write_int32(0)  # flags             # <<<<<<<<<<<<<<
 *         buf.write_int32(0)  # reserved
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/array.pyx":79
 *         buf.write_int32(ndims)  # number of dimensions
 *         buf.write_int32(0)  # flags
 *         buf.write_int32(0)  # reserved             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(<int32_t>objlen)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/array.pyx":81
 *         buf.write_int32(0)  # reserved
 * 
 *         buf.write_int32(<int32_t>objlen)             # <<<<<<<<<<<<<<
 *         buf.write_int32(1)
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)__pyx_v_objlen)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/array.pyx":82
 * 
 *         buf.write_int32(<int32_t>objlen)
 *         buf.write_int32(1)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_buffer(elem_data)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/array.pyx":84
 *         buf.write_int32(1)
 * 
 *         buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/array.pyx":33
 *         self.cardinality = -1
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseArrayCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/array.pyx":86
 *         buf.write_buffer(elem_data)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self._decode_array(buf)
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  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("decode", 1);

  /* "gel/protocol/codecs/array.pyx":87
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         return self._decode_array(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _decode_array(self, FRBuffer *buf):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec__decode_array(__pyx_v_self, __pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/array.pyx":86
 *         buf.write_buffer(elem_data)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return self._decode_array(buf)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseArrayCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/array.pyx":89
 *         return self._decode_array(buf)
 * 
 *     cdef inline _decode_array(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t elem_count
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec__decode_array(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  Py_ssize_t __pyx_v_elem_count;
  int32_t __pyx_v_ndims;
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_UCS4 __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_decode_array", 1);

  /* "gel/protocol/codecs/array.pyx":92
 *         cdef:
 *             Py_ssize_t elem_count
 *             int32_t ndims = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             object result
 *             Py_ssize_t i
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 92, __pyx_L1_error)
  __pyx_v_ndims = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/array.pyx":98
 *             FRBuffer elem_buf
 * 
 *         frb_read(buf, 4)  # ignore flags             # <<<<<<<<<<<<<<
 *         frb_read(buf, 4)  # reserved
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 98, __pyx_L1_error)

  /* "gel/protocol/codecs/array.pyx":99
 * 
 *         frb_read(buf, 4)  # ignore flags
 *         frb_read(buf, 4)  # reserved             # <<<<<<<<<<<<<<
 * 
 *         if ndims > 1:
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 99, __pyx_L1_error)

  /* "gel/protocol/codecs/array.pyx":101
 *         frb_read(buf, 4)  # reserved
 * 
 *         if ndims > 1:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('only 1-dimensional arrays are supported')
 * 
 */
  __pyx_t_2 = (__pyx_v_ndims > 1);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/array.pyx":102
 * 
 *         if ndims > 1:
 *             raise RuntimeError('only 1-dimensional arrays are supported')             # <<<<<<<<<<<<<<
 * 
 *         if ndims == 0:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 102, __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(5, 102, __pyx_L1_error)

    /* "gel/protocol/codecs/array.pyx":101
 *         frb_read(buf, 4)  # reserved
 * 
 *         if ndims > 1:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('only 1-dimensional arrays are supported')
 * 
 */
  }

  /* "gel/protocol/codecs/array.pyx":104
 *             raise RuntimeError('only 1-dimensional arrays are supported')
 * 
 *         if ndims == 0:             # <<<<<<<<<<<<<<
 *             return []
 * 
 */
  __pyx_t_2 = (__pyx_v_ndims == 0);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/array.pyx":105
 * 
 *         if ndims == 0:
 *             return []             # <<<<<<<<<<<<<<
 * 
 *         assert ndims == 1
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "gel/protocol/codecs/array.pyx":104
 *             raise RuntimeError('only 1-dimensional arrays are supported')
 * 
 *         if ndims == 0:             # <<<<<<<<<<<<<<
 *             return []
 * 
 */
  }

  /* "gel/protocol/codecs/array.pyx":107
 *             return []
 * 
 *         assert ndims == 1             # <<<<<<<<<<<<<<
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_2 = (__pyx_v_ndims == 1);
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(5, 107, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(5, 107, __pyx_L1_error)
  #endif

  /* "gel/protocol/codecs/array.pyx":109
 *         assert ndims == 1
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         if self.cardinality != -1 and elem_count != self.cardinality:
 *             raise ValueError(
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 109, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1)));

  /* "gel/protocol/codecs/array.pyx":110
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if self.cardinality != -1 and elem_count != self.cardinality:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'invalid array size: received {elem_count}, '
 */
  __pyx_t_4 = (__pyx_v_self->cardinality != -1L);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_4 = (__pyx_v_elem_count != __pyx_v_self->cardinality);
  __pyx_t_2 = __pyx_t_4;
  __pyx_L6_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/array.pyx":112
 *         if self.cardinality != -1 and elem_count != self.cardinality:
 *             raise ValueError(
 *                 f'invalid array size: received {elem_count}, '             # <<<<<<<<<<<<<<
 *                 f'expected {self.cardinality}'
 *             )
 */
    __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_6 = 127;
    __Pyx_INCREF(__pyx_kp_u_invalid_array_size_received);
    __pyx_t_5 += 29;
    __Pyx_GIVEREF(__pyx_kp_u_invalid_array_size_received);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_invalid_array_size_received);
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_elem_count, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_expected_3);
    __pyx_t_5 += 11;
    __Pyx_GIVEREF(__pyx_kp_u_expected_3);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_expected_3);

    /* "gel/protocol/codecs/array.pyx":113
 *             raise ValueError(
 *                 f'invalid array size: received {elem_count}, '
 *                 f'expected {self.cardinality}'             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_7 = __Pyx_PyInt_From_int32_t(__pyx_v_self->cardinality); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_6;
    __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/codecs/array.pyx":112
 *         if self.cardinality != -1 and elem_count != self.cardinality:
 *             raise ValueError(
 *                 f'invalid array size: received {elem_count}, '             # <<<<<<<<<<<<<<
 *                 f'expected {self.cardinality}'
 *             )
 */
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/codecs/array.pyx":111
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if self.cardinality != -1 and elem_count != self.cardinality:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f'invalid array size: received {elem_count}, '
 *                 f'expected {self.cardinality}'
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(5, 111, __pyx_L1_error)

    /* "gel/protocol/codecs/array.pyx":110
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         if self.cardinality != -1 and elem_count != self.cardinality:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'invalid array size: received {elem_count}, '
 */
  }

  /* "gel/protocol/codecs/array.pyx":116
 *             )
 * 
 *         frb_read(buf, 4)  # Ignore the lower bound information             # <<<<<<<<<<<<<<
 * 
 *         result = cpython.PyList_New(elem_count)
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 116, __pyx_L1_error)

  /* "gel/protocol/codecs/array.pyx":118
 *         frb_read(buf, 4)  # Ignore the lower bound information
 * 
 *         result = cpython.PyList_New(elem_count)             # <<<<<<<<<<<<<<
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_3 = PyList_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "gel/protocol/codecs/array.pyx":119
 * 
 *         result = cpython.PyList_New(elem_count)
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 */
  __pyx_t_5 = __pyx_v_elem_count;
  __pyx_t_9 = __pyx_t_5;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "gel/protocol/codecs/array.pyx":120
 *         result = cpython.PyList_New(elem_count)
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             if elem_len == -1:
 *                 elem = None
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(5, 120, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_1);

    /* "gel/protocol/codecs/array.pyx":121
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
    __pyx_t_2 = (__pyx_v_elem_len == -1L);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/array.pyx":122
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 *                 elem = None             # <<<<<<<<<<<<<<
 *             else:
 *                 frb_slice_from(&elem_buf, buf, elem_len)
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

      /* "gel/protocol/codecs/array.pyx":121
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
      goto __pyx_L10;
    }

    /* "gel/protocol/codecs/array.pyx":124
 *                 elem = None
 *             else:
 *                 frb_slice_from(&elem_buf, buf, elem_len)             # <<<<<<<<<<<<<<
 *                 elem = self.sub_codec.decode(&elem_buf)
 *                 if frb_get_len(&elem_buf):
 */
    /*else*/ {
      __pyx_t_11 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_11 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(5, 124, __pyx_L1_error)

      /* "gel/protocol/codecs/array.pyx":125
 *             else:
 *                 frb_slice_from(&elem_buf, buf, elem_len)
 *                 elem = self.sub_codec.decode(&elem_buf)             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self->sub_codec->__pyx_vtab)->decode(__pyx_v_self->sub_codec, (&__pyx_v_elem_buf)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 125, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "gel/protocol/codecs/array.pyx":126
 *                 frb_slice_from(&elem_buf, buf, elem_len)
 *                 elem = self.sub_codec.decode(&elem_buf)
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      __pyx_t_12 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 126, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_12 != 0);
      if (unlikely(__pyx_t_2)) {

        /* "gel/protocol/codecs/array.pyx":129
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 *                         f'array element decoding: {frb_get_len(&elem_buf)}')             # <<<<<<<<<<<<<<
 * 
 *             cpython.Py_INCREF(elem)
 */
        __pyx_t_12 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 129, __pyx_L1_error)
        __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_12, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 129, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);

        /* "gel/protocol/codecs/array.pyx":128
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                         f'array element decoding: {frb_get_len(&elem_buf)}')
 * 
 */
        __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 128, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/codecs/array.pyx":127
 *                 elem = self.sub_codec.decode(&elem_buf)
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in buffer after '
 *                         f'array element decoding: {frb_get_len(&elem_buf)}')
 */
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 127, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(5, 127, __pyx_L1_error)

        /* "gel/protocol/codecs/array.pyx":126
 *                 frb_slice_from(&elem_buf, buf, elem_len)
 *                 elem = self.sub_codec.decode(&elem_buf)
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      }
    }
    __pyx_L10:;

    /* "gel/protocol/codecs/array.pyx":131
 *                         f'array element decoding: {frb_get_len(&elem_buf)}')
 * 
 *             cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *             cpython.PyList_SET_ITEM(result, i, elem)
 * 
 */
    Py_INCREF(__pyx_v_elem);

    /* "gel/protocol/codecs/array.pyx":132
 * 
 *             cpython.Py_INCREF(elem)
 *             cpython.PyList_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    PyList_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
  }

  /* "gel/protocol/codecs/array.pyx":134
 *             cpython.PyList_SET_ITEM(result, i, elem)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     cdef dump(self, int level = 0):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/protocol/codecs/array.pyx":89
 *         return self._decode_array(buf)
 * 
 *     cdef inline _decode_array(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t elem_count
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseArrayCodec._decode_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/array.pyx":136
 *         return result
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_14BaseArrayCodec_dump *__pyx_optional_args) {
  int __pyx_v_level = ((int)0);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_level = __pyx_optional_args->level;
    }
  }

  /* "gel/protocol/codecs/array.pyx":137
 * 
 *     cdef dump(self, int level = 0):
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PySequence_Multiply_Left(__pyx_v_level, __pyx_kp_u__13); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__19);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__19);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19);
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.level = (__pyx_v_level + 1);
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self->sub_codec->__pyx_vtab)->dump(__pyx_v_self->sub_codec, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/array.pyx":136
 *         return result
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.BaseArrayCodec.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14BaseArrayCodec_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseArrayCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14BaseArrayCodec_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.BaseArrayCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14BaseArrayCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.BaseArrayCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/array.pyx":144
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, BaseCodec sub_codec, int32_t cardinality):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ArrayCodec codec
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10ArrayCodec_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec, int32_t __pyx_v_cardinality) {
  struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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("new", 1);

  /* "gel/protocol/codecs/array.pyx":148
 *             ArrayCodec codec
 * 
 *         codec = ArrayCodec.__new__(ArrayCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_ArrayCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 148, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/array.pyx":150
 *         codec = ArrayCodec.__new__(ArrayCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = 'Array'
 *         codec.sub_codec = sub_codec
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.tid);
  __pyx_v_codec->__pyx_base.__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/array.pyx":151
 * 
 *         codec.tid = tid
 *         codec.name = 'Array'             # <<<<<<<<<<<<<<
 *         codec.sub_codec = sub_codec
 *         codec.cardinality = cardinality
 */
  __Pyx_INCREF(__pyx_n_u_Array);
  __Pyx_GIVEREF(__pyx_n_u_Array);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.name);
  __pyx_v_codec->__pyx_base.__pyx_base.name = __pyx_n_u_Array;

  /* "gel/protocol/codecs/array.pyx":152
 *         codec.tid = tid
 *         codec.name = 'Array'
 *         codec.sub_codec = sub_codec             # <<<<<<<<<<<<<<
 *         codec.cardinality = cardinality
 * 
 */
  __Pyx_INCREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_GOTREF((PyObject *)__pyx_v_codec->__pyx_base.sub_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_codec->__pyx_base.sub_codec);
  __pyx_v_codec->__pyx_base.sub_codec = __pyx_v_sub_codec;

  /* "gel/protocol/codecs/array.pyx":153
 *         codec.name = 'Array'
 *         codec.sub_codec = sub_codec
 *         codec.cardinality = cardinality             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __pyx_v_codec->__pyx_base.cardinality = __pyx_v_cardinality;

  /* "gel/protocol/codecs/array.pyx":155
 *         codec.cardinality = cardinality
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/array.pyx":144
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, BaseCodec sub_codec, int32_t cardinality):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ArrayCodec codec
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.ArrayCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/array.pyx":157
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10ArrayCodec_1make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 157, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(5, 157, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(5, 157, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ArrayCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_make_type(((struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/array.pyx":158
 * 
 *     def make_type(self, describe_context):
 *         return describe.ArrayType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ArrayType); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/array.pyx":159
 *     def make_type(self, describe_context):
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=self.type_name,
 *             element_type=self.sub_codec.make_type(describe_context),
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.__pyx_base.tid) < 0) __PYX_ERR(5, 159, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/array.pyx":160
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,             # <<<<<<<<<<<<<<
 *             element_type=self.sub_codec.make_type(describe_context),
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->__pyx_base.__pyx_base.type_name) < 0) __PYX_ERR(5, 159, __pyx_L1_error)

  /* "gel/protocol/codecs/array.pyx":161
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 *             element_type=self.sub_codec.make_type(describe_context),             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sub_codec), __pyx_n_s_make_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_describe_context};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_element_type, __pyx_t_5) < 0) __PYX_ERR(5, 159, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/array.pyx":158
 * 
 *     def make_type(self, describe_context):
 *         return describe.ArrayType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/array.pyx":157
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.ArrayCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10ArrayCodec_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.ArrayCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10ArrayCodec_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ArrayCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10ArrayCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.ArrayCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/array.pyx":165
 * 
 * 
 * cdef inline bint _is_trivial_container(object obj):             # <<<<<<<<<<<<<<
 *     return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \
 *             cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj)
 */

static CYTHON_INLINE int __pyx_f_3gel_8protocol_8protocol__is_trivial_container(PyObject *__pyx_v_obj) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;

  /* "gel/protocol/codecs/array.pyx":166
 * 
 * cdef inline bint _is_trivial_container(object obj):
 *     return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \             # <<<<<<<<<<<<<<
 *             cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj)
 * 
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_obj);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = PyBytes_Check(__pyx_v_obj);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":167
 * cdef inline bint _is_trivial_container(object obj):
 *     return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \
 *             cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (PyByteArray_Check(__pyx_v_obj) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_2 = (PyMemoryView_Check(__pyx_v_obj) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "gel/protocol/codecs/array.pyx":165
 * 
 * 
 * cdef inline bint _is_trivial_container(object obj):             # <<<<<<<<<<<<<<
 *     return cpython.PyUnicode_Check(obj) or cpython.PyBytes_Check(obj) or \
 *             cpythonx.PyByteArray_Check(obj) or cpythonx.PyMemoryView_Check(obj)
 */

  /* function exit code */
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/protocol/codecs/array.pyx":170
 * 
 * 
 * cdef inline _is_array_iterable(object obj):             # <<<<<<<<<<<<<<
 *     return (
 *         cpython.PyTuple_Check(obj) or
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol__is_array_iterable(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_is_array_iterable", 1);

  /* "gel/protocol/codecs/array.pyx":171
 * 
 * cdef inline _is_array_iterable(object obj):
 *     return (             # <<<<<<<<<<<<<<
 *         cpython.PyTuple_Check(obj) or
 *         cpython.PyList_Check(obj) or
 */
  __Pyx_XDECREF(__pyx_r);

  /* "gel/protocol/codecs/array.pyx":172
 * cdef inline _is_array_iterable(object obj):
 *     return (
 *         cpython.PyTuple_Check(obj) or             # <<<<<<<<<<<<<<
 *         cpython.PyList_Check(obj) or
 *         (
 */
  __pyx_t_2 = PyTuple_Check(__pyx_v_obj);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":173
 *     return (
 *         cpython.PyTuple_Check(obj) or
 *         cpython.PyList_Check(obj) or             # <<<<<<<<<<<<<<
 *         (
 *             isinstance(obj, IterableABC) and
 */
  __pyx_t_2 = PyList_Check(__pyx_v_obj);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":175
 *         cpython.PyList_Check(obj) or
 *         (
 *             isinstance(obj, IterableABC) and             # <<<<<<<<<<<<<<
 *             isinstance(obj, SizedABC) and
 *             not _is_trivial_container(obj) and
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_IterableABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":176
 *         (
 *             isinstance(obj, IterableABC) and
 *             isinstance(obj, SizedABC) and             # <<<<<<<<<<<<<<
 *             not _is_trivial_container(obj) and
 *             not isinstance(obj, MappingABC)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_SizedABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":177
 *             isinstance(obj, IterableABC) and
 *             isinstance(obj, SizedABC) and
 *             not _is_trivial_container(obj) and             # <<<<<<<<<<<<<<
 *             not isinstance(obj, MappingABC)
 *         )
 */
  __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol__is_trivial_container(__pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(5, 177, __pyx_L1_error)
  __pyx_t_4 = (!__pyx_t_2);
  if (__pyx_t_4) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "gel/protocol/codecs/array.pyx":178
 *             isinstance(obj, SizedABC) and
 *             not _is_trivial_container(obj) and
 *             not isinstance(obj, MappingABC)             # <<<<<<<<<<<<<<
 *         )
 *     )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MappingABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = (!__pyx_t_4);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/array.pyx":170
 * 
 * 
 * cdef inline _is_array_iterable(object obj):             # <<<<<<<<<<<<<<
 *     return (
 *         cpython.PyTuple_Check(obj) or
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol._is_array_iterable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":33
 * cdef class RangeCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sub_codec = None
 * 
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_10RangeCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_10RangeCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10RangeCodec___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_10RangeCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/range.pyx":34
 * 
 *     def __cinit__(self):
 *         self.sub_codec = None             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_self->sub_codec);
  __pyx_v_self->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);

  /* "gel/protocol/codecs/range.pyx":33
 * cdef class RangeCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sub_codec = None
 * 
 */

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

/* "gel/protocol/codecs/range.pyx":37
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             RangeCodec codec
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec) {
  struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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("new", 1);

  /* "gel/protocol/codecs/range.pyx":41
 *             RangeCodec codec
 * 
 *         codec = RangeCodec.__new__(RangeCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_RangeCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_RangeCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 41, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":43
 *         codec = RangeCodec.__new__(RangeCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = 'Range'
 *         codec.sub_codec = sub_codec
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.tid);
  __pyx_v_codec->__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/range.pyx":44
 * 
 *         codec.tid = tid
 *         codec.name = 'Range'             # <<<<<<<<<<<<<<
 *         codec.sub_codec = sub_codec
 * 
 */
  __Pyx_INCREF(__pyx_n_u_Range);
  __Pyx_GIVEREF(__pyx_n_u_Range);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.name);
  __pyx_v_codec->__pyx_base.name = __pyx_n_u_Range;

  /* "gel/protocol/codecs/range.pyx":45
 *         codec.tid = tid
 *         codec.name = 'Range'
 *         codec.sub_codec = sub_codec             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __Pyx_INCREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_GOTREF((PyObject *)__pyx_v_codec->sub_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_codec->sub_codec);
  __pyx_v_codec->sub_codec = __pyx_v_sub_codec;

  /* "gel/protocol/codecs/range.pyx":47
 *         codec.sub_codec = sub_codec
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":37
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             RangeCodec codec
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":50
 * 
 *     @staticmethod
 *     cdef encode_range(WriteBuffer buf, object obj, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint8_t flags = 0
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode_range(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec) {
  uint8_t __pyx_v_flags;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_sub_data = 0;
  PyObject *__pyx_v_lower = 0;
  PyObject *__pyx_v_upper = 0;
  int __pyx_v_inc_lower;
  int __pyx_v_inc_upper;
  int __pyx_v_empty;
  PyObject *__pyx_v_e = 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;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  char const *__pyx_t_23;
  int32_t __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_range", 1);

  /* "gel/protocol/codecs/range.pyx":52
 *     cdef encode_range(WriteBuffer buf, object obj, BaseCodec sub_codec):
 *         cdef:
 *             uint8_t flags = 0             # <<<<<<<<<<<<<<
 *             WriteBuffer sub_data
 *             object lower = obj.lower
 */
  __pyx_v_flags = 0;

  /* "gel/protocol/codecs/range.pyx":54
 *             uint8_t flags = 0
 *             WriteBuffer sub_data
 *             object lower = obj.lower             # <<<<<<<<<<<<<<
 *             object upper = obj.upper
 *             bint inc_lower = obj.inc_lower
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_lower = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":55
 *             WriteBuffer sub_data
 *             object lower = obj.lower
 *             object upper = obj.upper             # <<<<<<<<<<<<<<
 *             bint inc_lower = obj.inc_lower
 *             bint inc_upper = obj.inc_upper
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_upper = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":56
 *             object lower = obj.lower
 *             object upper = obj.upper
 *             bint inc_lower = obj.inc_lower             # <<<<<<<<<<<<<<
 *             bint inc_upper = obj.inc_upper
 *             bint empty = obj.is_empty()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_inc_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 56, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_inc_lower = __pyx_t_2;

  /* "gel/protocol/codecs/range.pyx":57
 *             object upper = obj.upper
 *             bint inc_lower = obj.inc_lower
 *             bint inc_upper = obj.inc_upper             # <<<<<<<<<<<<<<
 *             bint empty = obj.is_empty()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_inc_upper); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 57, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_inc_upper = __pyx_t_2;

  /* "gel/protocol/codecs/range.pyx":58
 *             bint inc_lower = obj.inc_lower
 *             bint inc_upper = obj.inc_upper
 *             bint empty = obj.is_empty()             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(sub_codec, ScalarCodec):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_is_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(6, 58, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_empty = __pyx_t_2;

  /* "gel/protocol/codecs/range.pyx":60
 *             bint empty = obj.is_empty()
 * 
 *         if not isinstance(sub_codec, ScalarCodec):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'only scalar ranges are supported (got type {!r})'.format(
 */
  __pyx_t_2 = __Pyx_TypeCheck(((PyObject *)__pyx_v_sub_codec), __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec); 
  __pyx_t_6 = (!__pyx_t_2);
  if (unlikely(__pyx_t_6)) {

    /* "gel/protocol/codecs/range.pyx":62
 *         if not isinstance(sub_codec, ScalarCodec):
 *             raise TypeError(
 *                 'only scalar ranges are supported (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                     type(sub_codec).__name__
 *                 )
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_only_scalar_ranges_are_supported, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "gel/protocol/codecs/range.pyx":63
 *             raise TypeError(
 *                 'only scalar ranges are supported (got type {!r})'.format(
 *                     type(sub_codec).__name__             # <<<<<<<<<<<<<<
 *                 )
 *             )
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_sub_codec))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 63, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 62, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }

    /* "gel/protocol/codecs/range.pyx":61
 * 
 *         if not isinstance(sub_codec, ScalarCodec):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'only scalar ranges are supported (got type {!r})'.format(
 *                     type(sub_codec).__name__
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(6, 61, __pyx_L1_error)

    /* "gel/protocol/codecs/range.pyx":60
 *             bint empty = obj.is_empty()
 * 
 *         if not isinstance(sub_codec, ScalarCodec):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 'only scalar ranges are supported (got type {!r})'.format(
 */
  }

  /* "gel/protocol/codecs/range.pyx":67
 *             )
 * 
 *         if empty:             # <<<<<<<<<<<<<<
 *             flags |= RANGE_EMPTY
 *         else:
 */
  if (__pyx_v_empty) {

    /* "gel/protocol/codecs/range.pyx":68
 * 
 *         if empty:
 *             flags |= RANGE_EMPTY             # <<<<<<<<<<<<<<
 *         else:
 *             if lower is None:
 */
    __pyx_v_flags = (__pyx_v_flags | __pyx_v_3gel_8protocol_8protocol_RANGE_EMPTY);

    /* "gel/protocol/codecs/range.pyx":67
 *             )
 * 
 *         if empty:             # <<<<<<<<<<<<<<
 *             flags |= RANGE_EMPTY
 *         else:
 */
    goto __pyx_L4;
  }

  /* "gel/protocol/codecs/range.pyx":70
 *             flags |= RANGE_EMPTY
 *         else:
 *             if lower is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INF
 *             elif inc_lower:
 */
  /*else*/ {
    __pyx_t_6 = (__pyx_v_lower == Py_None);
    if (__pyx_t_6) {

      /* "gel/protocol/codecs/range.pyx":71
 *         else:
 *             if lower is None:
 *                 flags |= RANGE_LB_INF             # <<<<<<<<<<<<<<
 *             elif inc_lower:
 *                 flags |= RANGE_LB_INC
 */
      __pyx_v_flags = (__pyx_v_flags | __pyx_v_3gel_8protocol_8protocol_RANGE_LB_INF);

      /* "gel/protocol/codecs/range.pyx":70
 *             flags |= RANGE_EMPTY
 *         else:
 *             if lower is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INF
 *             elif inc_lower:
 */
      goto __pyx_L5;
    }

    /* "gel/protocol/codecs/range.pyx":72
 *             if lower is None:
 *                 flags |= RANGE_LB_INF
 *             elif inc_lower:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INC
 *             if upper is None:
 */
    if (__pyx_v_inc_lower) {

      /* "gel/protocol/codecs/range.pyx":73
 *                 flags |= RANGE_LB_INF
 *             elif inc_lower:
 *                 flags |= RANGE_LB_INC             # <<<<<<<<<<<<<<
 *             if upper is None:
 *                 flags |= RANGE_UB_INF
 */
      __pyx_v_flags = (__pyx_v_flags | __pyx_v_3gel_8protocol_8protocol_RANGE_LB_INC);

      /* "gel/protocol/codecs/range.pyx":72
 *             if lower is None:
 *                 flags |= RANGE_LB_INF
 *             elif inc_lower:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_LB_INC
 *             if upper is None:
 */
    }
    __pyx_L5:;

    /* "gel/protocol/codecs/range.pyx":74
 *             elif inc_lower:
 *                 flags |= RANGE_LB_INC
 *             if upper is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INF
 *             elif inc_upper:
 */
    __pyx_t_6 = (__pyx_v_upper == Py_None);
    if (__pyx_t_6) {

      /* "gel/protocol/codecs/range.pyx":75
 *                 flags |= RANGE_LB_INC
 *             if upper is None:
 *                 flags |= RANGE_UB_INF             # <<<<<<<<<<<<<<
 *             elif inc_upper:
 *                 flags |= RANGE_UB_INC
 */
      __pyx_v_flags = (__pyx_v_flags | __pyx_v_3gel_8protocol_8protocol_RANGE_UB_INF);

      /* "gel/protocol/codecs/range.pyx":74
 *             elif inc_lower:
 *                 flags |= RANGE_LB_INC
 *             if upper is None:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INF
 *             elif inc_upper:
 */
      goto __pyx_L6;
    }

    /* "gel/protocol/codecs/range.pyx":76
 *             if upper is None:
 *                 flags |= RANGE_UB_INF
 *             elif inc_upper:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INC
 * 
 */
    if (__pyx_v_inc_upper) {

      /* "gel/protocol/codecs/range.pyx":77
 *                 flags |= RANGE_UB_INF
 *             elif inc_upper:
 *                 flags |= RANGE_UB_INC             # <<<<<<<<<<<<<<
 * 
 *         sub_data = WriteBuffer.new()
 */
      __pyx_v_flags = (__pyx_v_flags | __pyx_v_3gel_8protocol_8protocol_RANGE_UB_INC);

      /* "gel/protocol/codecs/range.pyx":76
 *             if upper is None:
 *                 flags |= RANGE_UB_INF
 *             elif inc_upper:             # <<<<<<<<<<<<<<
 *                 flags |= RANGE_UB_INC
 * 
 */
    }
    __pyx_L6:;
  }
  __pyx_L4:;

  /* "gel/protocol/codecs/range.pyx":79
 *                 flags |= RANGE_UB_INC
 * 
 *         sub_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         if lower is not None:
 *             try:
 */
  __pyx_t_3 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_sub_data = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "gel/protocol/codecs/range.pyx":80
 * 
 *         sub_data = WriteBuffer.new()
 *         if lower is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 sub_codec.encode(sub_data, lower)
 */
  __pyx_t_6 = (__pyx_v_lower != Py_None);
  if (__pyx_t_6) {

    /* "gel/protocol/codecs/range.pyx":81
 *         sub_data = WriteBuffer.new()
 *         if lower is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 sub_codec.encode(sub_data, lower)
 *             except TypeError as e:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "gel/protocol/codecs/range.pyx":82
 *         if lower is not None:
 *             try:
 *                 sub_codec.encode(sub_data, lower)             # <<<<<<<<<<<<<<
 *             except TypeError as e:
 *                 raise ValueError(
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->encode(__pyx_v_sub_codec, __pyx_v_sub_data, __pyx_v_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 82, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/codecs/range.pyx":81
 *         sub_data = WriteBuffer.new()
 *         if lower is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 sub_codec.encode(sub_data, lower)
 *             except TypeError as e:
 */
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L13_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "gel/protocol/codecs/range.pyx":83
 *             try:
 *                 sub_codec.encode(sub_data, lower)
 *             except TypeError as e:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'invalid range lower bound: {}'.format(
 */
      __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_11) {
        __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.encode_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(6, 83, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_v_e = __pyx_t_1;
        /*try:*/ {

          /* "gel/protocol/codecs/range.pyx":85
 *             except TypeError as e:
 *                 raise ValueError(
 *                     'invalid range lower bound: {}'.format(             # <<<<<<<<<<<<<<
 *                         e.args[0])) from None
 *         if upper is not None:
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_range_lower_bound, __pyx_n_s_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 85, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_12);

          /* "gel/protocol/codecs/range.pyx":86
 *                 raise ValueError(
 *                     'invalid range lower bound: {}'.format(
 *                         e.args[0])) from None             # <<<<<<<<<<<<<<
 *         if upper is not None:
 *             try:
 */
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 86, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 86, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_14};
            __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 85, __pyx_L19_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }

          /* "gel/protocol/codecs/range.pyx":84
 *                 sub_codec.encode(sub_data, lower)
 *             except TypeError as e:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'invalid range lower bound: {}'.format(
 *                         e.args[0])) from None
 */
          __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 84, __pyx_L19_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "gel/protocol/codecs/range.pyx":86
 *                 raise ValueError(
 *                     'invalid range lower bound: {}'.format(
 *                         e.args[0])) from None             # <<<<<<<<<<<<<<
 *         if upper is not None:
 *             try:
 */
          __Pyx_Raise(__pyx_t_12, 0, 0, Py_None);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __PYX_ERR(6, 84, __pyx_L19_error)
        }

        /* "gel/protocol/codecs/range.pyx":83
 *             try:
 *                 sub_codec.encode(sub_data, lower)
 *             except TypeError as e:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'invalid range lower bound: {}'.format(
 */
        /*finally:*/ {
          __pyx_L19_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_20);
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
            }
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
            __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
            __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
            goto __pyx_L10_except_error;
          }
        }
      }
      goto __pyx_L10_except_error;

      /* "gel/protocol/codecs/range.pyx":81
 *         sub_data = WriteBuffer.new()
 *         if lower is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 sub_codec.encode(sub_data, lower)
 *             except TypeError as e:
 */
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L13_try_end:;
    }

    /* "gel/protocol/codecs/range.pyx":80
 * 
 *         sub_data = WriteBuffer.new()
 *         if lower is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 sub_codec.encode(sub_data, lower)
 */
  }

  /* "gel/protocol/codecs/range.pyx":87
 *                     'invalid range lower bound: {}'.format(
 *                         e.args[0])) from None
 *         if upper is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 sub_codec.encode(sub_data, upper)
 */
  __pyx_t_6 = (__pyx_v_upper != Py_None);
  if (__pyx_t_6) {

    /* "gel/protocol/codecs/range.pyx":88
 *                         e.args[0])) from None
 *         if upper is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 sub_codec.encode(sub_data, upper)
 *             except TypeError as e:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_8);
      /*try:*/ {

        /* "gel/protocol/codecs/range.pyx":89
 *         if upper is not None:
 *             try:
 *                 sub_codec.encode(sub_data, upper)             # <<<<<<<<<<<<<<
 *             except TypeError as e:
 *                 raise ValueError(
 */
        __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->encode(__pyx_v_sub_codec, __pyx_v_sub_data, __pyx_v_upper); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 89, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "gel/protocol/codecs/range.pyx":88
 *                         e.args[0])) from None
 *         if upper is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 sub_codec.encode(sub_data, upper)
 *             except TypeError as e:
 */
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L31_try_end;
      __pyx_L26_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "gel/protocol/codecs/range.pyx":90
 *             try:
 *                 sub_codec.encode(sub_data, upper)
 *             except TypeError as e:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'invalid range upper bound: {}'.format(
 */
      __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_15) {
        __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.encode_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(6, 90, __pyx_L28_except_error)
        __Pyx_XGOTREF(__pyx_t_4);
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_v_e = __pyx_t_1;
        /*try:*/ {

          /* "gel/protocol/codecs/range.pyx":92
 *             except TypeError as e:
 *                 raise ValueError(
 *                     'invalid range upper bound: {}'.format(             # <<<<<<<<<<<<<<
 *                         e.args[0])) from None
 * 
 */
          __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_invalid_range_upper_bound, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 92, __pyx_L37_error)
          __Pyx_GOTREF(__pyx_t_7);

          /* "gel/protocol/codecs/range.pyx":93
 *                 raise ValueError(
 *                     'invalid range upper bound: {}'.format(
 *                         e.args[0])) from None             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(1 + sub_data.len())
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 93, __pyx_L37_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 93, __pyx_L37_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          __pyx_t_5 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_7))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_7, function);
              __pyx_t_5 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_13};
            __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 92, __pyx_L37_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          }

          /* "gel/protocol/codecs/range.pyx":91
 *                 sub_codec.encode(sub_data, upper)
 *             except TypeError as e:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     'invalid range upper bound: {}'.format(
 *                         e.args[0])) from None
 */
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 91, __pyx_L37_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "gel/protocol/codecs/range.pyx":93
 *                 raise ValueError(
 *                     'invalid range upper bound: {}'.format(
 *                         e.args[0])) from None             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int32(1 + sub_data.len())
 */
          __Pyx_Raise(__pyx_t_7, 0, 0, Py_None);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __PYX_ERR(6, 91, __pyx_L37_error)
        }

        /* "gel/protocol/codecs/range.pyx":90
 *             try:
 *                 sub_codec.encode(sub_data, upper)
 *             except TypeError as e:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     'invalid range upper bound: {}'.format(
 */
        /*finally:*/ {
          __pyx_L37_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_17);
            __pyx_t_15 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17);
            }
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
            __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
            __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_23;
            goto __pyx_L28_except_error;
          }
        }
      }
      goto __pyx_L28_except_error;

      /* "gel/protocol/codecs/range.pyx":88
 *                         e.args[0])) from None
 *         if upper is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 sub_codec.encode(sub_data, upper)
 *             except TypeError as e:
 */
      __pyx_L28_except_error:;
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_9, __pyx_t_8);
      goto __pyx_L1_error;
      __pyx_L31_try_end:;
    }

    /* "gel/protocol/codecs/range.pyx":87
 *                     'invalid range lower bound: {}'.format(
 *                         e.args[0])) from None
 *         if upper is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 sub_codec.encode(sub_data, upper)
 */
  }

  /* "gel/protocol/codecs/range.pyx":95
 *                         e.args[0])) from None
 * 
 *         buf.write_int32(1 + sub_data.len())             # <<<<<<<<<<<<<<
 *         buf.write_byte(<int8_t>flags)
 *         buf.write_buffer(sub_data)
 */
  __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_sub_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_24 = __Pyx_PyInt_As_int32_t(__pyx_t_1); if (unlikely((__pyx_t_24 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(6, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_24); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":96
 * 
 *         buf.write_int32(1 + sub_data.len())
 *         buf.write_byte(<int8_t>flags)             # <<<<<<<<<<<<<<
 *         buf.write_buffer(sub_data)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, ((int8_t)__pyx_v_flags)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 96, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":97
 *         buf.write_int32(1 + sub_data.len())
 *         buf.write_byte(<int8_t>flags)
 *         buf.write_buffer(sub_data)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_sub_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":50
 * 
 *     @staticmethod
 *     cdef encode_range(WriteBuffer buf, object obj, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint8_t flags = 0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.encode_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_sub_data);
  __Pyx_XDECREF(__pyx_v_lower);
  __Pyx_XDECREF(__pyx_v_upper);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":100
 * 
 *     @staticmethod
 *     cdef decode_range(FRBuffer *buf, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint8_t flags = <uint8_t>frb_read(buf, 1)[0]
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode_range(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec) {
  uint8_t __pyx_v_flags;
  int __pyx_v_empty;
  int __pyx_v_inc_lower;
  int __pyx_v_inc_upper;
  int __pyx_v_has_lower;
  int __pyx_v_has_upper;
  PyObject *__pyx_v_lower = 0;
  PyObject *__pyx_v_upper = 0;
  int32_t __pyx_v_sub_len;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_sub_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode_range", 1);

  /* "gel/protocol/codecs/range.pyx":102
 *     cdef decode_range(FRBuffer *buf, BaseCodec sub_codec):
 *         cdef:
 *             uint8_t flags = <uint8_t>frb_read(buf, 1)[0]             # <<<<<<<<<<<<<<
 *             bint empty = (flags & RANGE_EMPTY) != 0
 *             bint inc_lower = (flags & RANGE_LB_INC) != 0
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 1); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 102, __pyx_L1_error)
  __pyx_v_flags = ((uint8_t)(__pyx_t_1[0]));

  /* "gel/protocol/codecs/range.pyx":103
 *         cdef:
 *             uint8_t flags = <uint8_t>frb_read(buf, 1)[0]
 *             bint empty = (flags & RANGE_EMPTY) != 0             # <<<<<<<<<<<<<<
 *             bint inc_lower = (flags & RANGE_LB_INC) != 0
 *             bint inc_upper = (flags & RANGE_UB_INC) != 0
 */
  __pyx_v_empty = ((__pyx_v_flags & __pyx_v_3gel_8protocol_8protocol_RANGE_EMPTY) != 0);

  /* "gel/protocol/codecs/range.pyx":104
 *             uint8_t flags = <uint8_t>frb_read(buf, 1)[0]
 *             bint empty = (flags & RANGE_EMPTY) != 0
 *             bint inc_lower = (flags & RANGE_LB_INC) != 0             # <<<<<<<<<<<<<<
 *             bint inc_upper = (flags & RANGE_UB_INC) != 0
 *             bint has_lower = (flags & (RANGE_EMPTY | RANGE_LB_INF)) == 0
 */
  __pyx_v_inc_lower = ((__pyx_v_flags & __pyx_v_3gel_8protocol_8protocol_RANGE_LB_INC) != 0);

  /* "gel/protocol/codecs/range.pyx":105
 *             bint empty = (flags & RANGE_EMPTY) != 0
 *             bint inc_lower = (flags & RANGE_LB_INC) != 0
 *             bint inc_upper = (flags & RANGE_UB_INC) != 0             # <<<<<<<<<<<<<<
 *             bint has_lower = (flags & (RANGE_EMPTY | RANGE_LB_INF)) == 0
 *             bint has_upper = (flags & (RANGE_EMPTY | RANGE_UB_INF)) == 0
 */
  __pyx_v_inc_upper = ((__pyx_v_flags & __pyx_v_3gel_8protocol_8protocol_RANGE_UB_INC) != 0);

  /* "gel/protocol/codecs/range.pyx":106
 *             bint inc_lower = (flags & RANGE_LB_INC) != 0
 *             bint inc_upper = (flags & RANGE_UB_INC) != 0
 *             bint has_lower = (flags & (RANGE_EMPTY | RANGE_LB_INF)) == 0             # <<<<<<<<<<<<<<
 *             bint has_upper = (flags & (RANGE_EMPTY | RANGE_UB_INF)) == 0
 *             object lower = None
 */
  __pyx_v_has_lower = ((__pyx_v_flags & (__pyx_v_3gel_8protocol_8protocol_RANGE_EMPTY | __pyx_v_3gel_8protocol_8protocol_RANGE_LB_INF)) == 0);

  /* "gel/protocol/codecs/range.pyx":107
 *             bint inc_upper = (flags & RANGE_UB_INC) != 0
 *             bint has_lower = (flags & (RANGE_EMPTY | RANGE_LB_INF)) == 0
 *             bint has_upper = (flags & (RANGE_EMPTY | RANGE_UB_INF)) == 0             # <<<<<<<<<<<<<<
 *             object lower = None
 *             object upper = None
 */
  __pyx_v_has_upper = ((__pyx_v_flags & (__pyx_v_3gel_8protocol_8protocol_RANGE_EMPTY | __pyx_v_3gel_8protocol_8protocol_RANGE_UB_INF)) == 0);

  /* "gel/protocol/codecs/range.pyx":108
 *             bint has_lower = (flags & (RANGE_EMPTY | RANGE_LB_INF)) == 0
 *             bint has_upper = (flags & (RANGE_EMPTY | RANGE_UB_INF)) == 0
 *             object lower = None             # <<<<<<<<<<<<<<
 *             object upper = None
 *             int32_t sub_len
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_lower = Py_None;

  /* "gel/protocol/codecs/range.pyx":109
 *             bint has_upper = (flags & (RANGE_EMPTY | RANGE_UB_INF)) == 0
 *             object lower = None
 *             object upper = None             # <<<<<<<<<<<<<<
 *             int32_t sub_len
 *             FRBuffer sub_buf
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_upper = Py_None;

  /* "gel/protocol/codecs/range.pyx":113
 *             FRBuffer sub_buf
 * 
 *         if has_lower:             # <<<<<<<<<<<<<<
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:
 */
  if (__pyx_v_has_lower) {

    /* "gel/protocol/codecs/range.pyx":114
 * 
 *         if has_lower:
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             if sub_len != -1:
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 114, __pyx_L1_error)
    __pyx_v_sub_len = unpack_int32(__pyx_t_1);

    /* "gel/protocol/codecs/range.pyx":115
 *         if has_lower:
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:             # <<<<<<<<<<<<<<
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 lower = sub_codec.decode(&sub_buf)
 */
    __pyx_t_2 = (__pyx_v_sub_len != -1L);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/range.pyx":116
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:
 *                 frb_slice_from(&sub_buf, buf, sub_len)             # <<<<<<<<<<<<<<
 *                 lower = sub_codec.decode(&sub_buf)
 *                 if frb_get_len(&sub_buf):
 */
      __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_sub_buf), __pyx_v_buf, __pyx_v_sub_len); if (unlikely(__pyx_t_3 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(6, 116, __pyx_L1_error)

      /* "gel/protocol/codecs/range.pyx":117
 *             if sub_len != -1:
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 lower = sub_codec.decode(&sub_buf)             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&sub_buf):
 *                     raise RuntimeError(
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->decode(__pyx_v_sub_codec, (&__pyx_v_sub_buf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_lower, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "gel/protocol/codecs/range.pyx":118
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 lower = sub_codec.decode(&sub_buf)
 *                 if frb_get_len(&sub_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      __pyx_t_5 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_sub_buf)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 118, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_5 != 0);
      if (unlikely(__pyx_t_2)) {

        /* "gel/protocol/codecs/range.pyx":121
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')             # <<<<<<<<<<<<<<
 * 
 *         if has_upper:
 */
        __pyx_t_5 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_sub_buf)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 121, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 121, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "gel/protocol/codecs/range.pyx":120
 *                 if frb_get_len(&sub_buf):
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')
 * 
 */
        __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 120, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "gel/protocol/codecs/range.pyx":119
 *                 lower = sub_codec.decode(&sub_buf)
 *                 if frb_get_len(&sub_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in buffer after '
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')
 */
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 119, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(6, 119, __pyx_L1_error)

        /* "gel/protocol/codecs/range.pyx":118
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 lower = sub_codec.decode(&sub_buf)
 *                 if frb_get_len(&sub_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      }

      /* "gel/protocol/codecs/range.pyx":115
 *         if has_lower:
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:             # <<<<<<<<<<<<<<
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 lower = sub_codec.decode(&sub_buf)
 */
    }

    /* "gel/protocol/codecs/range.pyx":113
 *             FRBuffer sub_buf
 * 
 *         if has_lower:             # <<<<<<<<<<<<<<
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:
 */
  }

  /* "gel/protocol/codecs/range.pyx":123
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')
 * 
 *         if has_upper:             # <<<<<<<<<<<<<<
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:
 */
  if (__pyx_v_has_upper) {

    /* "gel/protocol/codecs/range.pyx":124
 * 
 *         if has_upper:
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             if sub_len != -1:
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 124, __pyx_L1_error)
    __pyx_v_sub_len = unpack_int32(__pyx_t_1);

    /* "gel/protocol/codecs/range.pyx":125
 *         if has_upper:
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:             # <<<<<<<<<<<<<<
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 upper = sub_codec.decode(&sub_buf)
 */
    __pyx_t_2 = (__pyx_v_sub_len != -1L);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/range.pyx":126
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:
 *                 frb_slice_from(&sub_buf, buf, sub_len)             # <<<<<<<<<<<<<<
 *                 upper = sub_codec.decode(&sub_buf)
 *                 if frb_get_len(&sub_buf):
 */
      __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_sub_buf), __pyx_v_buf, __pyx_v_sub_len); if (unlikely(__pyx_t_3 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(6, 126, __pyx_L1_error)

      /* "gel/protocol/codecs/range.pyx":127
 *             if sub_len != -1:
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 upper = sub_codec.decode(&sub_buf)             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&sub_buf):
 *                     raise RuntimeError(
 */
      __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->decode(__pyx_v_sub_codec, (&__pyx_v_sub_buf)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_upper, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "gel/protocol/codecs/range.pyx":128
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 upper = sub_codec.decode(&sub_buf)
 *                 if frb_get_len(&sub_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      __pyx_t_5 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_sub_buf)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 128, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_5 != 0);
      if (unlikely(__pyx_t_2)) {

        /* "gel/protocol/codecs/range.pyx":131
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')             # <<<<<<<<<<<<<<
 * 
 *         return range_mod.Range(
 */
        __pyx_t_5 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_sub_buf)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 131, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 131, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);

        /* "gel/protocol/codecs/range.pyx":130
 *                 if frb_get_len(&sub_buf):
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')
 * 
 */
        __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 130, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "gel/protocol/codecs/range.pyx":129
 *                 upper = sub_codec.decode(&sub_buf)
 *                 if frb_get_len(&sub_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in buffer after '
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')
 */
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 129, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_Raise(__pyx_t_4, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __PYX_ERR(6, 129, __pyx_L1_error)

        /* "gel/protocol/codecs/range.pyx":128
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 upper = sub_codec.decode(&sub_buf)
 *                 if frb_get_len(&sub_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      }

      /* "gel/protocol/codecs/range.pyx":125
 *         if has_upper:
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:             # <<<<<<<<<<<<<<
 *                 frb_slice_from(&sub_buf, buf, sub_len)
 *                 upper = sub_codec.decode(&sub_buf)
 */
    }

    /* "gel/protocol/codecs/range.pyx":123
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')
 * 
 *         if has_upper:             # <<<<<<<<<<<<<<
 *             sub_len = hton.unpack_int32(frb_read(buf, 4))
 *             if sub_len != -1:
 */
  }

  /* "gel/protocol/codecs/range.pyx":133
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')
 * 
 *         return range_mod.Range(             # <<<<<<<<<<<<<<
 *             lower,
 *             upper,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_range_mod); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Range); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/range.pyx":135
 *         return range_mod.Range(
 *             lower,
 *             upper,             # <<<<<<<<<<<<<<
 *             inc_lower=inc_lower,
 *             inc_upper=inc_upper,
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_lower);
  __Pyx_GIVEREF(__pyx_v_lower);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lower)) __PYX_ERR(6, 133, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_upper);
  __Pyx_GIVEREF(__pyx_v_upper);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_upper)) __PYX_ERR(6, 133, __pyx_L1_error);

  /* "gel/protocol/codecs/range.pyx":136
 *             lower,
 *             upper,
 *             inc_lower=inc_lower,             # <<<<<<<<<<<<<<
 *             inc_upper=inc_upper,
 *             empty=empty,
 */
  __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_inc_lower); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_inc_lower, __pyx_t_8) < 0) __PYX_ERR(6, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "gel/protocol/codecs/range.pyx":137
 *             upper,
 *             inc_lower=inc_lower,
 *             inc_upper=inc_upper,             # <<<<<<<<<<<<<<
 *             empty=empty,
 *         )
 */
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_inc_upper); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_inc_upper, __pyx_t_8) < 0) __PYX_ERR(6, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "gel/protocol/codecs/range.pyx":138
 *             inc_lower=inc_lower,
 *             inc_upper=inc_upper,
 *             empty=empty,             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_empty); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_empty, __pyx_t_8) < 0) __PYX_ERR(6, 136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "gel/protocol/codecs/range.pyx":133
 *                         f'range bound decoding: {frb_get_len(&sub_buf)}')
 * 
 *         return range_mod.Range(             # <<<<<<<<<<<<<<
 *             lower,
 *             upper,
 */
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":100
 * 
 *     @staticmethod
 *     cdef decode_range(FRBuffer *buf, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint8_t flags = <uint8_t>frb_read(buf, 1)[0]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.decode_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lower);
  __Pyx_XDECREF(__pyx_v_upper);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":141
 *         )
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         RangeCodec.encode_range(buf, obj, self.sub_codec)
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/range.pyx":142
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         RangeCodec.encode_range(buf, obj, self.sub_codec)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode_range(__pyx_v_buf, __pyx_v_obj, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 142, __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;

  /* "gel/protocol/codecs/range.pyx":141
 *         )
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         RangeCodec.encode_range(buf, obj, self.sub_codec)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":144
 *         RangeCodec.encode_range(buf, obj, self.sub_codec)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return RangeCodec.decode_range(buf, self.sub_codec)
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/range.pyx":145
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         return RangeCodec.decode_range(buf, self.sub_codec)             # <<<<<<<<<<<<<<
 * 
 *     cdef dump(self, int level = 0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode_range(__pyx_v_buf, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":144
 *         RangeCodec.encode_range(buf, obj, self.sub_codec)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         return RangeCodec.decode_range(buf, self.sub_codec)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":147
 *         return RangeCodec.decode_range(buf, self.sub_codec)
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_10RangeCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_10RangeCodec_dump *__pyx_optional_args) {
  int __pyx_v_level = ((int)0);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_level = __pyx_optional_args->level;
    }
  }

  /* "gel/protocol/codecs/range.pyx":148
 * 
 *     cdef dump(self, int level = 0):
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PySequence_Multiply_Left(__pyx_v_level, __pyx_kp_u__13); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__19);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__19);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19);
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.level = (__pyx_v_level + 1);
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self->sub_codec->__pyx_vtab)->dump(__pyx_v_self->sub_codec, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":147
 *         return RangeCodec.decode_range(buf, self.sub_codec)
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":150
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.RangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10RangeCodec_3make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 150, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(6, 150, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(6, 150, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10RangeCodec_2make_type(((struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10RangeCodec_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/range.pyx":151
 * 
 *     def make_type(self, describe_context):
 *         return describe.RangeType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_RangeType); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":152
 *     def make_type(self, describe_context):
 *         return describe.RangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=self.type_name,
 *             value_type=self.sub_codec.make_type(describe_context),
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.tid) < 0) __PYX_ERR(6, 152, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(6, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/range.pyx":153
 *         return describe.RangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,             # <<<<<<<<<<<<<<
 *             value_type=self.sub_codec.make_type(describe_context),
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->__pyx_base.type_name) < 0) __PYX_ERR(6, 152, __pyx_L1_error)

  /* "gel/protocol/codecs/range.pyx":154
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 *             value_type=self.sub_codec.make_type(describe_context),             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->sub_codec), __pyx_n_s_make_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_describe_context};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value_type, __pyx_t_5) < 0) __PYX_ERR(6, 152, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/range.pyx":151
 * 
 *     def make_type(self, describe_context):
 *         return describe.RangeType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":150
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.RangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10RangeCodec_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10RangeCodec_4__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10RangeCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_10RangeCodec_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_10RangeCodec_6__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_10RangeCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.RangeCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":161
 * cdef class MultiRangeCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sub_codec = None
 * 
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, __pyx_nargs); return -1;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec___cinit__(((struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)__pyx_v_self));

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

static int __pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec___cinit__(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 1);

  /* "gel/protocol/codecs/range.pyx":162
 * 
 *     def __cinit__(self):
 *         self.sub_codec = None             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_self->sub_codec);
  __pyx_v_self->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);

  /* "gel/protocol/codecs/range.pyx":161
 * cdef class MultiRangeCodec(BaseCodec):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.sub_codec = None
 * 
 */

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

/* "gel/protocol/codecs/range.pyx":165
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             MultiRangeCodec codec
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec) {
  struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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("new", 1);

  /* "gel/protocol/codecs/range.pyx":169
 *             MultiRangeCodec codec
 * 
 *         codec = MultiRangeCodec.__new__(MultiRangeCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_MultiRangeCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 169, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":171
 *         codec = MultiRangeCodec.__new__(MultiRangeCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = 'MultiRange'
 *         codec.sub_codec = sub_codec
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.tid);
  __pyx_v_codec->__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/range.pyx":172
 * 
 *         codec.tid = tid
 *         codec.name = 'MultiRange'             # <<<<<<<<<<<<<<
 *         codec.sub_codec = sub_codec
 * 
 */
  __Pyx_INCREF(__pyx_n_u_MultiRange);
  __Pyx_GIVEREF(__pyx_n_u_MultiRange);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.name);
  __pyx_v_codec->__pyx_base.name = __pyx_n_u_MultiRange;

  /* "gel/protocol/codecs/range.pyx":173
 *         codec.tid = tid
 *         codec.name = 'MultiRange'
 *         codec.sub_codec = sub_codec             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __Pyx_INCREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_GOTREF((PyObject *)__pyx_v_codec->sub_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_codec->sub_codec);
  __pyx_v_codec->sub_codec = __pyx_v_sub_codec;

  /* "gel/protocol/codecs/range.pyx":175
 *         codec.sub_codec = sub_codec
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":165
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             MultiRangeCodec codec
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":177
 *         return codec
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_elem_data = 0;
  Py_ssize_t __pyx_v_objlen;
  Py_ssize_t __pyx_v_elem_data_len;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  char const *__pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/range.pyx":183
 *             Py_ssize_t elem_data_len
 * 
 *         if not isinstance(self.sub_codec, ScalarCodec):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 f'only scalar multiranges are supported (got type '
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->sub_codec);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec); 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/range.pyx":185
 *         if not isinstance(self.sub_codec, ScalarCodec):
 *             raise TypeError(
 *                 f'only scalar multiranges are supported (got type '             # <<<<<<<<<<<<<<
 *                 f'{type(self.sub_codec).__name__!r})'
 *             )
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_only_scalar_multiranges_are_supp);
    __pyx_t_4 += 48;
    __Pyx_GIVEREF(__pyx_kp_u_only_scalar_multiranges_are_supp);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_only_scalar_multiranges_are_supp);

    /* "gel/protocol/codecs/range.pyx":186
 *             raise TypeError(
 *                 f'only scalar multiranges are supported (got type '
 *                 f'{type(self.sub_codec).__name__!r})'             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self->sub_codec))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_6), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__9);

    /* "gel/protocol/codecs/range.pyx":185
 *         if not isinstance(self.sub_codec, ScalarCodec):
 *             raise TypeError(
 *                 f'only scalar multiranges are supported (got type '             # <<<<<<<<<<<<<<
 *                 f'{type(self.sub_codec).__name__!r})'
 *             )
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/range.pyx":184
 * 
 *         if not isinstance(self.sub_codec, ScalarCodec):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 f'only scalar multiranges are supported (got type '
 *                 f'{type(self.sub_codec).__name__!r})'
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 184, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 184, __pyx_L1_error)

    /* "gel/protocol/codecs/range.pyx":183
 *             Py_ssize_t elem_data_len
 * 
 *         if not isinstance(self.sub_codec, ScalarCodec):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 f'only scalar multiranges are supported (got type '
 */
  }

  /* "gel/protocol/codecs/range.pyx":189
 *             )
 * 
 *         if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 f'a sized iterable container expected (got type '
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(6, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (!__pyx_t_3);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/range.pyx":191
 *         if not _is_array_iterable(obj):
 *             raise TypeError(
 *                 f'a sized iterable container expected (got type '             # <<<<<<<<<<<<<<
 *                 f'{type(obj).__name__!r})'
 *             )
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_a_sized_iterable_container_expec_2);
    __pyx_t_4 += 46;
    __Pyx_GIVEREF(__pyx_kp_u_a_sized_iterable_container_expec_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_a_sized_iterable_container_expec_2);

    /* "gel/protocol/codecs/range.pyx":192
 *             raise TypeError(
 *                 f'a sized iterable container expected (got type '
 *                 f'{type(obj).__name__!r})'             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_7), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_INCREF(__pyx_kp_u__9);
    __pyx_t_4 += 1;
    __Pyx_GIVEREF(__pyx_kp_u__9);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__9);

    /* "gel/protocol/codecs/range.pyx":191
 *         if not _is_array_iterable(obj):
 *             raise TypeError(
 *                 f'a sized iterable container expected (got type '             # <<<<<<<<<<<<<<
 *                 f'{type(obj).__name__!r})'
 *             )
 */
    __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/range.pyx":190
 * 
 *         if not _is_array_iterable(obj):
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 f'a sized iterable container expected (got type '
 *                 f'{type(obj).__name__!r})'
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 190, __pyx_L1_error)

    /* "gel/protocol/codecs/range.pyx":189
 *             )
 * 
 *         if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *             raise TypeError(
 *                 f'a sized iterable container expected (got type '
 */
  }

  /* "gel/protocol/codecs/range.pyx":195
 *             )
 * 
 *         objlen = len(obj)             # <<<<<<<<<<<<<<
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements in multirange value')
 */
  __pyx_t_4 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(6, 195, __pyx_L1_error)
  __pyx_v_objlen = __pyx_t_4;

  /* "gel/protocol/codecs/range.pyx":196
 * 
 *         objlen = len(obj)
 *         if objlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements in multirange value')
 * 
 */
  __pyx_t_2 = (__pyx_v_objlen > 0x7FFFFFFF);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/range.pyx":197
 *         objlen = len(obj)
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements in multirange value')             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 197, __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(6, 197, __pyx_L1_error)

    /* "gel/protocol/codecs/range.pyx":196
 * 
 *         objlen = len(obj)
 *         if objlen > _MAXINT32:             # <<<<<<<<<<<<<<
 *             raise ValueError('too many elements in multirange value')
 * 
 */
  }

  /* "gel/protocol/codecs/range.pyx":199
 *             raise ValueError('too many elements in multirange value')
 * 
 *         elem_data = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         for item in obj:
 *             try:
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_elem_data = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":200
 * 
 *         elem_data = WriteBuffer.new()
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             try:
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)
 */
  if (likely(PyList_CheckExact(__pyx_v_obj)) || PyTuple_CheckExact(__pyx_v_obj)) {
    __pyx_t_1 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 200, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 200, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(6, 200, __pyx_L1_error)
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 200, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(6, 200, __pyx_L1_error)
          #endif
          if (__pyx_t_4 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(6, 200, __pyx_L1_error)
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 200, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_6)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(6, 200, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "gel/protocol/codecs/range.pyx":201
 *         elem_data = WriteBuffer.new()
 *         for item in obj:
 *             try:             # <<<<<<<<<<<<<<
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)
 *             except TypeError as e:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      /*try:*/ {

        /* "gel/protocol/codecs/range.pyx":202
 *         for item in obj:
 *             try:
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)             # <<<<<<<<<<<<<<
 *             except TypeError as e:
 *                 raise ValueError(
 */
        __pyx_t_6 = ((PyObject *)__pyx_v_self->sub_codec);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_t_7 = __pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode_range(__pyx_v_elem_data, __pyx_v_item, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 202, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "gel/protocol/codecs/range.pyx":201
 *         elem_data = WriteBuffer.new()
 *         for item in obj:
 *             try:             # <<<<<<<<<<<<<<
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)
 *             except TypeError as e:
 */
      }
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "gel/protocol/codecs/range.pyx":203
 *             try:
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)
 *             except TypeError as e:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     f'invalid multirange element: {e.args[0]}') from None
 */
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
      if (__pyx_t_12) {
        __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_13) < 0) __PYX_ERR(6, 203, __pyx_L10_except_error)
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_6);
        __pyx_v_e = __pyx_t_6;
        /*try:*/ {

          /* "gel/protocol/codecs/range.pyx":205
 *             except TypeError as e:
 *                 raise ValueError(
 *                     f'invalid multirange element: {e.args[0]}') from None             # <<<<<<<<<<<<<<
 * 
 *         elem_data_len = elem_data.len()
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_e, __pyx_n_s_args); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 205, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 205, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_15, __pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 205, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
          __pyx_t_15 = __Pyx_PyUnicode_Concat(__pyx_kp_u_invalid_multirange_element, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 205, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_15);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

          /* "gel/protocol/codecs/range.pyx":204
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)
 *             except TypeError as e:
 *                 raise ValueError(             # <<<<<<<<<<<<<<
 *                     f'invalid multirange element: {e.args[0]}') from None
 * 
 */
          __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(6, 204, __pyx_L21_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

          /* "gel/protocol/codecs/range.pyx":205
 *             except TypeError as e:
 *                 raise ValueError(
 *                     f'invalid multirange element: {e.args[0]}') from None             # <<<<<<<<<<<<<<
 * 
 *         elem_data_len = elem_data.len()
 */
          __Pyx_Raise(__pyx_t_14, 0, 0, Py_None);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __PYX_ERR(6, 204, __pyx_L21_error)
        }

        /* "gel/protocol/codecs/range.pyx":203
 *             try:
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)
 *             except TypeError as e:             # <<<<<<<<<<<<<<
 *                 raise ValueError(
 *                     f'invalid multirange element: {e.args[0]}') from None
 */
        /*finally:*/ {
          __pyx_L21_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_23);
            __pyx_t_12 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
            {
              __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_21);
              __Pyx_XGIVEREF(__pyx_t_22);
              __Pyx_XGIVEREF(__pyx_t_23);
              __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
            }
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
            __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
            __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
            goto __pyx_L10_except_error;
          }
        }
      }
      goto __pyx_L10_except_error;

      /* "gel/protocol/codecs/range.pyx":201
 *         elem_data = WriteBuffer.new()
 *         for item in obj:
 *             try:             # <<<<<<<<<<<<<<
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)
 *             except TypeError as e:
 */
      __pyx_L10_except_error:;
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      goto __pyx_L1_error;
      __pyx_L15_try_end:;
    }

    /* "gel/protocol/codecs/range.pyx":200
 * 
 *         elem_data = WriteBuffer.new()
 *         for item in obj:             # <<<<<<<<<<<<<<
 *             try:
 *                 RangeCodec.encode_range(elem_data, item, self.sub_codec)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":207
 *                     f'invalid multirange element: {e.args[0]}') from None
 * 
 *         elem_data_len = elem_data.len()             # <<<<<<<<<<<<<<
 *         if elem_data_len > _MAXINT32 - 4:
 *             raise OverflowError(
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_len(__pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_elem_data_len = __pyx_t_4;

  /* "gel/protocol/codecs/range.pyx":208
 * 
 *         elem_data_len = elem_data.len()
 *         if elem_data_len > _MAXINT32 - 4:             # <<<<<<<<<<<<<<
 *             raise OverflowError(
 *                 f'size of encoded multirange datum exceeds the maximum '
 */
  __pyx_t_2 = (__pyx_v_elem_data_len > 0x7ffffffb);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/range.pyx":210
 *         if elem_data_len > _MAXINT32 - 4:
 *             raise OverflowError(
 *                 f'size of encoded multirange datum exceeds the maximum '             # <<<<<<<<<<<<<<
 *                 f'allowed {_MAXINT32 - 4} bytes')
 * 
 */
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_size_of_encoded_multirange_datum);
    __pyx_t_4 += 61;
    __Pyx_GIVEREF(__pyx_kp_u_size_of_encoded_multirange_datum);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_size_of_encoded_multirange_datum);

    /* "gel/protocol/codecs/range.pyx":211
 *             raise OverflowError(
 *                 f'size of encoded multirange datum exceeds the maximum '
 *                 f'allowed {_MAXINT32 - 4} bytes')             # <<<<<<<<<<<<<<
 * 
 *         # Datum length
 */
    __pyx_t_13 = __Pyx_PyUnicode_From_long(0x7ffffffb, 0, ' ', 'd'); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_13);
    __pyx_t_13 = 0;
    __Pyx_INCREF(__pyx_kp_u_bytes_2);
    __pyx_t_4 += 6;
    __Pyx_GIVEREF(__pyx_kp_u_bytes_2);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_bytes_2);

    /* "gel/protocol/codecs/range.pyx":210
 *         if elem_data_len > _MAXINT32 - 4:
 *             raise OverflowError(
 *                 f'size of encoded multirange datum exceeds the maximum '             # <<<<<<<<<<<<<<
 *                 f'allowed {_MAXINT32 - 4} bytes')
 * 
 */
    __pyx_t_13 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(6, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/range.pyx":209
 *         elem_data_len = elem_data.len()
 *         if elem_data_len > _MAXINT32 - 4:
 *             raise OverflowError(             # <<<<<<<<<<<<<<
 *                 f'size of encoded multirange datum exceeds the maximum '
 *                 f'allowed {_MAXINT32 - 4} bytes')
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_OverflowError, __pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(6, 209, __pyx_L1_error)

    /* "gel/protocol/codecs/range.pyx":208
 * 
 *         elem_data_len = elem_data.len()
 *         if elem_data_len > _MAXINT32 - 4:             # <<<<<<<<<<<<<<
 *             raise OverflowError(
 *                 f'size of encoded multirange datum exceeds the maximum '
 */
  }

  /* "gel/protocol/codecs/range.pyx":214
 * 
 *         # Datum length
 *         buf.write_int32(4 + <int32_t>elem_data_len)             # <<<<<<<<<<<<<<
 *         # Number of elements in multirange
 *         buf.write_int32(<int32_t>objlen)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (4 + ((int32_t)__pyx_v_elem_data_len))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":216
 *         buf.write_int32(4 + <int32_t>elem_data_len)
 *         # Number of elements in multirange
 *         buf.write_int32(<int32_t>objlen)             # <<<<<<<<<<<<<<
 *         buf.write_buffer(elem_data)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, ((int32_t)__pyx_v_objlen)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":217
 *         # Number of elements in multirange
 *         buf.write_int32(<int32_t>objlen)
 *         buf.write_buffer(elem_data)             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_v_buf, __pyx_v_elem_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":177
 *         return codec
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer elem_data
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_data);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":219
 *         buf.write_buffer(elem_data)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  Py_ssize_t __pyx_v_elem_count;
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/range.pyx":222
 *         cdef:
 *             Py_ssize_t elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(
 *                 frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             object result
 *             Py_ssize_t i
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 222, __pyx_L1_error)

  /* "gel/protocol/codecs/range.pyx":221
 *     cdef decode(self, FRBuffer *buf):
 *         cdef:
 *             Py_ssize_t elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(             # <<<<<<<<<<<<<<
 *                 frb_read(buf, 4))
 *             object result
 */
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1)));

  /* "gel/protocol/codecs/range.pyx":228
 *             FRBuffer elem_buf
 * 
 *         result = cpython.PyList_New(elem_count)             # <<<<<<<<<<<<<<
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_2 = PyList_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/range.pyx":229
 * 
 *         result = cpython.PyList_New(elem_count)
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 */
  __pyx_t_3 = __pyx_v_elem_count;
  __pyx_t_4 = __pyx_t_3;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "gel/protocol/codecs/range.pyx":230
 *         result = cpython.PyList_New(elem_count)
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             if elem_len == -1:
 *                 raise RuntimeError(
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(6, 230, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_1);

    /* "gel/protocol/codecs/range.pyx":231
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     'unexpected NULL element in multirange value')
 */
    __pyx_t_6 = (__pyx_v_elem_len == -1L);
    if (unlikely(__pyx_t_6)) {

      /* "gel/protocol/codecs/range.pyx":232
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     'unexpected NULL element in multirange value')
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 232, __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(6, 232, __pyx_L1_error)

      /* "gel/protocol/codecs/range.pyx":231
 *         for i in range(elem_count):
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     'unexpected NULL element in multirange value')
 */
    }

    /* "gel/protocol/codecs/range.pyx":235
 *                     'unexpected NULL element in multirange value')
 *             else:
 *                 frb_slice_from(&elem_buf, buf, elem_len)             # <<<<<<<<<<<<<<
 *                 elem = RangeCodec.decode_range(&elem_buf, self.sub_codec)
 *                 if frb_get_len(&elem_buf):
 */
    /*else*/ {
      __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_7 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(6, 235, __pyx_L1_error)

      /* "gel/protocol/codecs/range.pyx":236
 *             else:
 *                 frb_slice_from(&elem_buf, buf, elem_len)
 *                 elem = RangeCodec.decode_range(&elem_buf, self.sub_codec)             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 */
      __pyx_t_2 = ((PyObject *)__pyx_v_self->sub_codec);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_8 = __pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode_range((&__pyx_v_elem_buf), ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2)); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "gel/protocol/codecs/range.pyx":237
 *                 frb_slice_from(&elem_buf, buf, elem_len)
 *                 elem = RangeCodec.decode_range(&elem_buf, self.sub_codec)
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 237, __pyx_L1_error)
      __pyx_t_6 = (__pyx_t_9 != 0);
      if (unlikely(__pyx_t_6)) {

        /* "gel/protocol/codecs/range.pyx":241
 *                         f'unexpected trailing data in buffer after '
 *                         f'multirange element decoding: '
 *                         f'{frb_get_len(&elem_buf)}')             # <<<<<<<<<<<<<<
 * 
 *             cpython.Py_INCREF(elem)
 */
        __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 241, __pyx_L1_error)
        __pyx_t_8 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_9, 0, ' ', 'd'); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 241, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);

        /* "gel/protocol/codecs/range.pyx":239
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                         f'multirange element decoding: '
 *                         f'{frb_get_len(&elem_buf)}')
 */
        __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_6, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 239, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "gel/protocol/codecs/range.pyx":238
 *                 elem = RangeCodec.decode_range(&elem_buf, self.sub_codec)
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in buffer after '
 *                         f'multirange element decoding: '
 */
        __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_8, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __PYX_ERR(6, 238, __pyx_L1_error)

        /* "gel/protocol/codecs/range.pyx":237
 *                 frb_slice_from(&elem_buf, buf, elem_len)
 *                 elem = RangeCodec.decode_range(&elem_buf, self.sub_codec)
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      }
    }

    /* "gel/protocol/codecs/range.pyx":243
 *                         f'{frb_get_len(&elem_buf)}')
 * 
 *             cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *             cpython.PyList_SET_ITEM(result, i, elem)
 * 
 */
    Py_INCREF(__pyx_v_elem);

    /* "gel/protocol/codecs/range.pyx":244
 * 
 *             cpython.Py_INCREF(elem)
 *             cpython.PyList_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *         return range_mod.MultiRange(result)
 */
    PyList_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
  }

  /* "gel/protocol/codecs/range.pyx":246
 *             cpython.PyList_SET_ITEM(result, i, elem)
 * 
 *         return range_mod.MultiRange(result)             # <<<<<<<<<<<<<<
 * 
 *     cdef dump(self, int level = 0):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range_mod); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MultiRange); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_result};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":219
 *         buf.write_buffer(elem_data)
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             Py_ssize_t elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":248
 *         return range_mod.MultiRange(result)
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_dump(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, struct __pyx_opt_args_3gel_8protocol_8protocol_15MultiRangeCodec_dump *__pyx_optional_args) {
  int __pyx_v_level = ((int)0);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_UCS4 __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 1);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_level = __pyx_optional_args->level;
    }
  }

  /* "gel/protocol/codecs/range.pyx":249
 * 
 *     cdef dump(self, int level = 0):
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 127;
  __pyx_t_4 = __Pyx_PySequence_Multiply_Left(__pyx_v_level, __pyx_kp_u__13); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyUnicode_Unicode(__pyx_v_self->__pyx_base.name); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_kp_u__19);
  __pyx_t_2 += 1;
  __Pyx_GIVEREF(__pyx_kp_u__19);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__19);
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.level = (__pyx_v_level + 1);
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self->sub_codec->__pyx_vtab)->dump(__pyx_v_self->sub_codec, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_3;
  __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":248
 *         return range_mod.MultiRange(result)
 * 
 *     cdef dump(self, int level = 0):             # <<<<<<<<<<<<<<
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/range.pyx":251
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.MultiRangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15MultiRangeCodec_3make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_3make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(6, 251, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(6, 251, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(6, 251, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_2make_type(((struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_2make_type(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/range.pyx":252
 * 
 *     def make_type(self, describe_context):
 *         return describe.MultiRangeType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_MultiRangeType); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/range.pyx":253
 *     def make_type(self, describe_context):
 *         return describe.MultiRangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=self.type_name,
 *             value_type=self.sub_codec.make_type(describe_context),
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.tid) < 0) __PYX_ERR(6, 253, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(6, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/range.pyx":254
 *         return describe.MultiRangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,             # <<<<<<<<<<<<<<
 *             value_type=self.sub_codec.make_type(describe_context),
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->__pyx_base.type_name) < 0) __PYX_ERR(6, 253, __pyx_L1_error)

  /* "gel/protocol/codecs/range.pyx":255
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 *             value_type=self.sub_codec.make_type(describe_context),             # <<<<<<<<<<<<<<
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->sub_codec), __pyx_n_s_make_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_describe_context};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value_type, __pyx_t_5) < 0) __PYX_ERR(6, 253, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/range.pyx":252
 * 
 *     def make_type(self, describe_context):
 *         return describe.MultiRangeType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/range.pyx":251
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.MultiRangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15MultiRangeCodec_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_5__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_4__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_15MultiRangeCodec_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_7__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_6__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_15MultiRangeCodec_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.MultiRangeCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/set.pyx":24
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SetCodec codec
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_8SetCodec_new(PyObject *__pyx_v_tid, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec) {
  struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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("new", 1);

  /* "gel/protocol/codecs/set.pyx":28
 *             SetCodec codec
 * 
 *         codec = SetCodec.__new__(SetCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_SetCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_SetCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 28, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/set.pyx":30
 *         codec = SetCodec.__new__(SetCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = 'Set'
 *         codec.sub_codec = sub_codec
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.tid);
  __pyx_v_codec->__pyx_base.__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/set.pyx":31
 * 
 *         codec.tid = tid
 *         codec.name = 'Set'             # <<<<<<<<<<<<<<
 *         codec.sub_codec = sub_codec
 * 
 */
  __Pyx_INCREF(__pyx_n_u_Set);
  __Pyx_GIVEREF(__pyx_n_u_Set);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.name);
  __pyx_v_codec->__pyx_base.__pyx_base.name = __pyx_n_u_Set;

  /* "gel/protocol/codecs/set.pyx":32
 *         codec.tid = tid
 *         codec.name = 'Set'
 *         codec.sub_codec = sub_codec             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __Pyx_INCREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_GOTREF((PyObject *)__pyx_v_codec->__pyx_base.sub_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_codec->__pyx_base.sub_codec);
  __pyx_v_codec->__pyx_base.sub_codec = __pyx_v_sub_codec;

  /* "gel/protocol/codecs/set.pyx":34
 *         codec.sub_codec = sub_codec
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/set.pyx":24
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, BaseCodec sub_codec):             # <<<<<<<<<<<<<<
 *         cdef:
 *             SetCodec codec
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SetCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/set.pyx":36
 *         return codec
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         if type(self.sub_codec) is ArrayCodec:
 *             # This is a set of arrays encoded as an array
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_8SetCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/set.pyx":37
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         if type(self.sub_codec) is ArrayCodec:             # <<<<<<<<<<<<<<
 *             # This is a set of arrays encoded as an array
 *             # of single-element records.
 */
  __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self->__pyx_base.sub_codec))) == ((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec));
  if (__pyx_t_1) {

    /* "gel/protocol/codecs/set.pyx":40
 *             # This is a set of arrays encoded as an array
 *             # of single-element records.
 *             return self._decode_array_set(buf)             # <<<<<<<<<<<<<<
 *         else:
 *             # Set of non-arrays.
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol_8SetCodec__decode_array_set(__pyx_v_self, __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "gel/protocol/codecs/set.pyx":37
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         if type(self.sub_codec) is ArrayCodec:             # <<<<<<<<<<<<<<
 *             # This is a set of arrays encoded as an array
 *             # of single-element records.
 */
  }

  /* "gel/protocol/codecs/set.pyx":43
 *         else:
 *             # Set of non-arrays.
 *             return self._decode_array(buf)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline _decode_array_set(self, FRBuffer *buf):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SetCodec *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._decode_array(((struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *)__pyx_v_self), __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 43, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "gel/protocol/codecs/set.pyx":36
 *         return codec
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         if type(self.sub_codec) is ArrayCodec:
 *             # This is a set of arrays encoded as an array
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.SetCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/set.pyx":45
 *             return self._decode_array(buf)
 * 
 *     cdef inline _decode_array_set(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_8SetCodec__decode_array_set(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_elem = 0;
  Py_ssize_t __pyx_v_elem_count;
  Py_ssize_t __pyx_v_recsize;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  int32_t __pyx_v_ndims;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec = 0;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_decode_array_set", 1);

  /* "gel/protocol/codecs/set.pyx":53
 *             Py_ssize_t i
 *             int32_t elem_len
 *             int32_t ndims = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             BaseCodec sub_codec = <BaseCodec>self.sub_codec
 *             FRBuffer elem_buf
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 53, __pyx_L1_error)
  __pyx_v_ndims = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/set.pyx":54
 *             int32_t elem_len
 *             int32_t ndims = hton.unpack_int32(frb_read(buf, 4))
 *             BaseCodec sub_codec = <BaseCodec>self.sub_codec             # <<<<<<<<<<<<<<
 *             FRBuffer elem_buf
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.sub_codec);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/set.pyx":57
 *             FRBuffer elem_buf
 * 
 *         frb_read(buf, 4)  # ignore flags             # <<<<<<<<<<<<<<
 *         frb_read(buf, 4)  # ignore reserved
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 57, __pyx_L1_error)

  /* "gel/protocol/codecs/set.pyx":58
 * 
 *         frb_read(buf, 4)  # ignore flags
 *         frb_read(buf, 4)  # ignore reserved             # <<<<<<<<<<<<<<
 * 
 *         if ndims == 0:
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 58, __pyx_L1_error)

  /* "gel/protocol/codecs/set.pyx":60
 *         frb_read(buf, 4)  # ignore reserved
 * 
 *         if ndims == 0:             # <<<<<<<<<<<<<<
 *             # Special case for an empty set.
 *             return []
 */
  __pyx_t_3 = (__pyx_v_ndims == 0);
  if (__pyx_t_3) {

    /* "gel/protocol/codecs/set.pyx":62
 *         if ndims == 0:
 *             # Special case for an empty set.
 *             return []             # <<<<<<<<<<<<<<
 *         elif ndims > 1:
 *             raise RuntimeError('expected a two-dimensional array for a '
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "gel/protocol/codecs/set.pyx":60
 *         frb_read(buf, 4)  # ignore reserved
 * 
 *         if ndims == 0:             # <<<<<<<<<<<<<<
 *             # Special case for an empty set.
 *             return []
 */
  }

  /* "gel/protocol/codecs/set.pyx":63
 *             # Special case for an empty set.
 *             return []
 *         elif ndims > 1:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('expected a two-dimensional array for a '
 *                                'set of arrays')
 */
  __pyx_t_3 = (__pyx_v_ndims > 1);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/set.pyx":64
 *             return []
 *         elif ndims > 1:
 *             raise RuntimeError('expected a two-dimensional array for a '             # <<<<<<<<<<<<<<
 *                                'set of arrays')
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 64, __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(15, 64, __pyx_L1_error)

    /* "gel/protocol/codecs/set.pyx":63
 *             # Special case for an empty set.
 *             return []
 *         elif ndims > 1:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('expected a two-dimensional array for a '
 *                                'set of arrays')
 */
  }

  /* "gel/protocol/codecs/set.pyx":67
 *                                'set of arrays')
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *         frb_read(buf, 4)  # Ignore the lower bound information
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 67, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1)));

  /* "gel/protocol/codecs/set.pyx":68
 * 
 *         elem_count = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *         frb_read(buf, 4)  # Ignore the lower bound information             # <<<<<<<<<<<<<<
 * 
 *         result = cpython.PyList_New(elem_count)
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 68, __pyx_L1_error)

  /* "gel/protocol/codecs/set.pyx":70
 *         frb_read(buf, 4)  # Ignore the lower bound information
 * 
 *         result = cpython.PyList_New(elem_count)             # <<<<<<<<<<<<<<
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # ignore array element size
 */
  __pyx_t_2 = PyList_New(__pyx_v_elem_count); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/set.pyx":71
 * 
 *         result = cpython.PyList_New(elem_count)
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             frb_read(buf, 4)  # ignore array element size
 * 
 */
  __pyx_t_4 = __pyx_v_elem_count;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "gel/protocol/codecs/set.pyx":72
 *         result = cpython.PyList_New(elem_count)
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # ignore array element size             # <<<<<<<<<<<<<<
 * 
 *             recsize = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 72, __pyx_L1_error)

    /* "gel/protocol/codecs/set.pyx":74
 *             frb_read(buf, 4)  # ignore array element size
 * 
 *             recsize = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             if recsize != 1:
 *                 raise RuntimeError(
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 74, __pyx_L1_error)
    __pyx_v_recsize = ((Py_ssize_t)((uint32_t)unpack_int32(__pyx_t_1)));

    /* "gel/protocol/codecs/set.pyx":75
 * 
 *             recsize = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *             if recsize != 1:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     'expected a record with a single element as an array set '
 */
    __pyx_t_3 = (__pyx_v_recsize != 1);
    if (unlikely(__pyx_t_3)) {

      /* "gel/protocol/codecs/set.pyx":76
 *             recsize = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *             if recsize != 1:
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     'expected a record with a single element as an array set '
 *                     'element envelope')
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 76, __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(15, 76, __pyx_L1_error)

      /* "gel/protocol/codecs/set.pyx":75
 * 
 *             recsize = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *             if recsize != 1:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     'expected a record with a single element as an array set '
 */
    }

    /* "gel/protocol/codecs/set.pyx":80
 *                     'element envelope')
 * 
 *             frb_read(buf, 4)  # reserved             # <<<<<<<<<<<<<<
 * 
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 80, __pyx_L1_error)

    /* "gel/protocol/codecs/set.pyx":82
 *             frb_read(buf, 4)  # reserved
 * 
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *             if elem_len == -1:
 *                 raise RuntimeError(
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(15, 82, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_1);

    /* "gel/protocol/codecs/set.pyx":83
 * 
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     'unexpected NULL value in array set element ')
 */
    __pyx_t_3 = (__pyx_v_elem_len == -1L);
    if (unlikely(__pyx_t_3)) {

      /* "gel/protocol/codecs/set.pyx":84
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     'unexpected NULL value in array set element ')
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 84, __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(15, 84, __pyx_L1_error)

      /* "gel/protocol/codecs/set.pyx":83
 * 
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     'unexpected NULL value in array set element ')
 */
    }

    /* "gel/protocol/codecs/set.pyx":87
 *                     'unexpected NULL value in array set element ')
 * 
 *             frb_slice_from(&elem_buf, buf, elem_len)             # <<<<<<<<<<<<<<
 *             elem = sub_codec.decode(&elem_buf)
 *             if frb_get_len(&elem_buf):
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_7 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(15, 87, __pyx_L1_error)

    /* "gel/protocol/codecs/set.pyx":88
 * 
 *             frb_slice_from(&elem_buf, buf, elem_len)
 *             elem = sub_codec.decode(&elem_buf)             # <<<<<<<<<<<<<<
 *             if frb_get_len(&elem_buf):
 *                 raise RuntimeError(
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_sub_codec->__pyx_vtab)->decode(__pyx_v_sub_codec, (&__pyx_v_elem_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "gel/protocol/codecs/set.pyx":89
 *             frb_slice_from(&elem_buf, buf, elem_len)
 *             elem = sub_codec.decode(&elem_buf)
 *             if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     f'unexpected trailing data in buffer after '
 */
    __pyx_t_8 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(15, 89, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_8 != 0);
    if (unlikely(__pyx_t_3)) {

      /* "gel/protocol/codecs/set.pyx":92
 *                 raise RuntimeError(
 *                     f'unexpected trailing data in buffer after '
 *                     f'set element decoding: {frb_get_len(&elem_buf)}')             # <<<<<<<<<<<<<<
 *             cpython.Py_INCREF(elem)
 *             cpython.PyList_SET_ITEM(result, i, elem)
 */
      __pyx_t_8 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(15, 92, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_8, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 92, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);

      /* "gel/protocol/codecs/set.pyx":91
 *             if frb_get_len(&elem_buf):
 *                 raise RuntimeError(
 *                     f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                     f'set element decoding: {frb_get_len(&elem_buf)}')
 *             cpython.Py_INCREF(elem)
 */
      __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_7, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(15, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "gel/protocol/codecs/set.pyx":90
 *             elem = sub_codec.decode(&elem_buf)
 *             if frb_get_len(&elem_buf):
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     f'unexpected trailing data in buffer after '
 *                     f'set element decoding: {frb_get_len(&elem_buf)}')
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 90, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(15, 90, __pyx_L1_error)

      /* "gel/protocol/codecs/set.pyx":89
 *             frb_slice_from(&elem_buf, buf, elem_len)
 *             elem = sub_codec.decode(&elem_buf)
 *             if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     f'unexpected trailing data in buffer after '
 */
    }

    /* "gel/protocol/codecs/set.pyx":93
 *                     f'unexpected trailing data in buffer after '
 *                     f'set element decoding: {frb_get_len(&elem_buf)}')
 *             cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *             cpython.PyList_SET_ITEM(result, i, elem)
 * 
 */
    Py_INCREF(__pyx_v_elem);

    /* "gel/protocol/codecs/set.pyx":94
 *                     f'set element decoding: {frb_get_len(&elem_buf)}')
 *             cpython.Py_INCREF(elem)
 *             cpython.PyList_SET_ITEM(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    PyList_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_elem);
  }

  /* "gel/protocol/codecs/set.pyx":96
 *             cpython.PyList_SET_ITEM(result, i, elem)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/protocol/codecs/set.pyx":45
 *             return self._decode_array(buf)
 * 
 *     cdef inline _decode_array_set(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("gel.protocol.protocol.SetCodec._decode_array_set", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XDECREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/set.pyx":98
 *         return result
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_8SetCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_8SetCodec_1make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_8SetCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_8SetCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(15, 98, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(15, 98, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(15, 98, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SetCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_8SetCodec_make_type(((struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_8SetCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self, PyObject *__pyx_v_describe_context) {
  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;
  unsigned int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/set.pyx":99
 * 
 *     def make_type(self, describe_context):
 *         return describe.ArrayType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ArrayType); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/set.pyx":100
 *     def make_type(self, describe_context):
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=None,
 *             element_type=self.sub_codec.make_type(describe_context),
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(15, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.__pyx_base.tid) < 0) __PYX_ERR(15, 100, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(15, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/set.pyx":101
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,             # <<<<<<<<<<<<<<
 *             element_type=self.sub_codec.make_type(describe_context),
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, Py_None) < 0) __PYX_ERR(15, 100, __pyx_L1_error)

  /* "gel/protocol/codecs/set.pyx":102
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 *             element_type=self.sub_codec.make_type(describe_context),             # <<<<<<<<<<<<<<
 *         )
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.sub_codec), __pyx_n_s_make_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(15, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_describe_context};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_element_type, __pyx_t_5) < 0) __PYX_ERR(15, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/set.pyx":99
 * 
 *     def make_type(self, describe_context):
 *         return describe.ArrayType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=None,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(15, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/set.pyx":98
 *         return result
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.SetCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_8SetCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_8SetCodec_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_8SetCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_8SetCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_8SetCodec_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_8SetCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SetCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_8SetCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_8SetCodec_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_8SetCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_8SetCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SetCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_8SetCodec_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_8SetCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SetCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/enum.pyx":25
 * cdef class EnumCodec(BaseCodec):
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, (self.cls, str)):
 *             try:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_9EnumCodec_encode(struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  Py_ssize_t __pyx_t_12;
  Py_UCS4 __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "gel/protocol/codecs/enum.pyx":26
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         if not isinstance(obj, (self.cls, str)):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = self.cls._try_from(obj)
 */
  __Pyx_INCREF(__pyx_v_self->cls);
  __pyx_t_1 = __pyx_v_self->cls;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); 
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyUnicode_Check(__pyx_v_obj); 
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (__pyx_t_3) {

    /* "gel/protocol/codecs/enum.pyx":27
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         if not isinstance(obj, (self.cls, str)):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = self.cls._try_from(obj)
 *             except (TypeError, ValueError):
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "gel/protocol/codecs/enum.pyx":28
 *         if not isinstance(obj, (self.cls, str)):
 *             try:
 *                 obj = self.cls._try_from(obj)             # <<<<<<<<<<<<<<
 *             except (TypeError, ValueError):
 *                 raise TypeError(
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cls, __pyx_n_s_try_from); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 28, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = NULL;
        __pyx_t_9 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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_9 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_obj};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 28, __pyx_L6_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "gel/protocol/codecs/enum.pyx":27
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         if not isinstance(obj, (self.cls, str)):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = self.cls._try_from(obj)
 *             except (TypeError, ValueError):
 */
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L11_try_end;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "gel/protocol/codecs/enum.pyx":29
 *             try:
 *                 obj = self.cls._try_from(obj)
 *             except (TypeError, ValueError):             # <<<<<<<<<<<<<<
 *                 raise TypeError(
 *                     f'a str or gel.EnumValue(__tid__={self.cls.__tid__}) '
 */
      __pyx_t_10 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_ValueError);
      if (__pyx_t_10) {
        __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(16, 29, __pyx_L8_except_error)
        __Pyx_XGOTREF(__pyx_t_1);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);

        /* "gel/protocol/codecs/enum.pyx":31
 *             except (TypeError, ValueError):
 *                 raise TypeError(
 *                     f'a str or gel.EnumValue(__tid__={self.cls.__tid__}) '             # <<<<<<<<<<<<<<
 *                     f'is expected as a valid enum argument, '
 *                     f'got {type(obj).__name__}') from None
 */
        __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(16, 31, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = 0;
        __pyx_t_13 = 127;
        __Pyx_INCREF(__pyx_kp_u_a_str_or_gel_EnumValue___tid);
        __pyx_t_12 += 31;
        __Pyx_GIVEREF(__pyx_kp_u_a_str_or_gel_EnumValue___tid);
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_u_a_str_or_gel_EnumValue___tid);
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cls, __pyx_n_s_tid); if (unlikely(!__pyx_t_14)) __PYX_ERR(16, 31, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyObject_FormatSimple(__pyx_t_14, __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(16, 31, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_13;
        __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_15);
        PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_15);
        __pyx_t_15 = 0;
        __Pyx_INCREF(__pyx_kp_u_is_expected_as_a_valid_enum_arg);
        __pyx_t_12 += 44;
        __Pyx_GIVEREF(__pyx_kp_u_is_expected_as_a_valid_enum_arg);
        PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_kp_u_is_expected_as_a_valid_enum_arg);

        /* "gel/protocol/codecs/enum.pyx":33
 *                     f'a str or gel.EnumValue(__tid__={self.cls.__tid__}) '
 *                     f'is expected as a valid enum argument, '
 *                     f'got {type(obj).__name__}') from None             # <<<<<<<<<<<<<<
 *         pgproto.text_encode(DEFAULT_CODEC_CONTEXT, buf, str(obj))
 * 
 */
        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(16, 33, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_15, __pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(16, 33, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) : __pyx_t_13;
        __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "gel/protocol/codecs/enum.pyx":31
 *             except (TypeError, ValueError):
 *                 raise TypeError(
 *                     f'a str or gel.EnumValue(__tid__={self.cls.__tid__}) '             # <<<<<<<<<<<<<<
 *                     f'is expected as a valid enum argument, '
 *                     f'got {type(obj).__name__}') from None
 */
        __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_11, 4, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(16, 31, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "gel/protocol/codecs/enum.pyx":30
 *                 obj = self.cls._try_from(obj)
 *             except (TypeError, ValueError):
 *                 raise TypeError(             # <<<<<<<<<<<<<<
 *                     f'a str or gel.EnumValue(__tid__={self.cls.__tid__}) '
 *                     f'is expected as a valid enum argument, '
 */
        __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(16, 30, __pyx_L8_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "gel/protocol/codecs/enum.pyx":33
 *                     f'a str or gel.EnumValue(__tid__={self.cls.__tid__}) '
 *                     f'is expected as a valid enum argument, '
 *                     f'got {type(obj).__name__}') from None             # <<<<<<<<<<<<<<
 *         pgproto.text_encode(DEFAULT_CODEC_CONTEXT, buf, str(obj))
 * 
 */
        __Pyx_Raise(__pyx_t_11, 0, 0, Py_None);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __PYX_ERR(16, 30, __pyx_L8_except_error)
      }
      goto __pyx_L8_except_error;

      /* "gel/protocol/codecs/enum.pyx":27
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         if not isinstance(obj, (self.cls, str)):
 *             try:             # <<<<<<<<<<<<<<
 *                 obj = self.cls._try_from(obj)
 *             except (TypeError, ValueError):
 */
      __pyx_L8_except_error:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L11_try_end:;
    }

    /* "gel/protocol/codecs/enum.pyx":26
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         if not isinstance(obj, (self.cls, str)):             # <<<<<<<<<<<<<<
 *             try:
 *                 obj = self.cls._try_from(obj)
 */
  }

  /* "gel/protocol/codecs/enum.pyx":34
 *                     f'is expected as a valid enum argument, '
 *                     f'got {type(obj).__name__}') from None
 *         pgproto.text_encode(DEFAULT_CODEC_CONTEXT, buf, str(obj))             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __pyx_t_8 = ((PyObject *)__pyx_v_3gel_8protocol_8protocol_DEFAULT_CODEC_CONTEXT);
  __Pyx_INCREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_Unicode(__pyx_v_obj); if (unlikely(!__pyx_t_7)) __PYX_ERR(16, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_text_encode(((struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *)__pyx_t_8), __pyx_v_buf, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 34, __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(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":25
 * cdef class EnumCodec(BaseCodec):
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         if not isinstance(obj, (self.cls, str)):
 *             try:
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/enum.pyx":36
 *         pgproto.text_encode(DEFAULT_CODEC_CONTEXT, buf, str(obj))
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         label = pgproto.text_decode(DEFAULT_CODEC_CONTEXT, buf)
 *         return self.cls(label)
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_9EnumCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_label = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/enum.pyx":37
 * 
 *     cdef decode(self, FRBuffer *buf):
 *         label = pgproto.text_decode(DEFAULT_CODEC_CONTEXT, buf)             # <<<<<<<<<<<<<<
 *         return self.cls(label)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_3gel_8protocol_8protocol_DEFAULT_CODEC_CONTEXT);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_text_decode(((struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *)__pyx_t_1), __pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_label = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/enum.pyx":38
 *     cdef decode(self, FRBuffer *buf):
 *         label = pgproto.text_decode(DEFAULT_CODEC_CONTEXT, buf)
 *         return self.cls(label)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->cls);
  __pyx_t_1 = __pyx_v_self->cls; __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_label};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 38, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/enum.pyx":36
 *         pgproto.text_encode(DEFAULT_CODEC_CONTEXT, buf, str(obj))
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         label = pgproto.text_decode(DEFAULT_CODEC_CONTEXT, buf)
 *         return self.cls(label)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_label);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/enum.pyx":41
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple enum_labels):             # <<<<<<<<<<<<<<
 *         cdef:
 *             EnumCodec codec
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_9EnumCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_enum_labels) {
  struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_codec = 0;
  PyObject *__pyx_v_cls = NULL;
  PyObject *__pyx_v_bases = NULL;
  PyObject *__pyx_v_classdict = NULL;
  PyObject *__pyx_v_label = NULL;
  Py_ssize_t __pyx_v_index;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("new", 1);

  /* "gel/protocol/codecs/enum.pyx":45
 *             EnumCodec codec
 * 
 *         codec = EnumCodec.__new__(EnumCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_EnumCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_EnumCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 45, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":47
 *         codec = EnumCodec.__new__(EnumCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = 'Enum'
 *         cls = "DerivedEnumValue"
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.tid);
  __pyx_v_codec->__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/enum.pyx":48
 * 
 *         codec.tid = tid
 *         codec.name = 'Enum'             # <<<<<<<<<<<<<<
 *         cls = "DerivedEnumValue"
 *         bases = (datatypes.EnumValue,)
 */
  __Pyx_INCREF(__pyx_n_u_Enum);
  __Pyx_GIVEREF(__pyx_n_u_Enum);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.name);
  __pyx_v_codec->__pyx_base.name = __pyx_n_u_Enum;

  /* "gel/protocol/codecs/enum.pyx":49
 *         codec.tid = tid
 *         codec.name = 'Enum'
 *         cls = "DerivedEnumValue"             # <<<<<<<<<<<<<<
 *         bases = (datatypes.EnumValue,)
 *         classdict = enum.EnumMeta.__prepare__(cls, bases)
 */
  __Pyx_INCREF(__pyx_n_u_DerivedEnumValue);
  __pyx_v_cls = __pyx_n_u_DerivedEnumValue;

  /* "gel/protocol/codecs/enum.pyx":50
 *         codec.name = 'Enum'
 *         cls = "DerivedEnumValue"
 *         bases = (datatypes.EnumValue,)             # <<<<<<<<<<<<<<
 *         classdict = enum.EnumMeta.__prepare__(cls, bases)
 *         classdict["__module__"] = "gel"
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datatypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_EnumValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(16, 50, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_v_bases = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":51
 *         cls = "DerivedEnumValue"
 *         bases = (datatypes.EnumValue,)
 *         classdict = enum.EnumMeta.__prepare__(cls, bases)             # <<<<<<<<<<<<<<
 *         classdict["__module__"] = "gel"
 *         classdict["__qualname__"] = "gel.DerivedEnumValue"
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_EnumMeta); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 51, __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_prepare); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_cls, __pyx_v_bases};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_classdict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":52
 *         bases = (datatypes.EnumValue,)
 *         classdict = enum.EnumMeta.__prepare__(cls, bases)
 *         classdict["__module__"] = "gel"             # <<<<<<<<<<<<<<
 *         classdict["__qualname__"] = "gel.DerivedEnumValue"
 *         classdict["__tid__"] = pgproto.UUID(tid)
 */
  if (unlikely((PyObject_SetItem(__pyx_v_classdict, __pyx_n_u_module, __pyx_n_u_gel) < 0))) __PYX_ERR(16, 52, __pyx_L1_error)

  /* "gel/protocol/codecs/enum.pyx":53
 *         classdict = enum.EnumMeta.__prepare__(cls, bases)
 *         classdict["__module__"] = "gel"
 *         classdict["__qualname__"] = "gel.DerivedEnumValue"             # <<<<<<<<<<<<<<
 *         classdict["__tid__"] = pgproto.UUID(tid)
 *         for label in enum_labels:
 */
  if (unlikely((PyObject_SetItem(__pyx_v_classdict, __pyx_n_u_qualname, __pyx_kp_u_gel_DerivedEnumValue) < 0))) __PYX_ERR(16, 53, __pyx_L1_error)

  /* "gel/protocol/codecs/enum.pyx":54
 *         classdict["__module__"] = "gel"
 *         classdict["__qualname__"] = "gel.DerivedEnumValue"
 *         classdict["__tid__"] = pgproto.UUID(tid)             # <<<<<<<<<<<<<<
 *         for label in enum_labels:
 *             classdict[label.upper()] = label
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pgproto); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UUID); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_tid};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 54, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if (unlikely((PyObject_SetItem(__pyx_v_classdict, __pyx_n_u_tid, __pyx_t_1) < 0))) __PYX_ERR(16, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":55
 *         classdict["__qualname__"] = "gel.DerivedEnumValue"
 *         classdict["__tid__"] = pgproto.UUID(tid)
 *         for label in enum_labels:             # <<<<<<<<<<<<<<
 *             classdict[label.upper()] = label
 *         codec.cls = enum.EnumMeta(cls, bases, classdict)
 */
  if (unlikely(__pyx_v_enum_labels == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(16, 55, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_enum_labels; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_5 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(16, 55, __pyx_L1_error)
      #endif
      if (__pyx_t_5 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(16, 55, __pyx_L1_error)
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/codecs/enum.pyx":56
 *         classdict["__tid__"] = pgproto.UUID(tid)
 *         for label in enum_labels:
 *             classdict[label.upper()] = label             # <<<<<<<<<<<<<<
 *         codec.cls = enum.EnumMeta(cls, bases, classdict)
 *         for index, label in enumerate(enum_labels):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_upper); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 56, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 56, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    if (unlikely((PyObject_SetItem(__pyx_v_classdict, __pyx_t_3, __pyx_v_label) < 0))) __PYX_ERR(16, 56, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/codecs/enum.pyx":55
 *         classdict["__qualname__"] = "gel.DerivedEnumValue"
 *         classdict["__tid__"] = pgproto.UUID(tid)
 *         for label in enum_labels:             # <<<<<<<<<<<<<<
 *             classdict[label.upper()] = label
 *         codec.cls = enum.EnumMeta(cls, bases, classdict)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":57
 *         for label in enum_labels:
 *             classdict[label.upper()] = label
 *         codec.cls = enum.EnumMeta(cls, bases, classdict)             # <<<<<<<<<<<<<<
 *         for index, label in enumerate(enum_labels):
 *             codec.cls(label)._index_ = index
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_EnumMeta); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_cls, __pyx_v_bases, __pyx_v_classdict};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_codec->cls);
  __Pyx_DECREF(__pyx_v_codec->cls);
  __pyx_v_codec->cls = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":58
 *             classdict[label.upper()] = label
 *         codec.cls = enum.EnumMeta(cls, bases, classdict)
 *         for index, label in enumerate(enum_labels):             # <<<<<<<<<<<<<<
 *             codec.cls(label)._index_ = index
 * 
 */
  __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_v_enum_labels; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_7 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(16, 58, __pyx_L1_error)
      #endif
      if (__pyx_t_7 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(16, 58, __pyx_L1_error)
    #else
    __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_v_index = __pyx_t_5;
    __pyx_t_5 = (__pyx_t_5 + 1);

    /* "gel/protocol/codecs/enum.pyx":59
 *         codec.cls = enum.EnumMeta(cls, bases, classdict)
 *         for index, label in enumerate(enum_labels):
 *             codec.cls(label)._index_ = index             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_codec->cls);
    __pyx_t_6 = __pyx_v_codec->cls; __pyx_t_8 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_label};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 59, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_3, __pyx_n_s_index, __pyx_t_2) < 0) __PYX_ERR(16, 59, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/codecs/enum.pyx":58
 *             classdict[label.upper()] = label
 *         codec.cls = enum.EnumMeta(cls, bases, classdict)
 *         for index, label in enumerate(enum_labels):             # <<<<<<<<<<<<<<
 *             codec.cls(label)._index_ = index
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":61
 *             codec.cls(label)._index_ = index
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 *     def make_type(self, describe_context):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/enum.pyx":41
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple enum_labels):             # <<<<<<<<<<<<<<
 *         cdef:
 *             EnumCodec codec
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_cls);
  __Pyx_XDECREF(__pyx_v_bases);
  __Pyx_XDECREF(__pyx_v_classdict);
  __Pyx_XDECREF(__pyx_v_label);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/enum.pyx":63
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.EnumType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9EnumCodec_1make_type = {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_1make_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v_describe_context = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_describe_context,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_describe_context)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(16, 63, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "make_type") < 0)) __PYX_ERR(16, 63, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_describe_context = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("make_type", 1, 1, 1, __pyx_nargs); __PYX_ERR(16, 63, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9EnumCodec_make_type(((struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *)__pyx_v_self), __pyx_v_describe_context);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_9EnumCodec_9make_type_2generator20(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/codecs/enum.pyx":67
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 *             members=tuple(x.value for x in self.cls.__members__.values())             # <<<<<<<<<<<<<<
 *         )
 */

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9EnumCodec_9make_type_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(16, 67, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_9EnumCodec_9make_type_2generator20, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_make_type_locals_genexpr, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(16, 67, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.make_type.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_9EnumCodec_9make_type_2generator20(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(16, 67, __pyx_L1_error)
  __pyx_t_2 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(16, 67, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
    __PYX_ERR(16, 67, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_genexpr_arg_0, 0, __pyx_n_s_values, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, NULL, &__pyx_t_5, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_6 == 0)) break;
    if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(16, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_x);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_x, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_x, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    __Pyx_XGIVEREF(__pyx_t_1);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_3 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_3;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(16, 67, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/enum.pyx":63
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.EnumType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9EnumCodec_make_type(struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_describe_context) {
  PyObject *__pyx_gb_3gel_8protocol_8protocol_9EnumCodec_9make_type_2generator20 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("make_type", 1);

  /* "gel/protocol/codecs/enum.pyx":64
 * 
 *     def make_type(self, describe_context):
 *         return describe.EnumType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_describe); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_EnumType); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/enum.pyx":65
 *     def make_type(self, describe_context):
 *         return describe.EnumType(
 *             desc_id=uuid.UUID(bytes=self.tid),             # <<<<<<<<<<<<<<
 *             name=self.type_name,
 *             members=tuple(x.value for x in self.cls.__members__.values())
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bytes, __pyx_v_self->__pyx_base.tid) < 0) __PYX_ERR(16, 65, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_desc_id, __pyx_t_5) < 0) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/enum.pyx":66
 *         return describe.EnumType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,             # <<<<<<<<<<<<<<
 *             members=tuple(x.value for x in self.cls.__members__.values())
 *         )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->__pyx_base.type_name) < 0) __PYX_ERR(16, 65, __pyx_L1_error)

  /* "gel/protocol/codecs/enum.pyx":67
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 *             members=tuple(x.value for x in self.cls.__members__.values())             # <<<<<<<<<<<<<<
 *         )
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cls, __pyx_n_s_members); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __pyx_pf_3gel_8protocol_8protocol_9EnumCodec_9make_type_genexpr(NULL, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(16, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_members_2, __pyx_t_5) < 0) __PYX_ERR(16, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/codecs/enum.pyx":64
 * 
 *     def make_type(self, describe_context):
 *         return describe.EnumType(             # <<<<<<<<<<<<<<
 *             desc_id=uuid.UUID(bytes=self.tid),
 *             name=self.type_name,
 */
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(16, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/enum.pyx":63
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.EnumType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.make_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_gb_3gel_8protocol_8protocol_9EnumCodec_9make_type_2generator20);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9EnumCodec_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9EnumCodec_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9EnumCodec_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9EnumCodec_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_9EnumCodec_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_9EnumCodec_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.EnumCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/record.pyx":23
 * cdef class RecordCodec(BaseNamedRecordCodec):
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_11RecordCodec_encode(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, CYTHON_UNUSED PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 1);

  /* "gel/protocol/codecs/record.pyx":24
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef decode(self, FRBuffer *buf):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(17, 24, __pyx_L1_error)

  /* "gel/protocol/codecs/record.pyx":23
 * cdef class RecordCodec(BaseNamedRecordCodec):
 * 
 *     cdef encode(self, WriteBuffer buf, object obj):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.RecordCodec.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/record.pyx":26
 *         raise NotImplementedError
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_11RecordCodec_decode(struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_elem_count;
  Py_ssize_t __pyx_v_i;
  int32_t __pyx_v_elem_len;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_elem_codec = 0;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  PyObject *__pyx_v_fields_codecs = 0;
  PyObject *__pyx_v_descriptor = 0;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  char const *__pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  Py_UCS4 __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 1);

  /* "gel/protocol/codecs/record.pyx":34
 *             BaseCodec elem_codec
 *             FRBuffer elem_buf
 *             tuple fields_codecs = (<BaseRecordCodec>self).fields_codecs             # <<<<<<<<<<<<<<
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)__pyx_v_self)->fields_codecs;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fields_codecs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/record.pyx":35
 *             FRBuffer elem_buf
 *             tuple fields_codecs = (<BaseRecordCodec>self).fields_codecs
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor             # <<<<<<<<<<<<<<
 * 
 *         elem_count = <Py_ssize_t><uint16_t>hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_1 = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)__pyx_v_self)->descriptor;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/record.pyx":37
 *             descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 *         elem_count = <Py_ssize_t><uint16_t>hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *         if elem_count != len(fields_codecs):
 */
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(17, 37, __pyx_L1_error)
  __pyx_v_elem_count = ((Py_ssize_t)((uint16_t)unpack_int32(__pyx_t_2)));

  /* "gel/protocol/codecs/record.pyx":39
 *         elem_count = <Py_ssize_t><uint16_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_count != len(fields_codecs):             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode Record: expected {len(fields_codecs)} '
 */
  if (unlikely(__pyx_v_fields_codecs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(17, 39, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v_fields_codecs); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(17, 39, __pyx_L1_error)
  __pyx_t_4 = (__pyx_v_elem_count != __pyx_t_3);
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/codecs/record.pyx":41
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(
 *                 f'cannot decode Record: expected {len(fields_codecs)} '             # <<<<<<<<<<<<<<
 *                 f'elements, got {elem_count}')
 * 
 */
    __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_5 = 127;
    __Pyx_INCREF(__pyx_kp_u_cannot_decode_Record_expected);
    __pyx_t_3 += 31;
    __Pyx_GIVEREF(__pyx_kp_u_cannot_decode_Record_expected);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_cannot_decode_Record_expected);
    if (unlikely(__pyx_v_fields_codecs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(17, 41, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyTuple_GET_SIZE(__pyx_v_fields_codecs); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(17, 41, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_6, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_INCREF(__pyx_kp_u_elements_got);
    __pyx_t_3 += 15;
    __Pyx_GIVEREF(__pyx_kp_u_elements_got);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_elements_got);

    /* "gel/protocol/codecs/record.pyx":42
 *             raise RuntimeError(
 *                 f'cannot decode Record: expected {len(fields_codecs)} '
 *                 f'elements, got {elem_count}')             # <<<<<<<<<<<<<<
 * 
 *         result = datatypes.record_new(descriptor)
 */
    __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_elem_count, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "gel/protocol/codecs/record.pyx":41
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(
 *                 f'cannot decode Record: expected {len(fields_codecs)} '             # <<<<<<<<<<<<<<
 *                 f'elements, got {elem_count}')
 * 
 */
    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/record.pyx":40
 * 
 *         if elem_count != len(fields_codecs):
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'cannot decode Record: expected {len(fields_codecs)} '
 *                 f'elements, got {elem_count}')
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 40, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(17, 40, __pyx_L1_error)

    /* "gel/protocol/codecs/record.pyx":39
 *         elem_count = <Py_ssize_t><uint16_t>hton.unpack_int32(frb_read(buf, 4))
 * 
 *         if elem_count != len(fields_codecs):             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'cannot decode Record: expected {len(fields_codecs)} '
 */
  }

  /* "gel/protocol/codecs/record.pyx":44
 *                 f'elements, got {elem_count}')
 * 
 *         result = datatypes.record_new(descriptor)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(elem_count):
 */
  __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_new(__pyx_v_descriptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/record.pyx":46
 *         result = datatypes.record_new(descriptor)
 * 
 *         for i in range(elem_count):             # <<<<<<<<<<<<<<
 *             frb_read(buf, 4)  # reserved
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_3 = __pyx_v_elem_count;
  __pyx_t_6 = __pyx_t_3;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_6; __pyx_t_8+=1) {
    __pyx_v_i = __pyx_t_8;

    /* "gel/protocol/codecs/record.pyx":47
 * 
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # reserved             # <<<<<<<<<<<<<<
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 */
    __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(17, 47, __pyx_L1_error)

    /* "gel/protocol/codecs/record.pyx":48
 *         for i in range(elem_count):
 *             frb_read(buf, 4)  # reserved
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *             if elem_len == -1:
 */
    __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(17, 48, __pyx_L1_error)
    __pyx_v_elem_len = unpack_int32(__pyx_t_2);

    /* "gel/protocol/codecs/record.pyx":50
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
    __pyx_t_4 = (__pyx_v_elem_len == -1L);
    if (__pyx_t_4) {

      /* "gel/protocol/codecs/record.pyx":51
 * 
 *             if elem_len == -1:
 *                 elem = None             # <<<<<<<<<<<<<<
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_elem, Py_None);

      /* "gel/protocol/codecs/record.pyx":50
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 * 
 *             if elem_len == -1:             # <<<<<<<<<<<<<<
 *                 elem = None
 *             else:
 */
      goto __pyx_L6;
    }

    /* "gel/protocol/codecs/record.pyx":53
 *                 elem = None
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]             # <<<<<<<<<<<<<<
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 */
    /*else*/ {
      if (unlikely(__pyx_v_fields_codecs == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(17, 53, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_fields_codecs, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 53, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __pyx_t_1;
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_elem_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_7));
      __pyx_t_7 = 0;

      /* "gel/protocol/codecs/record.pyx":55
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))             # <<<<<<<<<<<<<<
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 */
      __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), __pyx_v_buf, __pyx_v_elem_len); if (unlikely(__pyx_t_9 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(17, 55, __pyx_L1_error)

      /* "gel/protocol/codecs/record.pyx":54
 *             else:
 *                 elem_codec = <BaseCodec>fields_codecs[i]
 *                 elem = elem_codec.decode(             # <<<<<<<<<<<<<<
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):
 */
      __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_elem_codec->__pyx_vtab)->decode(__pyx_v_elem_codec, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 54, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_elem, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "gel/protocol/codecs/record.pyx":56
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 56, __pyx_L1_error)
      __pyx_t_4 = (__pyx_t_10 != 0);
      if (unlikely(__pyx_t_4)) {

        /* "gel/protocol/codecs/record.pyx":59
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 *                         f'record element decoding: {frb_get_len(&elem_buf)}')             # <<<<<<<<<<<<<<
 * 
 *             datatypes.record_set(result, i, elem)
 */
        __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(17, 59, __pyx_L1_error)
        __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 59, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);

        /* "gel/protocol/codecs/record.pyx":58
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                         f'record element decoding: {frb_get_len(&elem_buf)}')
 * 
 */
        __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 58, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "gel/protocol/codecs/record.pyx":57
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in buffer after '
 *                         f'record element decoding: {frb_get_len(&elem_buf)}')
 */
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 57, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_7, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __PYX_ERR(17, 57, __pyx_L1_error)

        /* "gel/protocol/codecs/record.pyx":56
 *                 elem = elem_codec.decode(
 *                     frb_slice_from(&elem_buf, buf, elem_len))
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in buffer after '
 */
      }
    }
    __pyx_L6:;

    /* "gel/protocol/codecs/record.pyx":61
 *                         f'record element decoding: {frb_get_len(&elem_buf)}')
 * 
 *             datatypes.record_set(result, i, elem)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_7 = __pyx_f_3gel_9datatypes_9datatypes_record_set(__pyx_v_result, __pyx_v_i, __pyx_v_elem); if (unlikely(!__pyx_t_7)) __PYX_ERR(17, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "gel/protocol/codecs/record.pyx":63
 *             datatypes.record_set(result, i, elem)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/protocol/codecs/record.pyx":26
 *         raise NotImplementedError
 * 
 *     cdef decode(self, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *         cdef:
 *             object result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.RecordCodec.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF((PyObject *)__pyx_v_elem_codec);
  __Pyx_XDECREF(__pyx_v_fields_codecs);
  __Pyx_XDECREF(__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/record.pyx":66
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple names, tuple codecs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             RecordCodec codec
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_11RecordCodec_new(PyObject *__pyx_v_tid, PyObject *__pyx_v_names, PyObject *__pyx_v_codecs) {
  struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_codec = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__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("new", 1);

  /* "gel/protocol/codecs/record.pyx":70
 *             RecordCodec codec
 * 
 *         codec = RecordCodec.__new__(RecordCodec)             # <<<<<<<<<<<<<<
 * 
 *         codec.tid = tid
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_RecordCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_RecordCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 70, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/record.pyx":72
 *         codec = RecordCodec.__new__(RecordCodec)
 * 
 *         codec.tid = tid             # <<<<<<<<<<<<<<
 *         codec.name = 'Record'
 *         codec.descriptor = datatypes.record_desc_new(
 */
  __Pyx_INCREF(__pyx_v_tid);
  __Pyx_GIVEREF(__pyx_v_tid);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid);
  __pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.tid = __pyx_v_tid;

  /* "gel/protocol/codecs/record.pyx":73
 * 
 *         codec.tid = tid
 *         codec.name = 'Record'             # <<<<<<<<<<<<<<
 *         codec.descriptor = datatypes.record_desc_new(
 *             names, <object>NULL, <object>NULL)
 */
  __Pyx_INCREF(__pyx_n_u_Record);
  __Pyx_GIVEREF(__pyx_n_u_Record);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name);
  __pyx_v_codec->__pyx_base.__pyx_base.__pyx_base.name = __pyx_n_u_Record;

  /* "gel/protocol/codecs/record.pyx":74
 *         codec.tid = tid
 *         codec.name = 'Record'
 *         codec.descriptor = datatypes.record_desc_new(             # <<<<<<<<<<<<<<
 *             names, <object>NULL, <object>NULL)
 *         codec.fields_codecs = codecs
 */
  __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_new(__pyx_v_names, ((PyObject *)NULL), ((PyObject *)NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.descriptor);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.descriptor);
  __pyx_v_codec->__pyx_base.descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/record.pyx":76
 *         codec.descriptor = datatypes.record_desc_new(
 *             names, <object>NULL, <object>NULL)
 *         codec.fields_codecs = codecs             # <<<<<<<<<<<<<<
 * 
 *         return codec
 */
  __Pyx_INCREF(__pyx_v_codecs);
  __Pyx_GIVEREF(__pyx_v_codecs);
  __Pyx_GOTREF(__pyx_v_codec->__pyx_base.__pyx_base.fields_codecs);
  __Pyx_DECREF(__pyx_v_codec->__pyx_base.__pyx_base.fields_codecs);
  __pyx_v_codec->__pyx_base.__pyx_base.fields_codecs = __pyx_v_codecs;

  /* "gel/protocol/codecs/record.pyx":78
 *         codec.fields_codecs = codecs
 * 
 *         return codec             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_codec);
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec);
  goto __pyx_L0;

  /* "gel/protocol/codecs/record.pyx":66
 * 
 *     @staticmethod
 *     cdef BaseCodec new(bytes tid, tuple names, tuple codecs):             # <<<<<<<<<<<<<<
 *         cdef:
 *             RecordCodec codec
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.RecordCodec.new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11RecordCodec_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11RecordCodec_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11RecordCodec_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11RecordCodec_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11RecordCodec___reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11RecordCodec___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.RecordCodec.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11RecordCodec_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_11RecordCodec_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11RecordCodec_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_11RecordCodec_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.RecordCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_11RecordCodec_2__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_11RecordCodec_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 1);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
  __PYX_ERR(2, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.RecordCodec.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":74
 * cdef class CodecsRegistry:
 * 
 *     def __init__(self, *, cache_size=1000):             # <<<<<<<<<<<<<<
 *         self.codecs_build_cache = LRUMapping(maxsize=_CODECS_BUILD_CACHE_SIZE)
 *         self.codecs = LRUMapping(maxsize=cache_size)
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cache_size = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cache_size,0};
    values[0] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_1000));
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      if (kw_args == 1) {
        const Py_ssize_t index = 0;
        PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]);
        if (value) { values[index] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 74, __pyx_L3_error)
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "__init__") < 0)) __PYX_ERR(7, 74, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 0)) {
      goto __pyx_L5_argtuple_error;
    } else {
    }
    __pyx_v_cache_size = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); __PYX_ERR(7, 74, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry___init__(((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self), __pyx_v_cache_size);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry___init__(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_cache_size) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "gel/protocol/codecs/codecs.pyx":75
 * 
 *     def __init__(self, *, cache_size=1000):
 *         self.codecs_build_cache = LRUMapping(maxsize=_CODECS_BUILD_CACHE_SIZE)             # <<<<<<<<<<<<<<
 *         self.codecs = LRUMapping(maxsize=cache_size)
 *         self.base_codec_overrides = {}
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_maxsize, __pyx_int_200) < 0) __PYX_ERR(7, 75, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_LRUMapping), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->codecs_build_cache);
  __Pyx_DECREF((PyObject *)__pyx_v_self->codecs_build_cache);
  __pyx_v_self->codecs_build_cache = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":76
 *     def __init__(self, *, cache_size=1000):
 *         self.codecs_build_cache = LRUMapping(maxsize=_CODECS_BUILD_CACHE_SIZE)
 *         self.codecs = LRUMapping(maxsize=cache_size)             # <<<<<<<<<<<<<<
 *         self.base_codec_overrides = {}
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_maxsize, __pyx_v_cache_size) < 0) __PYX_ERR(7, 76, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_LRUMapping), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->codecs);
  __Pyx_DECREF((PyObject *)__pyx_v_self->codecs);
  __pyx_v_self->codecs = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":77
 *         self.codecs_build_cache = LRUMapping(maxsize=_CODECS_BUILD_CACHE_SIZE)
 *         self.codecs = LRUMapping(maxsize=cache_size)
 *         self.base_codec_overrides = {}             # <<<<<<<<<<<<<<
 * 
 *     def clear_cache(self):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->base_codec_overrides);
  __Pyx_DECREF(__pyx_v_self->base_codec_overrides);
  __pyx_v_self->base_codec_overrides = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":74
 * cdef class CodecsRegistry:
 * 
 *     def __init__(self, *, cache_size=1000):             # <<<<<<<<<<<<<<
 *         self.codecs_build_cache = LRUMapping(maxsize=_CODECS_BUILD_CACHE_SIZE)
 *         self.codecs = LRUMapping(maxsize=cache_size)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":79
 *         self.base_codec_overrides = {}
 * 
 *     def clear_cache(self):             # <<<<<<<<<<<<<<
 *         self.codecs.clear()
 *         self.codecs_build_cache.clear()
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_3clear_cache(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14CodecsRegistry_3clear_cache = {"clear_cache", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_3clear_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_3clear_cache(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear_cache (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("clear_cache", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "clear_cache", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_2clear_cache(((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_2clear_cache(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear_cache", 1);

  /* "gel/protocol/codecs/codecs.pyx":80
 * 
 *     def clear_cache(self):
 *         self.codecs.clear()             # <<<<<<<<<<<<<<
 *         self.codecs_build_cache.clear()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->codecs), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":81
 *     def clear_cache(self):
 *         self.codecs.clear()
 *         self.codecs_build_cache.clear()             # <<<<<<<<<<<<<<
 * 
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->codecs_build_cache), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":79
 *         self.base_codec_overrides = {}
 * 
 *     def clear_cache(self):             # <<<<<<<<<<<<<<
 *         self.codecs.clear()
 *         self.codecs_build_cache.clear()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.clear_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":83
 *         self.codecs_build_cache.clear()
 * 
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):             # <<<<<<<<<<<<<<
 *         if format != 'python':
 *             raise ValueError('"python" is the only valid format')
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_5set_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14CodecsRegistry_5set_type_codec = {"set_type_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_5set_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_5set_type_codec(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_typeid = 0;
  PyObject *__pyx_v_encoder = 0;
  PyObject *__pyx_v_decoder = 0;
  PyObject *__pyx_v_format = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_type_codec (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_typeid,&__pyx_n_s_encoder,&__pyx_n_s_decoder,&__pyx_n_s_format,0};
    if (likely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_typeid)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 83, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_encoder)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 83, __pyx_L3_error)
        else {
          __Pyx_RaiseKeywordRequired("set_type_codec", __pyx_n_s_encoder); __PYX_ERR(7, 83, __pyx_L3_error)
        }
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_decoder)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 83, __pyx_L3_error)
        else {
          __Pyx_RaiseKeywordRequired("set_type_codec", __pyx_n_s_decoder); __PYX_ERR(7, 83, __pyx_L3_error)
        }
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 83, __pyx_L3_error)
        else {
          __Pyx_RaiseKeywordRequired("set_type_codec", __pyx_n_s_format); __PYX_ERR(7, 83, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_type_codec") < 0)) __PYX_ERR(7, 83, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      __Pyx_RaiseKeywordRequired("set_type_codec", __pyx_n_s_encoder); __PYX_ERR(7, 83, __pyx_L3_error)
    }
    __pyx_v_typeid = values[0];
    __pyx_v_encoder = values[1];
    __pyx_v_decoder = values[2];
    __pyx_v_format = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_type_codec", 1, 1, 1, __pyx_nargs); __PYX_ERR(7, 83, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.set_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_4set_type_codec(((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self), __pyx_v_typeid, __pyx_v_encoder, __pyx_v_decoder, __pyx_v_format);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_4set_type_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_typeid, PyObject *__pyx_v_encoder, PyObject *__pyx_v_decoder, PyObject *__pyx_v_format) {
  PyObject *__pyx_v_basecodec = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_type_codec", 1);

  /* "gel/protocol/codecs/codecs.pyx":84
 * 
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):
 *         if format != 'python':             # <<<<<<<<<<<<<<
 *             raise ValueError('"python" is the only valid format')
 *         if not isinstance(typeid, uuid.UUID):
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_format, __pyx_n_u_python, Py_NE)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(7, 84, __pyx_L1_error)
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/codecs.pyx":85
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):
 *         if format != 'python':
 *             raise ValueError('"python" is the only valid format')             # <<<<<<<<<<<<<<
 *         if not isinstance(typeid, uuid.UUID):
 *             raise TypeError('typeid must be a UUID')
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 85, __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(7, 85, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":84
 * 
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):
 *         if format != 'python':             # <<<<<<<<<<<<<<
 *             raise ValueError('"python" is the only valid format')
 *         if not isinstance(typeid, uuid.UUID):
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":86
 *         if format != 'python':
 *             raise ValueError('"python" is the only valid format')
 *         if not isinstance(typeid, uuid.UUID):             # <<<<<<<<<<<<<<
 *             raise TypeError('typeid must be a UUID')
 *         basecodec = BASE_SCALAR_CODECS.get(typeid.bytes)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UUID); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_typeid, __pyx_t_3); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (!__pyx_t_1);
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/codecs/codecs.pyx":87
 *             raise ValueError('"python" is the only valid format')
 *         if not isinstance(typeid, uuid.UUID):
 *             raise TypeError('typeid must be a UUID')             # <<<<<<<<<<<<<<
 *         basecodec = BASE_SCALAR_CODECS.get(typeid.bytes)
 *         if basecodec is None:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 87, __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(7, 87, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":86
 *         if format != 'python':
 *             raise ValueError('"python" is the only valid format')
 *         if not isinstance(typeid, uuid.UUID):             # <<<<<<<<<<<<<<
 *             raise TypeError('typeid must be a UUID')
 *         basecodec = BASE_SCALAR_CODECS.get(typeid.bytes)
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":88
 *         if not isinstance(typeid, uuid.UUID):
 *             raise TypeError('typeid must be a UUID')
 *         basecodec = BASE_SCALAR_CODECS.get(typeid.bytes)             # <<<<<<<<<<<<<<
 *         if basecodec is None:
 *             raise ValueError(
 */
  if (unlikely(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(7, 88, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_typeid, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_basecodec = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":89
 *             raise TypeError('typeid must be a UUID')
 *         basecodec = BASE_SCALAR_CODECS.get(typeid.bytes)
 *         if basecodec is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'{typeid} does not correspond to any known base type')
 */
  __pyx_t_4 = (__pyx_v_basecodec == Py_None);
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/codecs/codecs.pyx":91
 *         if basecodec is None:
 *             raise ValueError(
 *                 f'{typeid} does not correspond to any known base type')             # <<<<<<<<<<<<<<
 *         self.base_codec_overrides[typeid.bytes] = CodecPythonOverride.new(
 *             typeid.bytes,
 */
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_typeid, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_2, __pyx_kp_u_does_not_correspond_to_any_know); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 91, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/codecs/codecs.pyx":90
 *         basecodec = BASE_SCALAR_CODECS.get(typeid.bytes)
 *         if basecodec is None:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 f'{typeid} does not correspond to any known base type')
 *         self.base_codec_overrides[typeid.bytes] = CodecPythonOverride.new(
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 90, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":89
 *             raise TypeError('typeid must be a UUID')
 *         basecodec = BASE_SCALAR_CODECS.get(typeid.bytes)
 *         if basecodec is None:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 f'{typeid} does not correspond to any known base type')
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":93
 *                 f'{typeid} does not correspond to any known base type')
 *         self.base_codec_overrides[typeid.bytes] = CodecPythonOverride.new(
 *             typeid.bytes,             # <<<<<<<<<<<<<<
 *             basecodec,
 *             encoder,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_typeid, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(7, 93, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":94
 *         self.base_codec_overrides[typeid.bytes] = CodecPythonOverride.new(
 *             typeid.bytes,
 *             basecodec,             # <<<<<<<<<<<<<<
 *             encoder,
 *             decoder,
 */
  if (!(likely(((__pyx_v_basecodec) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_basecodec, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 94, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":92
 *             raise ValueError(
 *                 f'{typeid} does not correspond to any known base type')
 *         self.base_codec_overrides[typeid.bytes] = CodecPythonOverride.new(             # <<<<<<<<<<<<<<
 *             typeid.bytes,
 *             basecodec,
 */
  __pyx_t_3 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_new(((PyObject*)__pyx_t_2), ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_basecodec), __pyx_v_encoder, __pyx_v_decoder)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_v_self->base_codec_overrides == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(7, 92, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_typeid, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely((PyDict_SetItem(__pyx_v_self->base_codec_overrides, __pyx_t_2, __pyx_t_3) < 0))) __PYX_ERR(7, 92, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":83
 *         self.codecs_build_cache.clear()
 * 
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):             # <<<<<<<<<<<<<<
 *         if format != 'python':
 *             raise ValueError('"python" is the only valid format')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.set_type_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_basecodec);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":99
 *         )
 * 
 *     cdef BaseCodec _build_codec(self, FRBuffer *spec, list codecs_list,             # <<<<<<<<<<<<<<
 *                                 protocol_version):
 *         cdef:
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry__build_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_spec, PyObject *__pyx_v_codecs_list, PyObject *__pyx_v_protocol_version) {
  uint32_t __pyx_v_desc_len;
  uint8_t __pyx_v_t;
  PyObject *__pyx_v_tid = 0;
  uint16_t __pyx_v_els;
  uint16_t __pyx_v_i;
  uint32_t __pyx_v_str_len;
  uint16_t __pyx_v_pos;
  int32_t __pyx_v_dim_len;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_res = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_sub_codec = 0;
  CYTHON_UNUSED int __pyx_v_ephemeral_free_shape;
  CYTHON_UNUSED uint16_t __pyx_v_objtype_pos;
  PyObject *__pyx_v_codecs = NULL;
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_flags = NULL;
  PyObject *__pyx_v_cards = NULL;
  uint32_t __pyx_v_flag;
  uint8_t __pyx_v_cardinality;
  PyObject *__pyx_v_name = NULL;
  uint16_t __pyx_v_source_type_pos;
  CYTHON_UNUSED PyObject *__pyx_v_source_type = NULL;
  PyObject *__pyx_v_type_name = NULL;
  CYTHON_UNUSED int __pyx_v_schema_defined;
  uint16_t __pyx_v_ancestor_count;
  PyObject *__pyx_v_ancestors = NULL;
  CYTHON_UNUSED uint16_t __pyx_v__;
  uint16_t __pyx_v_ancestor_pos;
  PyObject *__pyx_v_ancestor_codec = NULL;
  PyObject *__pyx_v_fundamental_codec = NULL;
  uint16_t __pyx_v_fundamental_pos;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  char const *__pyx_t_4;
  uint16_t __pyx_t_5;
  uint16_t __pyx_t_6;
  uint16_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_build_codec", 1);

  /* "gel/protocol/codecs/codecs.pyx":102
 *                                 protocol_version):
 *         cdef:
 *             uint32_t desc_len = 0             # <<<<<<<<<<<<<<
 *             uint8_t t
 *             bytes tid
 */
  __pyx_v_desc_len = 0;

  /* "gel/protocol/codecs/codecs.pyx":113
 *             BaseCodec sub_codec
 * 
 *         if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *             desc_len = frb_get_len(spec) - 16 - 1
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 113, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 113, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":114
 * 
 *         if protocol_version >= (2, 0):
 *             desc_len = frb_get_len(spec) - 16 - 1             # <<<<<<<<<<<<<<
 * 
 *         t = <uint8_t>(frb_read(spec, 1)[0])
 */
    __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len(__pyx_v_spec); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 114, __pyx_L1_error)
    __pyx_v_desc_len = ((__pyx_t_3 - 16) - 1);

    /* "gel/protocol/codecs/codecs.pyx":113
 *             BaseCodec sub_codec
 * 
 *         if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *             desc_len = frb_get_len(spec) - 16 - 1
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":116
 *             desc_len = frb_get_len(spec) - 16 - 1
 * 
 *         t = <uint8_t>(frb_read(spec, 1)[0])             # <<<<<<<<<<<<<<
 *         tid = frb_read(spec, 16)[:16]
 * 
 */
  __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 116, __pyx_L1_error)
  __pyx_v_t = ((uint8_t)(__pyx_t_4[0]));

  /* "gel/protocol/codecs/codecs.pyx":117
 * 
 *         t = <uint8_t>(frb_read(spec, 1)[0])
 *         tid = frb_read(spec, 16)[:16]             # <<<<<<<<<<<<<<
 * 
 *         res = self.codecs.get(tid, None)
 */
  __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 16); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 117, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_t_4 + 0, 16 - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_tid = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":119
 *         tid = frb_read(spec, 16)[:16]
 * 
 *         res = self.codecs.get(tid, None)             # <<<<<<<<<<<<<<
 *         if res is None:
 *             res = self.codecs_build_cache.get(tid, None)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self->codecs->__pyx_vtab)->get(__pyx_v_self->codecs, __pyx_v_tid, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 119, __pyx_L1_error)
  __pyx_v_res = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":120
 * 
 *         res = self.codecs.get(tid, None)
 *         if res is None:             # <<<<<<<<<<<<<<
 *             res = self.codecs_build_cache.get(tid, None)
 *         if res is not None:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_res) == Py_None);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":121
 *         res = self.codecs.get(tid, None)
 *         if res is None:
 *             res = self.codecs_build_cache.get(tid, None)             # <<<<<<<<<<<<<<
 *         if res is not None:
 *             # We have a codec for this "tid"; advance the buffer
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self->codecs_build_cache->__pyx_vtab)->get(__pyx_v_self->codecs_build_cache, __pyx_v_tid, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 121, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":120
 * 
 *         res = self.codecs.get(tid, None)
 *         if res is None:             # <<<<<<<<<<<<<<
 *             res = self.codecs_build_cache.get(tid, None)
 *         if res is not None:
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":122
 *         if res is None:
 *             res = self.codecs_build_cache.get(tid, None)
 *         if res is not None:             # <<<<<<<<<<<<<<
 *             # We have a codec for this "tid"; advance the buffer
 *             # so that we can process the next codec.
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_res) != Py_None);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":125
 *             # We have a codec for this "tid"; advance the buffer
 *             # so that we can process the next codec.
 *             if desc_len > 0:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, desc_len)
 *                 return res
 */
    __pyx_t_2 = (__pyx_v_desc_len > 0);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":126
 *             # so that we can process the next codec.
 *             if desc_len > 0:
 *                 frb_read(spec, desc_len)             # <<<<<<<<<<<<<<
 *                 return res
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_desc_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 126, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":127
 *             if desc_len > 0:
 *                 frb_read(spec, desc_len)
 *                 return res             # <<<<<<<<<<<<<<
 * 
 *             if t == CTYPE_SET:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_res);
      __pyx_r = __pyx_v_res;
      goto __pyx_L0;

      /* "gel/protocol/codecs/codecs.pyx":125
 *             # We have a codec for this "tid"; advance the buffer
 *             # so that we can process the next codec.
 *             if desc_len > 0:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, desc_len)
 *                 return res
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":129
 *                 return res
 * 
 *             if t == CTYPE_SET:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 * 
 */
    __pyx_t_2 = (__pyx_v_t == 0);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":130
 * 
 *             if t == CTYPE_SET:
 *                 frb_read(spec, 2)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_SHAPE or t == CTYPE_INPUT_SHAPE:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 130, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":129
 *                 return res
 * 
 *             if t == CTYPE_SET:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 * 
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":132
 *                 frb_read(spec, 2)
 * 
 *             elif t == CTYPE_SHAPE or t == CTYPE_INPUT_SHAPE:             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 */
    switch (__pyx_v_t) {
      case 1:
      case 8:
      __pyx_t_2 = 1;
      break;
      default:
      __pyx_t_2 = 0;
      break;
    }
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":133
 * 
 *             elif t == CTYPE_SHAPE or t == CTYPE_INPUT_SHAPE:
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for i in range(els):
 *                     frb_read(spec, 4)  # flags
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 133, __pyx_L1_error)
      __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":134
 *             elif t == CTYPE_SHAPE or t == CTYPE_INPUT_SHAPE:
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):             # <<<<<<<<<<<<<<
 *                     frb_read(spec, 4)  # flags
 *                     frb_read(spec, 1)  # cardinality
 */
      __pyx_t_5 = __pyx_v_els;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":135
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 *                     frb_read(spec, 4)  # flags             # <<<<<<<<<<<<<<
 *                     frb_read(spec, 1)  # cardinality
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 135, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":136
 *                 for i in range(els):
 *                     frb_read(spec, 4)  # flags
 *                     frb_read(spec, 1)  # cardinality             # <<<<<<<<<<<<<<
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                     # read the <str> (`str_len` bytes) and <pos> (2 bytes)
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 136, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":137
 *                     frb_read(spec, 4)  # flags
 *                     frb_read(spec, 1)  # cardinality
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                     # read the <str> (`str_len` bytes) and <pos> (2 bytes)
 *                     frb_read(spec, str_len + 2)
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 137, __pyx_L1_error)
        __pyx_v_str_len = unpack_uint32(__pyx_t_4);

        /* "gel/protocol/codecs/codecs.pyx":139
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                     # read the <str> (`str_len` bytes) and <pos> (2 bytes)
 *                     frb_read(spec, str_len + 2)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_BASE_SCALAR:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, (__pyx_v_str_len + 2)); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 139, __pyx_L1_error)
      }

      /* "gel/protocol/codecs/codecs.pyx":132
 *                 frb_read(spec, 2)
 * 
 *             elif t == CTYPE_SHAPE or t == CTYPE_INPUT_SHAPE:             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":141
 *                     frb_read(spec, str_len + 2)
 * 
 *             elif t == CTYPE_BASE_SCALAR:             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
    __pyx_t_2 = (__pyx_v_t == 2);
    if (__pyx_t_2) {
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":144
 *                 pass
 * 
 *             elif t == CTYPE_SCALAR:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 * 
 */
    __pyx_t_2 = (__pyx_v_t == 3);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":145
 * 
 *             elif t == CTYPE_SCALAR:
 *                 frb_read(spec, 2)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_TUPLE:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 145, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":144
 *                 pass
 * 
 *             elif t == CTYPE_SCALAR:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 * 
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":147
 *                 frb_read(spec, 2)
 * 
 *             elif t == CTYPE_TUPLE:             # <<<<<<<<<<<<<<
 *                 # tuple
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
    __pyx_t_2 = (__pyx_v_t == 4);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":149
 *             elif t == CTYPE_TUPLE:
 *                 # tuple
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for i in range(els):
 *                     frb_read(spec, 2)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 149, __pyx_L1_error)
      __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":150
 *                 # tuple
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):             # <<<<<<<<<<<<<<
 *                     frb_read(spec, 2)
 * 
 */
      __pyx_t_5 = __pyx_v_els;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":151
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 *                     frb_read(spec, 2)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_NAMEDTUPLE:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 151, __pyx_L1_error)
      }

      /* "gel/protocol/codecs/codecs.pyx":147
 *                 frb_read(spec, 2)
 * 
 *             elif t == CTYPE_TUPLE:             # <<<<<<<<<<<<<<
 *                 # tuple
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":153
 *                     frb_read(spec, 2)
 * 
 *             elif t == CTYPE_NAMEDTUPLE:             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 */
    __pyx_t_2 = (__pyx_v_t == 5);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":154
 * 
 *             elif t == CTYPE_NAMEDTUPLE:
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 154, __pyx_L1_error)
      __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":155
 *             elif t == CTYPE_NAMEDTUPLE:
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):             # <<<<<<<<<<<<<<
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                     frb_read(spec, str_len + 2)
 */
      __pyx_t_5 = __pyx_v_els;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":156
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len + 2)
 * 
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 156, __pyx_L1_error)
        __pyx_v_str_len = unpack_uint32(__pyx_t_4);

        /* "gel/protocol/codecs/codecs.pyx":157
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                     frb_read(spec, str_len + 2)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_ARRAY:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, (__pyx_v_str_len + 2)); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 157, __pyx_L1_error)
      }

      /* "gel/protocol/codecs/codecs.pyx":153
 *                     frb_read(spec, 2)
 * 
 *             elif t == CTYPE_NAMEDTUPLE:             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":159
 *                     frb_read(spec, str_len + 2)
 * 
 *             elif t == CTYPE_ARRAY:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
    __pyx_t_2 = (__pyx_v_t == 6);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":160
 * 
 *             elif t == CTYPE_ARRAY:
 *                 frb_read(spec, 2)             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 if els != 1:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 160, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":161
 *             elif t == CTYPE_ARRAY:
 *                 frb_read(spec, 2)
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 if els != 1:
 *                     raise NotImplementedError(
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 161, __pyx_L1_error)
      __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":162
 *                 frb_read(spec, 2)
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 if els != 1:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError(
 *                         'cannot handle arrays with more than one dimension')
 */
      __pyx_t_2 = (__pyx_v_els != 1);
      if (unlikely(__pyx_t_2)) {

        /* "gel/protocol/codecs/codecs.pyx":163
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 if els != 1:
 *                     raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                         'cannot handle arrays with more than one dimension')
 *                 # First dimension length.
 */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 163, __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(7, 163, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":162
 *                 frb_read(spec, 2)
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 if els != 1:             # <<<<<<<<<<<<<<
 *                     raise NotImplementedError(
 *                         'cannot handle arrays with more than one dimension')
 */
      }

      /* "gel/protocol/codecs/codecs.pyx":166
 *                         'cannot handle arrays with more than one dimension')
 *                 # First dimension length.
 *                 frb_read(spec, 4)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_RANGE:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 166, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":159
 *                     frb_read(spec, str_len + 2)
 * 
 *             elif t == CTYPE_ARRAY:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":168
 *                 frb_read(spec, 4)
 * 
 *             elif t == CTYPE_RANGE:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 * 
 */
    __pyx_t_2 = (__pyx_v_t == 9);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":169
 * 
 *             elif t == CTYPE_RANGE:
 *                 frb_read(spec, 2)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_MULTIRANGE:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 169, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":168
 *                 frb_read(spec, 4)
 * 
 *             elif t == CTYPE_RANGE:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 * 
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":171
 *                 frb_read(spec, 2)
 * 
 *             elif t == CTYPE_MULTIRANGE:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 * 
 */
    __pyx_t_2 = (__pyx_v_t == 12);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":172
 * 
 *             elif t == CTYPE_MULTIRANGE:
 *                 frb_read(spec, 2)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_SQL_ROW:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 172, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":171
 *                 frb_read(spec, 2)
 * 
 *             elif t == CTYPE_MULTIRANGE:             # <<<<<<<<<<<<<<
 *                 frb_read(spec, 2)
 * 
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":174
 *                 frb_read(spec, 2)
 * 
 *             elif t == CTYPE_SQL_ROW:             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 */
    __pyx_t_2 = (__pyx_v_t == 13);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":175
 * 
 *             elif t == CTYPE_SQL_ROW:
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 175, __pyx_L1_error)
      __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":176
 *             elif t == CTYPE_SQL_ROW:
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):             # <<<<<<<<<<<<<<
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                     frb_read(spec, str_len + 2)
 */
      __pyx_t_5 = __pyx_v_els;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":177
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len + 2)
 * 
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 177, __pyx_L1_error)
        __pyx_v_str_len = unpack_uint32(__pyx_t_4);

        /* "gel/protocol/codecs/codecs.pyx":178
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                     frb_read(spec, str_len + 2)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_ENUM:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, (__pyx_v_str_len + 2)); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 178, __pyx_L1_error)
      }

      /* "gel/protocol/codecs/codecs.pyx":174
 *                 frb_read(spec, 2)
 * 
 *             elif t == CTYPE_SQL_ROW:             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":180
 *                     frb_read(spec, str_len + 2)
 * 
 *             elif t == CTYPE_ENUM:             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 */
    __pyx_t_2 = (__pyx_v_t == 7);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":181
 * 
 *             elif t == CTYPE_ENUM:
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 181, __pyx_L1_error)
      __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":182
 *             elif t == CTYPE_ENUM:
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):             # <<<<<<<<<<<<<<
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                     frb_read(spec, str_len)
 */
      __pyx_t_5 = __pyx_v_els;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v_i = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":183
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len)
 * 
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 183, __pyx_L1_error)
        __pyx_v_str_len = unpack_uint32(__pyx_t_4);

        /* "gel/protocol/codecs/codecs.pyx":184
 *                 for i in range(els):
 *                     str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                     frb_read(spec, str_len)             # <<<<<<<<<<<<<<
 * 
 *             elif t == CTYPE_ANNO_TYPENAME:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 184, __pyx_L1_error)
      }

      /* "gel/protocol/codecs/codecs.pyx":180
 *                     frb_read(spec, str_len + 2)
 * 
 *             elif t == CTYPE_ENUM:             # <<<<<<<<<<<<<<
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for i in range(els):
 */
      goto __pyx_L7;
    }

    /* "gel/protocol/codecs/codecs.pyx":186
 *                     frb_read(spec, str_len)
 * 
 *             elif t == CTYPE_ANNO_TYPENAME:             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 res.type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_2 = (__pyx_v_t == 0xFF);
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":187
 * 
 *             elif t == CTYPE_ANNO_TYPENAME:
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 res.type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 187, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":189
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 res.type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 189, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":188
 *             elif t == CTYPE_ANNO_TYPENAME:
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 res.type_name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 return None
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(7, 188, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_res->type_name);
      __Pyx_DECREF(__pyx_v_res->type_name);
      __pyx_v_res->type_name = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":190
 *                 res.type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *             elif 0x80 & t == 0x80:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "gel/protocol/codecs/codecs.pyx":186
 *                     frb_read(spec, str_len)
 * 
 *             elif t == CTYPE_ANNO_TYPENAME:             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 res.type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":192
 *                 return None
 * 
 *             elif 0x80 & t == 0x80:             # <<<<<<<<<<<<<<
 *                 # Ignore all other type annotations.
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    __pyx_t_2 = ((0x80 & __pyx_v_t) == 0x80);
    if (likely(__pyx_t_2)) {

      /* "gel/protocol/codecs/codecs.pyx":194
 *             elif 0x80 & t == 0x80:
 *                 # Ignore all other type annotations.
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 frb_read(spec, str_len)
 *                 return None
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 194, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":195
 *                 # Ignore all other type annotations.
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 frb_read(spec, str_len)             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 195, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":196
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 frb_read(spec, str_len)
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); __Pyx_INCREF(Py_None);
      goto __pyx_L0;

      /* "gel/protocol/codecs/codecs.pyx":192
 *                 return None
 * 
 *             elif 0x80 & t == 0x80:             # <<<<<<<<<<<<<<
 *                 # Ignore all other type annotations.
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":199
 * 
 *             else:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     f'no codec implementation for EdgeDB data class {t}')
 * 
 */
    /*else*/ {

      /* "gel/protocol/codecs/codecs.pyx":200
 *             else:
 *                 raise NotImplementedError(
 *                     f'no codec implementation for EdgeDB data class {t}')             # <<<<<<<<<<<<<<
 * 
 *             return res
 */
      __pyx_t_1 = __Pyx_PyInt_From_uint8_t(__pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_no_codec_implementation_for_Edge, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "gel/protocol/codecs/codecs.pyx":199
 * 
 *             else:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     f'no codec implementation for EdgeDB data class {t}')
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(7, 199, __pyx_L1_error)
    }
    __pyx_L7:;

    /* "gel/protocol/codecs/codecs.pyx":202
 *                     f'no codec implementation for EdgeDB data class {t}')
 * 
 *             return res             # <<<<<<<<<<<<<<
 * 
 *         if t == CTYPE_SET:
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_res);
    __pyx_r = __pyx_v_res;
    goto __pyx_L0;

    /* "gel/protocol/codecs/codecs.pyx":122
 *         if res is None:
 *             res = self.codecs_build_cache.get(tid, None)
 *         if res is not None:             # <<<<<<<<<<<<<<
 *             # We have a codec for this "tid"; advance the buffer
 *             # so that we can process the next codec.
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":204
 *             return res
 * 
 *         if t == CTYPE_SET:             # <<<<<<<<<<<<<<
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]
 */
  __pyx_t_2 = (__pyx_v_t == 0);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":205
 * 
 *         if t == CTYPE_SET:
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = SetCodec.new(tid, sub_codec)
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 205, __pyx_L1_error)
    __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":206
 *         if t == CTYPE_SET:
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]             # <<<<<<<<<<<<<<
 *             res = SetCodec.new(tid, sub_codec)
 * 
 */
    if (unlikely(__pyx_v_codecs_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(7, 206, __pyx_L1_error)
    }
    __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_v_sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":207
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = SetCodec.new(tid, sub_codec)             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_SHAPE:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_8SetCodec_new(__pyx_v_tid, __pyx_v_sub_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":204
 *             return res
 * 
 *         if t == CTYPE_SET:             # <<<<<<<<<<<<<<
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":209
 *             res = SetCodec.new(tid, sub_codec)
 * 
 *         elif t == CTYPE_SHAPE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 ephemeral_free_shape = <bint>frb_read(spec, 1)[0]
 */
  __pyx_t_2 = (__pyx_v_t == 1);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":210
 * 
 *         elif t == CTYPE_SHAPE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 ephemeral_free_shape = <bint>frb_read(spec, 1)[0]
 *                 objtype_pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 210, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 210, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":211
 *         elif t == CTYPE_SHAPE:
 *             if protocol_version >= (2, 0):
 *                 ephemeral_free_shape = <bint>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 *                 objtype_pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 211, __pyx_L1_error)
      __pyx_v_ephemeral_free_shape = ((__pyx_t_4[0]) != 0);

      /* "gel/protocol/codecs/codecs.pyx":212
 *             if protocol_version >= (2, 0):
 *                 ephemeral_free_shape = <bint>frb_read(spec, 1)[0]
 *                 objtype_pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 * 
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 212, __pyx_L1_error)
      __pyx_v_objtype_pos = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":210
 * 
 *         elif t == CTYPE_SHAPE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 ephemeral_free_shape = <bint>frb_read(spec, 1)[0]
 *                 objtype_pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":214
 *                 objtype_pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 214, __pyx_L1_error)
    __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":215
 * 
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             names = cpython.PyTuple_New(els)
 *             flags = cpython.PyTuple_New(els)
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_codecs = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":216
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             flags = cpython.PyTuple_New(els)
 *             cards = cpython.PyTuple_New(els)
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_names = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":217
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)
 *             flags = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             cards = cpython.PyTuple_New(els)
 *             for i in range(els):
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_flags = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":218
 *             names = cpython.PyTuple_New(els)
 *             flags = cpython.PyTuple_New(els)
 *             cards = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             for i in range(els):
 *                 flag = hton.unpack_uint32(frb_read(spec, 4))  # flags
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 218, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_cards = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":219
 *             flags = cpython.PyTuple_New(els)
 *             cards = cpython.PyTuple_New(els)
 *             for i in range(els):             # <<<<<<<<<<<<<<
 *                 flag = hton.unpack_uint32(frb_read(spec, 4))  # flags
 *                 cardinality = <uint8_t>frb_read(spec, 1)[0]
 */
    __pyx_t_5 = __pyx_v_els;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "gel/protocol/codecs/codecs.pyx":220
 *             cards = cpython.PyTuple_New(els)
 *             for i in range(els):
 *                 flag = hton.unpack_uint32(frb_read(spec, 4))  # flags             # <<<<<<<<<<<<<<
 *                 cardinality = <uint8_t>frb_read(spec, 1)[0]
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 220, __pyx_L1_error)
      __pyx_v_flag = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":221
 *             for i in range(els):
 *                 flag = hton.unpack_uint32(frb_read(spec, 4))  # flags
 *                 cardinality = <uint8_t>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 * 
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 221, __pyx_L1_error)
      __pyx_v_cardinality = ((uint8_t)(__pyx_t_4[0]));

      /* "gel/protocol/codecs/codecs.pyx":223
 *                 cardinality = <uint8_t>frb_read(spec, 1)[0]
 * 
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 223, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":225
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 225, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":224
 * 
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":226
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 * 
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 226, __pyx_L1_error)
      __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":228
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:             # <<<<<<<<<<<<<<
 *                     name = "@" + name
 *                 cpython.Py_INCREF(name)
 */
      __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_datatypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_EDGE_POINTER_IS_LINKPROP); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = PyNumber_And(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 228, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_2) {

        /* "gel/protocol/codecs/codecs.pyx":229
 * 
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:
 *                     name = "@" + name             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(name)
 *                 cpython.PyTuple_SetItem(names, i, name)
 */
        __pyx_t_8 = PyNumber_Add(__pyx_kp_u__33, __pyx_v_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "gel/protocol/codecs/codecs.pyx":228
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:             # <<<<<<<<<<<<<<
 *                     name = "@" + name
 *                 cpython.Py_INCREF(name)
 */
      }

      /* "gel/protocol/codecs/codecs.pyx":230
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:
 *                     name = "@" + name
 *                 cpython.Py_INCREF(name)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 */
      Py_INCREF(__pyx_v_name);

      /* "gel/protocol/codecs/codecs.pyx":231
 *                     name = "@" + name
 *                 cpython.Py_INCREF(name)
 *                 cpython.PyTuple_SetItem(names, i, name)             # <<<<<<<<<<<<<<
 * 
 *                 sub_codec = codecs_list[pos]
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_names, __pyx_v_i, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 231, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":233
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 *                 sub_codec = codecs_list[pos]             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 */
      if (unlikely(__pyx_v_codecs_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(7, 233, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 233, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_8));
      __pyx_t_8 = 0;

      /* "gel/protocol/codecs/codecs.pyx":234
 * 
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 */
      Py_INCREF(((PyObject *)__pyx_v_sub_codec));

      /* "gel/protocol/codecs/codecs.pyx":235
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)             # <<<<<<<<<<<<<<
 * 
 *                 cpython.Py_INCREF(flag)
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_codecs, __pyx_v_i, ((PyObject *)__pyx_v_sub_codec)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 235, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":237
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 *                 cpython.Py_INCREF(flag)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(flags, i, flag)
 * 
 */
      __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      Py_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "gel/protocol/codecs/codecs.pyx":238
 * 
 *                 cpython.Py_INCREF(flag)
 *                 cpython.PyTuple_SetItem(flags, i, flag)             # <<<<<<<<<<<<<<
 * 
 *                 cpython.Py_INCREF(cardinality)
 */
      __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_flags, __pyx_v_i, __pyx_t_8); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 238, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "gel/protocol/codecs/codecs.pyx":240
 *                 cpython.PyTuple_SetItem(flags, i, flag)
 * 
 *                 cpython.Py_INCREF(cardinality)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(cards, i, cardinality)
 * 
 */
      __pyx_t_8 = __Pyx_PyInt_From_uint8_t(__pyx_v_cardinality); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      Py_INCREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "gel/protocol/codecs/codecs.pyx":241
 * 
 *                 cpython.Py_INCREF(cardinality)
 *                 cpython.PyTuple_SetItem(cards, i, cardinality)             # <<<<<<<<<<<<<<
 * 
 *                 if protocol_version >= (2, 0):
 */
      __pyx_t_8 = __Pyx_PyInt_From_uint8_t(__pyx_v_cardinality); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 241, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_cards, __pyx_v_i, __pyx_t_8); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 241, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "gel/protocol/codecs/codecs.pyx":243
 *                 cpython.PyTuple_SetItem(cards, i, cardinality)
 * 
 *                 if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                     source_type_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      __pyx_t_8 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 243, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 243, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (__pyx_t_2) {

        /* "gel/protocol/codecs/codecs.pyx":245
 *                 if protocol_version >= (2, 0):
 *                     source_type_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                     source_type = codecs_list[source_type_pos]
 * 
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 245, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":244
 * 
 *                 if protocol_version >= (2, 0):
 *                     source_type_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                         frb_read(spec, 2))
 *                     source_type = codecs_list[source_type_pos]
 */
        __pyx_v_source_type_pos = ((uint16_t)unpack_int16(__pyx_t_4));

        /* "gel/protocol/codecs/codecs.pyx":246
 *                     source_type_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 *                     source_type = codecs_list[source_type_pos]             # <<<<<<<<<<<<<<
 * 
 *             res = ObjectCodec.new(
 */
        if (unlikely(__pyx_v_codecs_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(7, 246, __pyx_L1_error)
        }
        __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_source_type_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_XDECREF_SET(__pyx_v_source_type, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "gel/protocol/codecs/codecs.pyx":243
 *                 cpython.PyTuple_SetItem(cards, i, cardinality)
 * 
 *                 if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                     source_type_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      }
    }

    /* "gel/protocol/codecs/codecs.pyx":248
 *                     source_type = codecs_list[source_type_pos]
 * 
 *             res = ObjectCodec.new(             # <<<<<<<<<<<<<<
 *                 tid, names, flags, cards, codecs, t == CTYPE_INPUT_SHAPE
 *             )
 */
    __pyx_t_8 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_new(__pyx_v_tid, __pyx_v_names, __pyx_v_flags, __pyx_v_cards, __pyx_v_codecs, (__pyx_v_t == 8))); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "gel/protocol/codecs/codecs.pyx":209
 *             res = SetCodec.new(tid, sub_codec)
 * 
 *         elif t == CTYPE_SHAPE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 ephemeral_free_shape = <bint>frb_read(spec, 1)[0]
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":252
 *             )
 * 
 *         elif t == CTYPE_INPUT_SHAPE:             # <<<<<<<<<<<<<<
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 */
  __pyx_t_2 = (__pyx_v_t == 8);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":253
 * 
 *         elif t == CTYPE_INPUT_SHAPE:
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 253, __pyx_L1_error)
    __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":254
 *         elif t == CTYPE_INPUT_SHAPE:
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             names = cpython.PyTuple_New(els)
 *             flags = cpython.PyTuple_New(els)
 */
    __pyx_t_8 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_codecs = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/codecs/codecs.pyx":255
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             flags = cpython.PyTuple_New(els)
 *             cards = cpython.PyTuple_New(els)
 */
    __pyx_t_8 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_names = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/codecs/codecs.pyx":256
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)
 *             flags = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             cards = cpython.PyTuple_New(els)
 *             for i in range(els):
 */
    __pyx_t_8 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_flags = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/codecs/codecs.pyx":257
 *             names = cpython.PyTuple_New(els)
 *             flags = cpython.PyTuple_New(els)
 *             cards = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             for i in range(els):
 *                 flag = hton.unpack_uint32(frb_read(spec, 4))  # flags
 */
    __pyx_t_8 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_cards = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/codecs/codecs.pyx":258
 *             flags = cpython.PyTuple_New(els)
 *             cards = cpython.PyTuple_New(els)
 *             for i in range(els):             # <<<<<<<<<<<<<<
 *                 flag = hton.unpack_uint32(frb_read(spec, 4))  # flags
 *                 cardinality = <uint8_t>frb_read(spec, 1)[0]
 */
    __pyx_t_5 = __pyx_v_els;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "gel/protocol/codecs/codecs.pyx":259
 *             cards = cpython.PyTuple_New(els)
 *             for i in range(els):
 *                 flag = hton.unpack_uint32(frb_read(spec, 4))  # flags             # <<<<<<<<<<<<<<
 *                 cardinality = <uint8_t>frb_read(spec, 1)[0]
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 259, __pyx_L1_error)
      __pyx_v_flag = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":260
 *             for i in range(els):
 *                 flag = hton.unpack_uint32(frb_read(spec, 4))  # flags
 *                 cardinality = <uint8_t>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 * 
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 260, __pyx_L1_error)
      __pyx_v_cardinality = ((uint8_t)(__pyx_t_4[0]));

      /* "gel/protocol/codecs/codecs.pyx":262
 *                 cardinality = <uint8_t>frb_read(spec, 1)[0]
 * 
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 262, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":264
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 264, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":263
 * 
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_8 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "gel/protocol/codecs/codecs.pyx":265
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 * 
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 265, __pyx_L1_error)
      __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":267
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:             # <<<<<<<<<<<<<<
 *                     name = "@" + name
 *                 cpython.Py_INCREF(name)
 */
      __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_datatypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_EDGE_POINTER_IS_LINKPROP); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_9 = PyNumber_And(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 267, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_2) {

        /* "gel/protocol/codecs/codecs.pyx":268
 * 
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:
 *                     name = "@" + name             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(name)
 *                 cpython.PyTuple_SetItem(names, i, name)
 */
        __pyx_t_9 = PyNumber_Add(__pyx_kp_u__33, __pyx_v_name); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_9);
        __pyx_t_9 = 0;

        /* "gel/protocol/codecs/codecs.pyx":267
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:             # <<<<<<<<<<<<<<
 *                     name = "@" + name
 *                 cpython.Py_INCREF(name)
 */
      }

      /* "gel/protocol/codecs/codecs.pyx":269
 *                 if flag & datatypes._EDGE_POINTER_IS_LINKPROP:
 *                     name = "@" + name
 *                 cpython.Py_INCREF(name)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 */
      Py_INCREF(__pyx_v_name);

      /* "gel/protocol/codecs/codecs.pyx":270
 *                     name = "@" + name
 *                 cpython.Py_INCREF(name)
 *                 cpython.PyTuple_SetItem(names, i, name)             # <<<<<<<<<<<<<<
 * 
 *                 sub_codec = codecs_list[pos]
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_names, __pyx_v_i, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 270, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":272
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 *                 sub_codec = codecs_list[pos]             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 */
      if (unlikely(__pyx_v_codecs_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(7, 272, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 272, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9));
      __pyx_t_9 = 0;

      /* "gel/protocol/codecs/codecs.pyx":273
 * 
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 */
      Py_INCREF(((PyObject *)__pyx_v_sub_codec));

      /* "gel/protocol/codecs/codecs.pyx":274
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)             # <<<<<<<<<<<<<<
 * 
 *                 cpython.Py_INCREF(flag)
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_codecs, __pyx_v_i, ((PyObject *)__pyx_v_sub_codec)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 274, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":276
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 *                 cpython.Py_INCREF(flag)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(flags, i, flag)
 * 
 */
      __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 276, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      Py_INCREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "gel/protocol/codecs/codecs.pyx":277
 * 
 *                 cpython.Py_INCREF(flag)
 *                 cpython.PyTuple_SetItem(flags, i, flag)             # <<<<<<<<<<<<<<
 * 
 *                 cpython.Py_INCREF(cardinality)
 */
      __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_flag); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_flags, __pyx_v_i, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 277, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "gel/protocol/codecs/codecs.pyx":279
 *                 cpython.PyTuple_SetItem(flags, i, flag)
 * 
 *                 cpython.Py_INCREF(cardinality)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(cards, i, cardinality)
 * 
 */
      __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_v_cardinality); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      Py_INCREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "gel/protocol/codecs/codecs.pyx":280
 * 
 *                 cpython.Py_INCREF(cardinality)
 *                 cpython.PyTuple_SetItem(cards, i, cardinality)             # <<<<<<<<<<<<<<
 * 
 *             res = ObjectCodec.new(
 */
      __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_v_cardinality); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 280, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_cards, __pyx_v_i, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 280, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }

    /* "gel/protocol/codecs/codecs.pyx":282
 *                 cpython.PyTuple_SetItem(cards, i, cardinality)
 * 
 *             res = ObjectCodec.new(             # <<<<<<<<<<<<<<
 *                 tid, names, flags, cards, codecs, t == CTYPE_INPUT_SHAPE
 *             )
 */
    __pyx_t_9 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_new(__pyx_v_tid, __pyx_v_names, __pyx_v_flags, __pyx_v_cards, __pyx_v_codecs, (__pyx_v_t == 8))); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "gel/protocol/codecs/codecs.pyx":252
 *             )
 * 
 *         elif t == CTYPE_INPUT_SHAPE:             # <<<<<<<<<<<<<<
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":286
 *             )
 * 
 *         elif t == CTYPE_BASE_SCALAR:             # <<<<<<<<<<<<<<
 *             if tid in self.base_codec_overrides:
 *                 return self.base_codec_overrides[tid]
 */
  __pyx_t_2 = (__pyx_v_t == 2);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":287
 * 
 *         elif t == CTYPE_BASE_SCALAR:
 *             if tid in self.base_codec_overrides:             # <<<<<<<<<<<<<<
 *                 return self.base_codec_overrides[tid]
 *             else:
 */
    if (unlikely(__pyx_v_self->base_codec_overrides == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(7, 287, __pyx_L1_error)
    }
    __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_tid, __pyx_v_self->base_codec_overrides, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 287, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":288
 *         elif t == CTYPE_BASE_SCALAR:
 *             if tid in self.base_codec_overrides:
 *                 return self.base_codec_overrides[tid]             # <<<<<<<<<<<<<<
 *             else:
 *                 res = <BaseCodec>BASE_SCALAR_CODECS[tid]
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      if (unlikely(__pyx_v_self->base_codec_overrides == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(7, 288, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->base_codec_overrides, __pyx_v_tid); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 288, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9);
      __pyx_t_9 = 0;
      goto __pyx_L0;

      /* "gel/protocol/codecs/codecs.pyx":287
 * 
 *         elif t == CTYPE_BASE_SCALAR:
 *             if tid in self.base_codec_overrides:             # <<<<<<<<<<<<<<
 *                 return self.base_codec_overrides[tid]
 *             else:
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":290
 *                 return self.base_codec_overrides[tid]
 *             else:
 *                 res = <BaseCodec>BASE_SCALAR_CODECS[tid]             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_SCALAR:
 */
    /*else*/ {
      if (unlikely(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(7, 290, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS, __pyx_v_tid); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = __pyx_t_9;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
      __pyx_t_1 = 0;
    }

    /* "gel/protocol/codecs/codecs.pyx":286
 *             )
 * 
 *         elif t == CTYPE_BASE_SCALAR:             # <<<<<<<<<<<<<<
 *             if tid in self.base_codec_overrides:
 *                 return self.base_codec_overrides[tid]
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":292
 *                 res = <BaseCodec>BASE_SCALAR_CODECS[tid]
 * 
 *         elif t == CTYPE_SCALAR:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
  __pyx_t_2 = (__pyx_v_t == 3);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":293
 * 
 *         elif t == CTYPE_SCALAR:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 293, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 293, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":294
 *         elif t == CTYPE_SCALAR:
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 294, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":296
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 296, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":295
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_type_name = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":297
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 * 
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 297, __pyx_L1_error)
      __pyx_v_schema_defined = ((__pyx_t_4[0]) != 0);

      /* "gel/protocol/codecs/codecs.pyx":299
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 * 
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 ancestors = []
 *                 for _ in range(ancestor_count):
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 299, __pyx_L1_error)
      __pyx_v_ancestor_count = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":300
 * 
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 ancestors = []             # <<<<<<<<<<<<<<
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 */
      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_ancestors = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":301
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 ancestors = []
 *                 for _ in range(ancestor_count):             # <<<<<<<<<<<<<<
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      __pyx_t_5 = __pyx_v_ancestor_count;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v__ = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":303
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *                     if type(ancestor_codec) is not ScalarCodec:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 303, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":302
 *                 ancestors = []
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 */
        __pyx_v_ancestor_pos = ((uint16_t)unpack_int16(__pyx_t_4));

        /* "gel/protocol/codecs/codecs.pyx":304
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]             # <<<<<<<<<<<<<<
 *                     if type(ancestor_codec) is not ScalarCodec:
 *                         raise RuntimeError(
 */
        if (unlikely(__pyx_v_codecs_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(7, 304, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_ancestor_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 304, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_ancestor_codec, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "gel/protocol/codecs/codecs.pyx":305
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *                     if type(ancestor_codec) is not ScalarCodec:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError(
 *                             f'a scalar codec expected for base scalar type, '
 */
        __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_ancestor_codec)) != ((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec));
        if (unlikely(__pyx_t_2)) {

          /* "gel/protocol/codecs/codecs.pyx":308
 *                         raise RuntimeError(
 *                             f'a scalar codec expected for base scalar type, '
 *                             f'got {type(ancestor_codec).__name__}')             # <<<<<<<<<<<<<<
 *                     ancestors.append(ancestor_codec)
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_ancestor_codec)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 308, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 308, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "gel/protocol/codecs/codecs.pyx":307
 *                     if type(ancestor_codec) is not ScalarCodec:
 *                         raise RuntimeError(
 *                             f'a scalar codec expected for base scalar type, '             # <<<<<<<<<<<<<<
 *                             f'got {type(ancestor_codec).__name__}')
 *                     ancestors.append(ancestor_codec)
 */
          __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_a_scalar_codec_expected_for_base, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 307, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "gel/protocol/codecs/codecs.pyx":306
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *                     if type(ancestor_codec) is not ScalarCodec:
 *                         raise RuntimeError(             # <<<<<<<<<<<<<<
 *                             f'a scalar codec expected for base scalar type, '
 *                             f'got {type(ancestor_codec).__name__}')
 */
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 306, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_Raise(__pyx_t_9, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __PYX_ERR(7, 306, __pyx_L1_error)

          /* "gel/protocol/codecs/codecs.pyx":305
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *                     if type(ancestor_codec) is not ScalarCodec:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError(
 *                             f'a scalar codec expected for base scalar type, '
 */
        }

        /* "gel/protocol/codecs/codecs.pyx":309
 *                             f'a scalar codec expected for base scalar type, '
 *                             f'got {type(ancestor_codec).__name__}')
 *                     ancestors.append(ancestor_codec)             # <<<<<<<<<<<<<<
 * 
 *                 if ancestor_count == 0:
 */
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ancestors, __pyx_v_ancestor_codec); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(7, 309, __pyx_L1_error)
      }

      /* "gel/protocol/codecs/codecs.pyx":311
 *                     ancestors.append(ancestor_codec)
 * 
 *                 if ancestor_count == 0:             # <<<<<<<<<<<<<<
 *                     if tid in self.base_codec_overrides:
 *                         res = self.base_codec_overrides[tid]
 */
      __pyx_t_2 = (__pyx_v_ancestor_count == 0);
      if (__pyx_t_2) {

        /* "gel/protocol/codecs/codecs.pyx":312
 * 
 *                 if ancestor_count == 0:
 *                     if tid in self.base_codec_overrides:             # <<<<<<<<<<<<<<
 *                         res = self.base_codec_overrides[tid]
 *                     else:
 */
        if (unlikely(__pyx_v_self->base_codec_overrides == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
          __PYX_ERR(7, 312, __pyx_L1_error)
        }
        __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_tid, __pyx_v_self->base_codec_overrides, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 312, __pyx_L1_error)
        if (__pyx_t_2) {

          /* "gel/protocol/codecs/codecs.pyx":313
 *                 if ancestor_count == 0:
 *                     if tid in self.base_codec_overrides:
 *                         res = self.base_codec_overrides[tid]             # <<<<<<<<<<<<<<
 *                     else:
 *                         res = <BaseCodec>BASE_SCALAR_CODECS[tid]
 */
          if (unlikely(__pyx_v_self->base_codec_overrides == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(7, 313, __pyx_L1_error)
          }
          __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_self->base_codec_overrides, __pyx_v_tid); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 313, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 313, __pyx_L1_error)
          __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9));
          __pyx_t_9 = 0;

          /* "gel/protocol/codecs/codecs.pyx":312
 * 
 *                 if ancestor_count == 0:
 *                     if tid in self.base_codec_overrides:             # <<<<<<<<<<<<<<
 *                         res = self.base_codec_overrides[tid]
 *                     else:
 */
          goto __pyx_L34;
        }

        /* "gel/protocol/codecs/codecs.pyx":315
 *                         res = self.base_codec_overrides[tid]
 *                     else:
 *                         res = <BaseCodec>BASE_SCALAR_CODECS[tid]             # <<<<<<<<<<<<<<
 *                 else:
 *                     fundamental_codec = ancestors[-1]
 */
        /*else*/ {
          if (unlikely(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(7, 315, __pyx_L1_error)
          }
          __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS, __pyx_v_tid); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_1 = __pyx_t_9;
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
          __pyx_t_1 = 0;
        }
        __pyx_L34:;

        /* "gel/protocol/codecs/codecs.pyx":311
 *                     ancestors.append(ancestor_codec)
 * 
 *                 if ancestor_count == 0:             # <<<<<<<<<<<<<<
 *                     if tid in self.base_codec_overrides:
 *                         res = self.base_codec_overrides[tid]
 */
        goto __pyx_L33;
      }

      /* "gel/protocol/codecs/codecs.pyx":317
 *                         res = <BaseCodec>BASE_SCALAR_CODECS[tid]
 *                 else:
 *                     fundamental_codec = ancestors[-1]             # <<<<<<<<<<<<<<
 *                     if type(fundamental_codec) is not ScalarCodec:
 *                         raise RuntimeError(
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_ancestors, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 317, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_v_fundamental_codec = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "gel/protocol/codecs/codecs.pyx":318
 *                 else:
 *                     fundamental_codec = ancestors[-1]
 *                     if type(fundamental_codec) is not ScalarCodec:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError(
 *                             f'a scalar codec expected for base scalar type, '
 */
        __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_fundamental_codec)) != ((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec));
        if (unlikely(__pyx_t_2)) {

          /* "gel/protocol/codecs/codecs.pyx":321
 *                         raise RuntimeError(
 *                             f'a scalar codec expected for base scalar type, '
 *                             f'got {type(fundamental_codec).__name__}')             # <<<<<<<<<<<<<<
 *                     res = (<ScalarCodec>fundamental_codec).derive(tid)
 *                 res.type_name = type_name
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_fundamental_codec)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 321, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "gel/protocol/codecs/codecs.pyx":320
 *                     if type(fundamental_codec) is not ScalarCodec:
 *                         raise RuntimeError(
 *                             f'a scalar codec expected for base scalar type, '             # <<<<<<<<<<<<<<
 *                             f'got {type(fundamental_codec).__name__}')
 *                     res = (<ScalarCodec>fundamental_codec).derive(tid)
 */
          __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_a_scalar_codec_expected_for_base, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 320, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

          /* "gel/protocol/codecs/codecs.pyx":319
 *                     fundamental_codec = ancestors[-1]
 *                     if type(fundamental_codec) is not ScalarCodec:
 *                         raise RuntimeError(             # <<<<<<<<<<<<<<
 *                             f'a scalar codec expected for base scalar type, '
 *                             f'got {type(fundamental_codec).__name__}')
 */
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 319, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_Raise(__pyx_t_9, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __PYX_ERR(7, 319, __pyx_L1_error)

          /* "gel/protocol/codecs/codecs.pyx":318
 *                 else:
 *                     fundamental_codec = ancestors[-1]
 *                     if type(fundamental_codec) is not ScalarCodec:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError(
 *                             f'a scalar codec expected for base scalar type, '
 */
        }

        /* "gel/protocol/codecs/codecs.pyx":322
 *                             f'a scalar codec expected for base scalar type, '
 *                             f'got {type(fundamental_codec).__name__}')
 *                     res = (<ScalarCodec>fundamental_codec).derive(tid)             # <<<<<<<<<<<<<<
 *                 res.type_name = type_name
 *             else:
 */
        __pyx_t_9 = __pyx_f_3gel_8protocol_8protocol_11ScalarCodec_derive(((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)__pyx_v_fundamental_codec), __pyx_v_tid); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 322, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 322, __pyx_L1_error)
        __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9));
        __pyx_t_9 = 0;
      }
      __pyx_L33:;

      /* "gel/protocol/codecs/codecs.pyx":323
 *                             f'got {type(fundamental_codec).__name__}')
 *                     res = (<ScalarCodec>fundamental_codec).derive(tid)
 *                 res.type_name = type_name             # <<<<<<<<<<<<<<
 *             else:
 *                 fundamental_pos = <uint16_t>hton.unpack_int16(
 */
      if (!(likely(PyUnicode_CheckExact(__pyx_v_type_name))||((__pyx_v_type_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_type_name))) __PYX_ERR(7, 323, __pyx_L1_error)
      __pyx_t_9 = __pyx_v_type_name;
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_v_res->type_name);
      __Pyx_DECREF(__pyx_v_res->type_name);
      __pyx_v_res->type_name = ((PyObject*)__pyx_t_9);
      __pyx_t_9 = 0;

      /* "gel/protocol/codecs/codecs.pyx":293
 * 
 *         elif t == CTYPE_SCALAR:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
      goto __pyx_L29;
    }

    /* "gel/protocol/codecs/codecs.pyx":325
 *                 res.type_name = type_name
 *             else:
 *                 fundamental_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, 2))
 *                 fundamental_codec = codecs_list[fundamental_pos]
 */
    /*else*/ {

      /* "gel/protocol/codecs/codecs.pyx":326
 *             else:
 *                 fundamental_pos = <uint16_t>hton.unpack_int16(
 *                     frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 fundamental_codec = codecs_list[fundamental_pos]
 *                 if type(fundamental_codec) is not ScalarCodec:
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 326, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":325
 *                 res.type_name = type_name
 *             else:
 *                 fundamental_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, 2))
 *                 fundamental_codec = codecs_list[fundamental_pos]
 */
      __pyx_v_fundamental_pos = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":327
 *                 fundamental_pos = <uint16_t>hton.unpack_int16(
 *                     frb_read(spec, 2))
 *                 fundamental_codec = codecs_list[fundamental_pos]             # <<<<<<<<<<<<<<
 *                 if type(fundamental_codec) is not ScalarCodec:
 *                     raise RuntimeError(
 */
      if (unlikely(__pyx_v_codecs_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(7, 327, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_fundamental_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_v_fundamental_codec = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "gel/protocol/codecs/codecs.pyx":328
 *                     frb_read(spec, 2))
 *                 fundamental_codec = codecs_list[fundamental_pos]
 *                 if type(fundamental_codec) is not ScalarCodec:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'a scalar codec expected for base scalar type, '
 */
      __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_fundamental_codec)) != ((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec));
      if (unlikely(__pyx_t_2)) {

        /* "gel/protocol/codecs/codecs.pyx":331
 *                     raise RuntimeError(
 *                         f'a scalar codec expected for base scalar type, '
 *                         f'got {type(fundamental_codec).__name__}')             # <<<<<<<<<<<<<<
 *                 res = (<ScalarCodec>fundamental_codec).derive(tid)
 * 
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_fundamental_codec)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 331, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 331, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "gel/protocol/codecs/codecs.pyx":330
 *                 if type(fundamental_codec) is not ScalarCodec:
 *                     raise RuntimeError(
 *                         f'a scalar codec expected for base scalar type, '             # <<<<<<<<<<<<<<
 *                         f'got {type(fundamental_codec).__name__}')
 *                 res = (<ScalarCodec>fundamental_codec).derive(tid)
 */
        __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_kp_u_a_scalar_codec_expected_for_base, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 330, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "gel/protocol/codecs/codecs.pyx":329
 *                 fundamental_codec = codecs_list[fundamental_pos]
 *                 if type(fundamental_codec) is not ScalarCodec:
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'a scalar codec expected for base scalar type, '
 *                         f'got {type(fundamental_codec).__name__}')
 */
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(7, 329, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":328
 *                     frb_read(spec, 2))
 *                 fundamental_codec = codecs_list[fundamental_pos]
 *                 if type(fundamental_codec) is not ScalarCodec:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'a scalar codec expected for base scalar type, '
 */
      }

      /* "gel/protocol/codecs/codecs.pyx":332
 *                         f'a scalar codec expected for base scalar type, '
 *                         f'got {type(fundamental_codec).__name__}')
 *                 res = (<ScalarCodec>fundamental_codec).derive(tid)             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_TUPLE:
 */
      __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_11ScalarCodec_derive(((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)__pyx_v_fundamental_codec), __pyx_v_tid); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 332, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
      __pyx_t_1 = 0;
    }
    __pyx_L29:;

    /* "gel/protocol/codecs/codecs.pyx":292
 *                 res = <BaseCodec>BASE_SCALAR_CODECS[tid]
 * 
 *         elif t == CTYPE_SCALAR:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":334
 *                 res = (<ScalarCodec>fundamental_codec).derive(tid)
 * 
 *         elif t == CTYPE_TUPLE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
  __pyx_t_2 = (__pyx_v_t == 4);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":335
 * 
 *         elif t == CTYPE_TUPLE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 335, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":336
 *         elif t == CTYPE_TUPLE:
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 336, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":338
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 338, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":337
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_type_name = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":339
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 339, __pyx_L1_error)
      __pyx_v_schema_defined = ((__pyx_t_4[0]) != 0);

      /* "gel/protocol/codecs/codecs.pyx":340
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 340, __pyx_L1_error)
      __pyx_v_ancestor_count = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":341
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):             # <<<<<<<<<<<<<<
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      __pyx_t_5 = __pyx_v_ancestor_count;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v__ = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":343
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 343, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":342
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 */
        __pyx_v_ancestor_pos = ((uint16_t)unpack_int16(__pyx_t_4));

        /* "gel/protocol/codecs/codecs.pyx":344
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]             # <<<<<<<<<<<<<<
 *             else:
 *                 type_name = None
 */
        if (unlikely(__pyx_v_codecs_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(7, 344, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_ancestor_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 344, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_ancestor_codec, __pyx_t_1);
        __pyx_t_1 = 0;
      }

      /* "gel/protocol/codecs/codecs.pyx":335
 * 
 *         elif t == CTYPE_TUPLE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
      goto __pyx_L37;
    }

    /* "gel/protocol/codecs/codecs.pyx":346
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 *                 type_name = None             # <<<<<<<<<<<<<<
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __pyx_v_type_name = Py_None;
    }
    __pyx_L37:;

    /* "gel/protocol/codecs/codecs.pyx":347
 *             else:
 *                 type_name = None
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             codecs = cpython.PyTuple_New(els)
 *             for i in range(els):
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 347, __pyx_L1_error)
    __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":348
 *                 type_name = None
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             for i in range(els):
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_codecs = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":349
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 *             for i in range(els):             # <<<<<<<<<<<<<<
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 */
    __pyx_t_5 = __pyx_v_els;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "gel/protocol/codecs/codecs.pyx":350
 *             codecs = cpython.PyTuple_New(els)
 *             for i in range(els):
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 * 
 *                 sub_codec = codecs_list[pos]
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 350, __pyx_L1_error)
      __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":352
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 *                 sub_codec = codecs_list[pos]             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 */
      if (unlikely(__pyx_v_codecs_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(7, 352, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 352, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 352, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":353
 * 
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 */
      Py_INCREF(((PyObject *)__pyx_v_sub_codec));

      /* "gel/protocol/codecs/codecs.pyx":354
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)             # <<<<<<<<<<<<<<
 * 
 *             res = TupleCodec.new(tid, codecs)
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_codecs, __pyx_v_i, ((PyObject *)__pyx_v_sub_codec)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 354, __pyx_L1_error)
    }

    /* "gel/protocol/codecs/codecs.pyx":356
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 *             res = TupleCodec.new(tid, codecs)             # <<<<<<<<<<<<<<
 *             res.type_name = type_name
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_10TupleCodec_new(__pyx_v_tid, __pyx_v_codecs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":357
 * 
 *             res = TupleCodec.new(tid, codecs)
 *             res.type_name = type_name             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_NAMEDTUPLE:
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_type_name))||((__pyx_v_type_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_type_name))) __PYX_ERR(7, 357, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_type_name;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_res->type_name);
    __Pyx_DECREF(__pyx_v_res->type_name);
    __pyx_v_res->type_name = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":334
 *                 res = (<ScalarCodec>fundamental_codec).derive(tid)
 * 
 *         elif t == CTYPE_TUPLE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":359
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_NAMEDTUPLE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
  __pyx_t_2 = (__pyx_v_t == 5);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":360
 * 
 *         elif t == CTYPE_NAMEDTUPLE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 360, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 360, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":361
 *         elif t == CTYPE_NAMEDTUPLE:
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 361, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":363
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 363, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":362
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 362, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_type_name = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":364
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 364, __pyx_L1_error)
      __pyx_v_schema_defined = ((__pyx_t_4[0]) != 0);

      /* "gel/protocol/codecs/codecs.pyx":365
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 365, __pyx_L1_error)
      __pyx_v_ancestor_count = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":366
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):             # <<<<<<<<<<<<<<
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      __pyx_t_5 = __pyx_v_ancestor_count;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v__ = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":368
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 368, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":367
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 */
        __pyx_v_ancestor_pos = ((uint16_t)unpack_int16(__pyx_t_4));

        /* "gel/protocol/codecs/codecs.pyx":369
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]             # <<<<<<<<<<<<<<
 *             else:
 *                 type_name = None
 */
        if (unlikely(__pyx_v_codecs_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(7, 369, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_ancestor_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 369, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_ancestor_codec, __pyx_t_1);
        __pyx_t_1 = 0;
      }

      /* "gel/protocol/codecs/codecs.pyx":360
 * 
 *         elif t == CTYPE_NAMEDTUPLE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
      goto __pyx_L42;
    }

    /* "gel/protocol/codecs/codecs.pyx":371
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 *                 type_name = None             # <<<<<<<<<<<<<<
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __pyx_v_type_name = Py_None;
    }
    __pyx_L42:;

    /* "gel/protocol/codecs/codecs.pyx":372
 *             else:
 *                 type_name = None
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 372, __pyx_L1_error)
    __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":373
 *                 type_name = None
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_codecs = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":374
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_names = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":375
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_5 = __pyx_v_els;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "gel/protocol/codecs/codecs.pyx":376
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 376, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":378
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 378, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":377
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 377, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":379
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 * 
 *                 cpython.Py_INCREF(name)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 379, __pyx_L1_error)
      __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":381
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 *                 cpython.Py_INCREF(name)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 */
      Py_INCREF(__pyx_v_name);

      /* "gel/protocol/codecs/codecs.pyx":382
 * 
 *                 cpython.Py_INCREF(name)
 *                 cpython.PyTuple_SetItem(names, i, name)             # <<<<<<<<<<<<<<
 * 
 *                 sub_codec = codecs_list[pos]
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_names, __pyx_v_i, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 382, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":384
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 *                 sub_codec = codecs_list[pos]             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 */
      if (unlikely(__pyx_v_codecs_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(7, 384, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 384, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 384, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":385
 * 
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 */
      Py_INCREF(((PyObject *)__pyx_v_sub_codec));

      /* "gel/protocol/codecs/codecs.pyx":386
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)             # <<<<<<<<<<<<<<
 * 
 *             res = NamedTupleCodec.new(tid, names, codecs)
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_codecs, __pyx_v_i, ((PyObject *)__pyx_v_sub_codec)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 386, __pyx_L1_error)
    }

    /* "gel/protocol/codecs/codecs.pyx":388
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 *             res = NamedTupleCodec.new(tid, names, codecs)             # <<<<<<<<<<<<<<
 *             res.type_name = type_name
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_15NamedTupleCodec_new(__pyx_v_tid, __pyx_v_names, __pyx_v_codecs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":389
 * 
 *             res = NamedTupleCodec.new(tid, names, codecs)
 *             res.type_name = type_name             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_SQL_ROW:
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_type_name))||((__pyx_v_type_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_type_name))) __PYX_ERR(7, 389, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_type_name;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_res->type_name);
    __Pyx_DECREF(__pyx_v_res->type_name);
    __pyx_v_res->type_name = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":359
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_NAMEDTUPLE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":391
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_SQL_ROW:             # <<<<<<<<<<<<<<
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 */
  __pyx_t_2 = (__pyx_v_t == 13);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":392
 * 
 *         elif t == CTYPE_SQL_ROW:
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 392, __pyx_L1_error)
    __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":393
 *         elif t == CTYPE_SQL_ROW:
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_codecs = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":394
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 394, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_names = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":395
 *             codecs = cpython.PyTuple_New(els)
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_5 = __pyx_v_els;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "gel/protocol/codecs/codecs.pyx":396
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 396, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":398
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 398, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":397
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 397, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":399
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 * 
 *                 cpython.Py_INCREF(name)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 399, __pyx_L1_error)
      __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":401
 *                 pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 * 
 *                 cpython.Py_INCREF(name)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 */
      Py_INCREF(__pyx_v_name);

      /* "gel/protocol/codecs/codecs.pyx":402
 * 
 *                 cpython.Py_INCREF(name)
 *                 cpython.PyTuple_SetItem(names, i, name)             # <<<<<<<<<<<<<<
 * 
 *                 sub_codec = codecs_list[pos]
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_names, __pyx_v_i, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 402, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":404
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 *                 sub_codec = codecs_list[pos]             # <<<<<<<<<<<<<<
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 */
      if (unlikely(__pyx_v_codecs_list == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(7, 404, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 404, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_sub_codec, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":405
 * 
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 */
      Py_INCREF(((PyObject *)__pyx_v_sub_codec));

      /* "gel/protocol/codecs/codecs.pyx":406
 *                 sub_codec = codecs_list[pos]
 *                 cpython.Py_INCREF(sub_codec)
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)             # <<<<<<<<<<<<<<
 * 
 *             res = RecordCodec.new(tid, names, codecs)
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_codecs, __pyx_v_i, ((PyObject *)__pyx_v_sub_codec)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 406, __pyx_L1_error)
    }

    /* "gel/protocol/codecs/codecs.pyx":408
 *                 cpython.PyTuple_SetItem(codecs, i, sub_codec)
 * 
 *             res = RecordCodec.new(tid, names, codecs)             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_ENUM:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_11RecordCodec_new(__pyx_v_tid, __pyx_v_names, __pyx_v_codecs)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":391
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_SQL_ROW:             # <<<<<<<<<<<<<<
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             codecs = cpython.PyTuple_New(els)
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":410
 *             res = RecordCodec.new(tid, names, codecs)
 * 
 *         elif t == CTYPE_ENUM:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
  __pyx_t_2 = (__pyx_v_t == 7);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":411
 * 
 *         elif t == CTYPE_ENUM:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 411, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 411, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":412
 *         elif t == CTYPE_ENUM:
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 412, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":414
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 414, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":413
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 413, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_type_name = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":415
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 415, __pyx_L1_error)
      __pyx_v_schema_defined = ((__pyx_t_4[0]) != 0);

      /* "gel/protocol/codecs/codecs.pyx":416
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 416, __pyx_L1_error)
      __pyx_v_ancestor_count = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":417
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):             # <<<<<<<<<<<<<<
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      __pyx_t_5 = __pyx_v_ancestor_count;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v__ = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":419
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 419, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":418
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 */
        __pyx_v_ancestor_pos = ((uint16_t)unpack_int16(__pyx_t_4));

        /* "gel/protocol/codecs/codecs.pyx":420
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]             # <<<<<<<<<<<<<<
 *             else:
 *                 type_name = None
 */
        if (unlikely(__pyx_v_codecs_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(7, 420, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_ancestor_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_ancestor_codec, __pyx_t_1);
        __pyx_t_1 = 0;
      }

      /* "gel/protocol/codecs/codecs.pyx":411
 * 
 *         elif t == CTYPE_ENUM:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
      goto __pyx_L49;
    }

    /* "gel/protocol/codecs/codecs.pyx":422
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 *                 type_name = None             # <<<<<<<<<<<<<<
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             names = cpython.PyTuple_New(els)
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __pyx_v_type_name = Py_None;
    }
    __pyx_L49:;

    /* "gel/protocol/codecs/codecs.pyx":423
 *             else:
 *                 type_name = None
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 423, __pyx_L1_error)
    __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":424
 *                 type_name = None
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             names = cpython.PyTuple_New(els)             # <<<<<<<<<<<<<<
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    __pyx_t_1 = PyTuple_New(__pyx_v_els); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 424, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_names = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":425
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_5 = __pyx_v_els;
    __pyx_t_6 = __pyx_t_5;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_i = __pyx_t_7;

      /* "gel/protocol/codecs/codecs.pyx":426
 *             names = cpython.PyTuple_New(els)
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 426, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":428
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 * 
 *                 cpython.Py_INCREF(name)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 428, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":427
 *             for i in range(els):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 * 
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":430
 *                     frb_read(spec, str_len), str_len)
 * 
 *                 cpython.Py_INCREF(name)             # <<<<<<<<<<<<<<
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 */
      Py_INCREF(__pyx_v_name);

      /* "gel/protocol/codecs/codecs.pyx":431
 * 
 *                 cpython.Py_INCREF(name)
 *                 cpython.PyTuple_SetItem(names, i, name)             # <<<<<<<<<<<<<<
 * 
 *             res = EnumCodec.new(tid, names)
 */
      __pyx_t_10 = PyTuple_SetItem(__pyx_v_names, __pyx_v_i, __pyx_v_name); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(7, 431, __pyx_L1_error)
    }

    /* "gel/protocol/codecs/codecs.pyx":433
 *                 cpython.PyTuple_SetItem(names, i, name)
 * 
 *             res = EnumCodec.new(tid, names)             # <<<<<<<<<<<<<<
 *             res.type_name = type_name
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_9EnumCodec_new(__pyx_v_tid, __pyx_v_names)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":434
 * 
 *             res = EnumCodec.new(tid, names)
 *             res.type_name = type_name             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_ARRAY:
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_type_name))||((__pyx_v_type_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_type_name))) __PYX_ERR(7, 434, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_type_name;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_res->type_name);
    __Pyx_DECREF(__pyx_v_res->type_name);
    __pyx_v_res->type_name = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":410
 *             res = RecordCodec.new(tid, names, codecs)
 * 
 *         elif t == CTYPE_ENUM:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":436
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_ARRAY:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
  __pyx_t_2 = (__pyx_v_t == 6);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":437
 * 
 *         elif t == CTYPE_ARRAY:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 437, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 437, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":438
 *         elif t == CTYPE_ARRAY:
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 438, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":440
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 440, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":439
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_type_name = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":441
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 441, __pyx_L1_error)
      __pyx_v_schema_defined = ((__pyx_t_4[0]) != 0);

      /* "gel/protocol/codecs/codecs.pyx":442
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 442, __pyx_L1_error)
      __pyx_v_ancestor_count = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":443
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):             # <<<<<<<<<<<<<<
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      __pyx_t_5 = __pyx_v_ancestor_count;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v__ = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":445
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 445, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":444
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 */
        __pyx_v_ancestor_pos = ((uint16_t)unpack_int16(__pyx_t_4));

        /* "gel/protocol/codecs/codecs.pyx":446
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]             # <<<<<<<<<<<<<<
 *             else:
 *                 type_name = None
 */
        if (unlikely(__pyx_v_codecs_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(7, 446, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_ancestor_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 446, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_ancestor_codec, __pyx_t_1);
        __pyx_t_1 = 0;
      }

      /* "gel/protocol/codecs/codecs.pyx":437
 * 
 *         elif t == CTYPE_ARRAY:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
      goto __pyx_L54;
    }

    /* "gel/protocol/codecs/codecs.pyx":448
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 *                 type_name = None             # <<<<<<<<<<<<<<
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __pyx_v_type_name = Py_None;
    }
    __pyx_L54:;

    /* "gel/protocol/codecs/codecs.pyx":449
 *             else:
 *                 type_name = None
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             if els != 1:
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 449, __pyx_L1_error)
    __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":450
 *                 type_name = None
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             if els != 1:
 *                 raise NotImplementedError(
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 450, __pyx_L1_error)
    __pyx_v_els = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":451
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             if els != 1:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     'cannot handle arrays with more than one dimension')
 */
    __pyx_t_2 = (__pyx_v_els != 1);
    if (unlikely(__pyx_t_2)) {

      /* "gel/protocol/codecs/codecs.pyx":452
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             if els != 1:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     'cannot handle arrays with more than one dimension')
 *             # First dimension length.
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 452, __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(7, 452, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":451
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             if els != 1:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     'cannot handle arrays with more than one dimension')
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":455
 *                     'cannot handle arrays with more than one dimension')
 *             # First dimension length.
 *             dim_len = hton.unpack_int32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = ArrayCodec.new(tid, sub_codec, dim_len)
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 455, __pyx_L1_error)
    __pyx_v_dim_len = unpack_int32(__pyx_t_4);

    /* "gel/protocol/codecs/codecs.pyx":456
 *             # First dimension length.
 *             dim_len = hton.unpack_int32(frb_read(spec, 4))
 *             sub_codec = <BaseCodec>codecs_list[pos]             # <<<<<<<<<<<<<<
 *             res = ArrayCodec.new(tid, sub_codec, dim_len)
 *             res.type_name = type_name
 */
    if (unlikely(__pyx_v_codecs_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(7, 456, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 456, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "gel/protocol/codecs/codecs.pyx":457
 *             dim_len = hton.unpack_int32(frb_read(spec, 4))
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = ArrayCodec.new(tid, sub_codec, dim_len)             # <<<<<<<<<<<<<<
 *             res.type_name = type_name
 * 
 */
    __pyx_t_9 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_10ArrayCodec_new(__pyx_v_tid, __pyx_v_sub_codec, __pyx_v_dim_len)); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "gel/protocol/codecs/codecs.pyx":458
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = ArrayCodec.new(tid, sub_codec, dim_len)
 *             res.type_name = type_name             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_RANGE:
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_type_name))||((__pyx_v_type_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_type_name))) __PYX_ERR(7, 458, __pyx_L1_error)
    __pyx_t_9 = __pyx_v_type_name;
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __Pyx_GOTREF(__pyx_v_res->type_name);
    __Pyx_DECREF(__pyx_v_res->type_name);
    __pyx_v_res->type_name = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "gel/protocol/codecs/codecs.pyx":436
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_ARRAY:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":460
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_RANGE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
  __pyx_t_2 = (__pyx_v_t == 9);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":461
 * 
 *         elif t == CTYPE_RANGE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_9 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 461, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":462
 *         elif t == CTYPE_RANGE:
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 462, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":464
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 464, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":463
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 */
      __pyx_t_9 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_v_type_name = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "gel/protocol/codecs/codecs.pyx":465
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 465, __pyx_L1_error)
      __pyx_v_schema_defined = ((__pyx_t_4[0]) != 0);

      /* "gel/protocol/codecs/codecs.pyx":466
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 466, __pyx_L1_error)
      __pyx_v_ancestor_count = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":467
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):             # <<<<<<<<<<<<<<
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      __pyx_t_5 = __pyx_v_ancestor_count;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v__ = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":469
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 469, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":468
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 */
        __pyx_v_ancestor_pos = ((uint16_t)unpack_int16(__pyx_t_4));

        /* "gel/protocol/codecs/codecs.pyx":470
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]             # <<<<<<<<<<<<<<
 *             else:
 *                 type_name = None
 */
        if (unlikely(__pyx_v_codecs_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(7, 470, __pyx_L1_error)
        }
        __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_ancestor_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 470, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XDECREF_SET(__pyx_v_ancestor_codec, __pyx_t_9);
        __pyx_t_9 = 0;
      }

      /* "gel/protocol/codecs/codecs.pyx":461
 * 
 *         elif t == CTYPE_RANGE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
      goto __pyx_L58;
    }

    /* "gel/protocol/codecs/codecs.pyx":472
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 *                 type_name = None             # <<<<<<<<<<<<<<
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __pyx_v_type_name = Py_None;
    }
    __pyx_L58:;

    /* "gel/protocol/codecs/codecs.pyx":473
 *             else:
 *                 type_name = None
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = RangeCodec.new(tid, sub_codec)
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 473, __pyx_L1_error)
    __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":474
 *                 type_name = None
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]             # <<<<<<<<<<<<<<
 *             res = RangeCodec.new(tid, sub_codec)
 *             res.type_name = type_name
 */
    if (unlikely(__pyx_v_codecs_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(7, 474, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __pyx_t_9;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_v_sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":475
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = RangeCodec.new(tid, sub_codec)             # <<<<<<<<<<<<<<
 *             res.type_name = type_name
 * 
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_10RangeCodec_new(__pyx_v_tid, __pyx_v_sub_codec)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 475, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":476
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = RangeCodec.new(tid, sub_codec)
 *             res.type_name = type_name             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_MULTIRANGE:
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_type_name))||((__pyx_v_type_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_type_name))) __PYX_ERR(7, 476, __pyx_L1_error)
    __pyx_t_1 = __pyx_v_type_name;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(__pyx_v_res->type_name);
    __Pyx_DECREF(__pyx_v_res->type_name);
    __pyx_v_res->type_name = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":460
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_RANGE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":478
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_MULTIRANGE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
  __pyx_t_2 = (__pyx_v_t == 12);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":479
 * 
 *         elif t == CTYPE_MULTIRANGE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 479, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 479, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":480
 *         elif t == CTYPE_MULTIRANGE:
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))             # <<<<<<<<<<<<<<
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 4); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 480, __pyx_L1_error)
      __pyx_v_str_len = unpack_uint32(__pyx_t_4);

      /* "gel/protocol/codecs/codecs.pyx":482
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)             # <<<<<<<<<<<<<<
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_str_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 482, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":481
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(             # <<<<<<<<<<<<<<
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 */
      __pyx_t_1 = PyUnicode_FromStringAndSize(__pyx_t_4, __pyx_v_str_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_type_name = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "gel/protocol/codecs/codecs.pyx":483
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]             # <<<<<<<<<<<<<<
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 1); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 483, __pyx_L1_error)
      __pyx_v_schema_defined = ((__pyx_t_4[0]) != 0);

      /* "gel/protocol/codecs/codecs.pyx":484
 *                     frb_read(spec, str_len), str_len)
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 */
      __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 484, __pyx_L1_error)
      __pyx_v_ancestor_count = ((uint16_t)unpack_int16(__pyx_t_4));

      /* "gel/protocol/codecs/codecs.pyx":485
 *                 schema_defined = <bint>frb_read(spec, 1)[0]
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):             # <<<<<<<<<<<<<<
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 */
      __pyx_t_5 = __pyx_v_ancestor_count;
      __pyx_t_6 = __pyx_t_5;
      for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
        __pyx_v__ = __pyx_t_7;

        /* "gel/protocol/codecs/codecs.pyx":487
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 */
        __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 487, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":486
 *                 ancestor_count = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 for _ in range(ancestor_count):
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(             # <<<<<<<<<<<<<<
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]
 */
        __pyx_v_ancestor_pos = ((uint16_t)unpack_int16(__pyx_t_4));

        /* "gel/protocol/codecs/codecs.pyx":488
 *                     ancestor_pos = <uint16_t>hton.unpack_int16(
 *                         frb_read(spec, 2))
 *                     ancestor_codec = codecs_list[ancestor_pos]             # <<<<<<<<<<<<<<
 *             else:
 *                 type_name = None
 */
        if (unlikely(__pyx_v_codecs_list == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(7, 488, __pyx_L1_error)
        }
        __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_ancestor_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_ancestor_codec, __pyx_t_1);
        __pyx_t_1 = 0;
      }

      /* "gel/protocol/codecs/codecs.pyx":479
 * 
 *         elif t == CTYPE_MULTIRANGE:
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 *                 type_name = cpythonx.PyUnicode_FromStringAndSize(
 */
      goto __pyx_L61;
    }

    /* "gel/protocol/codecs/codecs.pyx":490
 *                     ancestor_codec = codecs_list[ancestor_pos]
 *             else:
 *                 type_name = None             # <<<<<<<<<<<<<<
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __pyx_v_type_name = Py_None;
    }
    __pyx_L61:;

    /* "gel/protocol/codecs/codecs.pyx":491
 *             else:
 *                 type_name = None
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))             # <<<<<<<<<<<<<<
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = MultiRangeCodec.new(tid, sub_codec)
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, 2); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 491, __pyx_L1_error)
    __pyx_v_pos = ((uint16_t)unpack_int16(__pyx_t_4));

    /* "gel/protocol/codecs/codecs.pyx":492
 *                 type_name = None
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]             # <<<<<<<<<<<<<<
 *             res = MultiRangeCodec.new(tid, sub_codec)
 *             res.type_name = type_name
 */
    if (unlikely(__pyx_v_codecs_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(7, 492, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, __pyx_v_pos, uint16_t, 0, __Pyx_PyInt_From_uint16_t, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 492, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = __pyx_t_1;
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "gel/protocol/codecs/codecs.pyx":493
 *             pos = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = MultiRangeCodec.new(tid, sub_codec)             # <<<<<<<<<<<<<<
 *             res.type_name = type_name
 * 
 */
    __pyx_t_9 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_new(__pyx_v_tid, __pyx_v_sub_codec)); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "gel/protocol/codecs/codecs.pyx":494
 *             sub_codec = <BaseCodec>codecs_list[pos]
 *             res = MultiRangeCodec.new(tid, sub_codec)
 *             res.type_name = type_name             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_OBJECT and protocol_version >= (2, 0):
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_v_type_name))||((__pyx_v_type_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_type_name))) __PYX_ERR(7, 494, __pyx_L1_error)
    __pyx_t_9 = __pyx_v_type_name;
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __Pyx_GOTREF(__pyx_v_res->type_name);
    __Pyx_DECREF(__pyx_v_res->type_name);
    __pyx_v_res->type_name = ((PyObject*)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "gel/protocol/codecs/codecs.pyx":478
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_MULTIRANGE:             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 str_len = hton.unpack_uint32(frb_read(spec, 4))
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":496
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_OBJECT and protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *             # Ignore
 *             frb_read(spec, desc_len)
 */
  __pyx_t_12 = (__pyx_v_t == 10);
  if (__pyx_t_12) {
  } else {
    __pyx_t_2 = __pyx_t_12;
    goto __pyx_L64_bool_binop_done;
  }
  __pyx_t_9 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 496, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(7, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_2 = __pyx_t_12;
  __pyx_L64_bool_binop_done:;
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":498
 *         elif t == CTYPE_OBJECT and protocol_version >= (2, 0):
 *             # Ignore
 *             frb_read(spec, desc_len)             # <<<<<<<<<<<<<<
 *             res = NULL_CODEC
 * 
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_desc_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 498, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":499
 *             # Ignore
 *             frb_read(spec, desc_len)
 *             res = NULL_CODEC             # <<<<<<<<<<<<<<
 * 
 *         elif t == CTYPE_COMPOUND and protocol_version >= (2, 0):
 */
    __Pyx_INCREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_NULL_CODEC);
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_v_3gel_8protocol_8protocol_NULL_CODEC);

    /* "gel/protocol/codecs/codecs.pyx":496
 *             res.type_name = type_name
 * 
 *         elif t == CTYPE_OBJECT and protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *             # Ignore
 *             frb_read(spec, desc_len)
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":501
 *             res = NULL_CODEC
 * 
 *         elif t == CTYPE_COMPOUND and protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *             # Ignore
 *             frb_read(spec, desc_len)
 */
  __pyx_t_12 = (__pyx_v_t == 11);
  if (__pyx_t_12) {
  } else {
    __pyx_t_2 = __pyx_t_12;
    goto __pyx_L66_bool_binop_done;
  }
  __pyx_t_9 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 501, __pyx_L1_error)
  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(7, 501, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_2 = __pyx_t_12;
  __pyx_L66_bool_binop_done:;
  if (likely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":503
 *         elif t == CTYPE_COMPOUND and protocol_version >= (2, 0):
 *             # Ignore
 *             frb_read(spec, desc_len)             # <<<<<<<<<<<<<<
 *             res = NULL_CODEC
 * 
 */
    __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_spec, __pyx_v_desc_len); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(7, 503, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":504
 *             # Ignore
 *             frb_read(spec, desc_len)
 *             res = NULL_CODEC             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __Pyx_INCREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_NULL_CODEC);
    __Pyx_DECREF_SET(__pyx_v_res, __pyx_v_3gel_8protocol_8protocol_NULL_CODEC);

    /* "gel/protocol/codecs/codecs.pyx":501
 *             res = NULL_CODEC
 * 
 *         elif t == CTYPE_COMPOUND and protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *             # Ignore
 *             frb_read(spec, desc_len)
 */
    goto __pyx_L19;
  }

  /* "gel/protocol/codecs/codecs.pyx":507
 * 
 *         else:
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 f'no codec implementation for EdgeDB data class {t}')
 * 
 */
  /*else*/ {

    /* "gel/protocol/codecs/codecs.pyx":508
 *         else:
 *             raise NotImplementedError(
 *                 f'no codec implementation for EdgeDB data class {t}')             # <<<<<<<<<<<<<<
 * 
 *         self.codecs_build_cache[tid] = res
 */
    __pyx_t_9 = __Pyx_PyInt_From_uint8_t(__pyx_v_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_9, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_kp_u_no_codec_implementation_for_Edge, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":507
 * 
 *         else:
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 f'no codec implementation for EdgeDB data class {t}')
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 507, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(7, 507, __pyx_L1_error)
  }
  __pyx_L19:;

  /* "gel/protocol/codecs/codecs.pyx":510
 *                 f'no codec implementation for EdgeDB data class {t}')
 * 
 *         self.codecs_build_cache[tid] = res             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->codecs_build_cache), __pyx_v_tid, ((PyObject *)__pyx_v_res)) < 0))) __PYX_ERR(7, 510, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":511
 * 
 *         self.codecs_build_cache[tid] = res
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     cdef has_codec(self, bytes type_id):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":99
 *         )
 * 
 *     cdef BaseCodec _build_codec(self, FRBuffer *spec, list codecs_list,             # <<<<<<<<<<<<<<
 *                                 protocol_version):
 *         cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry._build_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tid);
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF((PyObject *)__pyx_v_sub_codec);
  __Pyx_XDECREF(__pyx_v_codecs);
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_flags);
  __Pyx_XDECREF(__pyx_v_cards);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_source_type);
  __Pyx_XDECREF(__pyx_v_type_name);
  __Pyx_XDECREF(__pyx_v_ancestors);
  __Pyx_XDECREF(__pyx_v_ancestor_codec);
  __Pyx_XDECREF(__pyx_v_fundamental_codec);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":513
 *         return res
 * 
 *     cdef has_codec(self, bytes type_id):             # <<<<<<<<<<<<<<
 *         return (
 *             type_id in self.codecs or
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_has_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_type_id) {
  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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("has_codec", 1);

  /* "gel/protocol/codecs/codecs.pyx":514
 * 
 *     cdef has_codec(self, bytes type_id):
 *         return (             # <<<<<<<<<<<<<<
 *             type_id in self.codecs or
 *             type_id in {NULL_CODEC_ID, EMPTY_TUPLE_CODEC_ID}
 */
  __Pyx_XDECREF(__pyx_r);

  /* "gel/protocol/codecs/codecs.pyx":515
 *     cdef has_codec(self, bytes type_id):
 *         return (
 *             type_id in self.codecs or             # <<<<<<<<<<<<<<
 *             type_id in {NULL_CODEC_ID, EMPTY_TUPLE_CODEC_ID}
 *         )
 */
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, ((PyObject *)__pyx_v_self->codecs), Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 515, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }

  /* "gel/protocol/codecs/codecs.pyx":516
 *         return (
 *             type_id in self.codecs or
 *             type_id in {NULL_CODEC_ID, EMPTY_TUPLE_CODEC_ID}             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __Pyx_INCREF(__pyx_v_type_id);
  __pyx_t_4 = __pyx_v_type_id;
  __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(7, 516, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(7, 516, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __pyx_t_2;
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":513
 *         return res
 * 
 *     cdef has_codec(self, bytes type_id):             # <<<<<<<<<<<<<<
 *         return (
 *             type_id in self.codecs or
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.has_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":519
 *         )
 * 
 *     cdef BaseCodec get_codec(self, bytes type_id):             # <<<<<<<<<<<<<<
 *         try:
 *             return <BaseCodec>self.codecs[type_id]
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_get_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_type_id) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_codec", 1);

  /* "gel/protocol/codecs/codecs.pyx":520
 * 
 *     cdef BaseCodec get_codec(self, bytes type_id):
 *         try:             # <<<<<<<<<<<<<<
 *             return <BaseCodec>self.codecs[type_id]
 *         except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "gel/protocol/codecs/codecs.pyx":521
 *     cdef BaseCodec get_codec(self, bytes type_id):
 *         try:
 *             return <BaseCodec>self.codecs[type_id]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->codecs), __pyx_v_type_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 521, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF((PyObject *)((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_4));
      __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "gel/protocol/codecs/codecs.pyx":520
 * 
 *     cdef BaseCodec get_codec(self, bytes type_id):
 *         try:             # <<<<<<<<<<<<<<
 *             return <BaseCodec>self.codecs[type_id]
 *         except KeyError:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "gel/protocol/codecs/codecs.pyx":522
 *         try:
 *             return <BaseCodec>self.codecs[type_id]
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "gel/protocol/codecs/codecs.pyx":520
 * 
 *     cdef BaseCodec get_codec(self, bytes type_id):
 *         try:             # <<<<<<<<<<<<<<
 *             return <BaseCodec>self.codecs[type_id]
 *         except KeyError:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  }

  /* "gel/protocol/codecs/codecs.pyx":525
 *             pass
 * 
 *         if type_id == NULL_CODEC_ID:             # <<<<<<<<<<<<<<
 *             return NULL_CODEC
 * 
 */
  __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_v_type_id, __pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(7, 525, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "gel/protocol/codecs/codecs.pyx":526
 * 
 *         if type_id == NULL_CODEC_ID:
 *             return NULL_CODEC             # <<<<<<<<<<<<<<
 * 
 *         if type_id == EMPTY_TUPLE_CODEC_ID:
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_NULL_CODEC);
    __pyx_r = __pyx_v_3gel_8protocol_8protocol_NULL_CODEC;
    goto __pyx_L0;

    /* "gel/protocol/codecs/codecs.pyx":525
 *             pass
 * 
 *         if type_id == NULL_CODEC_ID:             # <<<<<<<<<<<<<<
 *             return NULL_CODEC
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":528
 *             return NULL_CODEC
 * 
 *         if type_id == EMPTY_TUPLE_CODEC_ID:             # <<<<<<<<<<<<<<
 *             return EMPTY_TUPLE_CODEC
 * 
 */
  __pyx_t_6 = (__Pyx_PyBytes_Equals(__pyx_v_type_id, __pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID, Py_EQ)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(7, 528, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "gel/protocol/codecs/codecs.pyx":529
 * 
 *         if type_id == EMPTY_TUPLE_CODEC_ID:
 *             return EMPTY_TUPLE_CODEC             # <<<<<<<<<<<<<<
 * 
 *         raise LookupError
 */
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __Pyx_INCREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC);
    __pyx_r = __pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC;
    goto __pyx_L0;

    /* "gel/protocol/codecs/codecs.pyx":528
 *             return NULL_CODEC
 * 
 *         if type_id == EMPTY_TUPLE_CODEC_ID:             # <<<<<<<<<<<<<<
 *             return EMPTY_TUPLE_CODEC
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":531
 *             return EMPTY_TUPLE_CODEC
 * 
 *         raise LookupError             # <<<<<<<<<<<<<<
 * 
 *     cdef BaseCodec build_codec(self, bytes spec, protocol_version):
 */
  __Pyx_Raise(__pyx_builtin_LookupError, 0, 0, 0);
  __PYX_ERR(7, 531, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":519
 *         )
 * 
 *     cdef BaseCodec get_codec(self, bytes type_id):             # <<<<<<<<<<<<<<
 *         try:
 *             return <BaseCodec>self.codecs[type_id]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.get_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":533
 *         raise LookupError
 * 
 *     cdef BaseCodec build_codec(self, bytes spec, protocol_version):             # <<<<<<<<<<<<<<
 *         cdef:
 *             FRBuffer buf
 */

static struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_build_codec(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v_spec, PyObject *__pyx_v_protocol_version) {
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_buf;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v_elem_buf;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_res = 0;
  PyObject *__pyx_v_codecs_list = 0;
  uint32_t __pyx_v_desc_len;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  char const *__pyx_t_5;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("build_codec", 1);

  /* "gel/protocol/codecs/codecs.pyx":542
 *         frb_init(
 *             &buf,
 *             cpython.PyBytes_AsString(spec),             # <<<<<<<<<<<<<<
 *             cpython.Py_SIZE(spec))
 * 
 */
  __pyx_t_1 = PyBytes_AsString(__pyx_v_spec); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(7, 542, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":540
 *             list codecs_list
 * 
 *         frb_init(             # <<<<<<<<<<<<<<
 *             &buf,
 *             cpython.PyBytes_AsString(spec),
 */
  __pyx_f_3gel_7pgproto_7pgproto_frb_init((&__pyx_v_buf), __pyx_t_1, Py_SIZE(__pyx_v_spec)); if (unlikely(PyErr_Occurred())) __PYX_ERR(7, 540, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":545
 *             cpython.Py_SIZE(spec))
 * 
 *         codecs_list = []             # <<<<<<<<<<<<<<
 *         while frb_get_len(&buf):
 *             if protocol_version >= (2, 0):
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_codecs_list = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":546
 * 
 *         codecs_list = []
 *         while frb_get_len(&buf):             # <<<<<<<<<<<<<<
 *             if protocol_version >= (2, 0):
 *                 desc_len = <uint32_t>hton.unpack_int32(frb_read(&buf, 4))
 */
  while (1) {
    __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_buf)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 546, __pyx_L1_error)
    __pyx_t_4 = (__pyx_t_3 != 0);
    if (!__pyx_t_4) break;

    /* "gel/protocol/codecs/codecs.pyx":547
 *         codecs_list = []
 *         while frb_get_len(&buf):
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 desc_len = <uint32_t>hton.unpack_int32(frb_read(&buf, 4))
 *                 frb_slice_from(&elem_buf, &buf, desc_len)
 */
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_protocol_version, __pyx_tuple__31, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 547, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(7, 547, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_4) {

      /* "gel/protocol/codecs/codecs.pyx":548
 *         while frb_get_len(&buf):
 *             if protocol_version >= (2, 0):
 *                 desc_len = <uint32_t>hton.unpack_int32(frb_read(&buf, 4))             # <<<<<<<<<<<<<<
 *                 frb_slice_from(&elem_buf, &buf, desc_len)
 *                 res = self._build_codec(
 */
      __pyx_t_5 = __pyx_f_3gel_7pgproto_7pgproto_frb_read((&__pyx_v_buf), 4); if (unlikely(__pyx_t_5 == ((char const *)NULL))) __PYX_ERR(7, 548, __pyx_L1_error)
      __pyx_v_desc_len = ((uint32_t)unpack_int32(__pyx_t_5));

      /* "gel/protocol/codecs/codecs.pyx":549
 *             if protocol_version >= (2, 0):
 *                 desc_len = <uint32_t>hton.unpack_int32(frb_read(&buf, 4))
 *                 frb_slice_from(&elem_buf, &buf, desc_len)             # <<<<<<<<<<<<<<
 *                 res = self._build_codec(
 *                     &elem_buf, codecs_list, protocol_version)
 */
      __pyx_t_6 = __pyx_f_3gel_7pgproto_7pgproto_frb_slice_from((&__pyx_v_elem_buf), (&__pyx_v_buf), __pyx_v_desc_len); if (unlikely(__pyx_t_6 == ((struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)NULL) && PyErr_Occurred())) __PYX_ERR(7, 549, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":550
 *                 desc_len = <uint32_t>hton.unpack_int32(frb_read(&buf, 4))
 *                 frb_slice_from(&elem_buf, &buf, desc_len)
 *                 res = self._build_codec(             # <<<<<<<<<<<<<<
 *                     &elem_buf, codecs_list, protocol_version)
 *                 if frb_get_len(&elem_buf):
 */
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self->__pyx_vtab)->_build_codec(__pyx_v_self, (&__pyx_v_elem_buf), __pyx_v_codecs_list, __pyx_v_protocol_version)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "gel/protocol/codecs/codecs.pyx":552
 *                 res = self._build_codec(
 *                     &elem_buf, codecs_list, protocol_version)
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in type descriptor datum')
 */
      __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len((&__pyx_v_elem_buf)); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 552, __pyx_L1_error)
      __pyx_t_4 = (__pyx_t_3 != 0);
      if (unlikely(__pyx_t_4)) {

        /* "gel/protocol/codecs/codecs.pyx":553
 *                     &elem_buf, codecs_list, protocol_version)
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in type descriptor datum')
 *             else:
 */
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 553, __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(7, 553, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":552
 *                 res = self._build_codec(
 *                     &elem_buf, codecs_list, protocol_version)
 *                 if frb_get_len(&elem_buf):             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unexpected trailing data in type descriptor datum')
 */
      }

      /* "gel/protocol/codecs/codecs.pyx":547
 *         codecs_list = []
 *         while frb_get_len(&buf):
 *             if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *                 desc_len = <uint32_t>hton.unpack_int32(frb_read(&buf, 4))
 *                 frb_slice_from(&elem_buf, &buf, desc_len)
 */
      goto __pyx_L5;
    }

    /* "gel/protocol/codecs/codecs.pyx":556
 *                         f'unexpected trailing data in type descriptor datum')
 *             else:
 *                 res = self._build_codec(&buf, codecs_list, protocol_version)             # <<<<<<<<<<<<<<
 *             if res is None:
 *                 # An annotation; ignore.
 */
    /*else*/ {
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self->__pyx_vtab)->_build_codec(__pyx_v_self, (&__pyx_v_buf), __pyx_v_codecs_list, __pyx_v_protocol_version)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 556, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_res, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2));
      __pyx_t_2 = 0;
    }
    __pyx_L5:;

    /* "gel/protocol/codecs/codecs.pyx":557
 *             else:
 *                 res = self._build_codec(&buf, codecs_list, protocol_version)
 *             if res is None:             # <<<<<<<<<<<<<<
 *                 # An annotation; ignore.
 *                 continue
 */
    __pyx_t_4 = (((PyObject *)__pyx_v_res) == Py_None);
    if (__pyx_t_4) {

      /* "gel/protocol/codecs/codecs.pyx":559
 *             if res is None:
 *                 # An annotation; ignore.
 *                 continue             # <<<<<<<<<<<<<<
 *             codecs_list.append(res)
 *             self.codecs[res.tid] = res
 */
      goto __pyx_L3_continue;

      /* "gel/protocol/codecs/codecs.pyx":557
 *             else:
 *                 res = self._build_codec(&buf, codecs_list, protocol_version)
 *             if res is None:             # <<<<<<<<<<<<<<
 *                 # An annotation; ignore.
 *                 continue
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":560
 *                 # An annotation; ignore.
 *                 continue
 *             codecs_list.append(res)             # <<<<<<<<<<<<<<
 *             self.codecs[res.tid] = res
 * 
 */
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_codecs_list, ((PyObject *)__pyx_v_res)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 560, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":561
 *                 continue
 *             codecs_list.append(res)
 *             self.codecs[res.tid] = res             # <<<<<<<<<<<<<<
 * 
 *         if not codecs_list:
 */
    if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->codecs), __pyx_v_res->tid, ((PyObject *)__pyx_v_res)) < 0))) __PYX_ERR(7, 561, __pyx_L1_error)
    __pyx_L3_continue:;
  }

  /* "gel/protocol/codecs/codecs.pyx":563
 *             self.codecs[res.tid] = res
 * 
 *         if not codecs_list:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(f'cannot not build codec; empty type desc')
 * 
 */
  __pyx_t_4 = (PyList_GET_SIZE(__pyx_v_codecs_list) != 0);
  __pyx_t_8 = (!__pyx_t_4);
  if (unlikely(__pyx_t_8)) {

    /* "gel/protocol/codecs/codecs.pyx":564
 * 
 *         if not codecs_list:
 *             raise RuntimeError(f'cannot not build codec; empty type desc')             # <<<<<<<<<<<<<<
 * 
 *         return codecs_list[-1]
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 564, __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(7, 564, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":563
 *             self.codecs[res.tid] = res
 * 
 *         if not codecs_list:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(f'cannot not build codec; empty type desc')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":566
 *             raise RuntimeError(f'cannot not build codec; empty type desc')
 * 
 *         return codecs_list[-1]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_codecs_list, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(7, 566, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":533
 *         raise LookupError
 * 
 *     cdef BaseCodec build_codec(self, bytes spec, protocol_version):             # <<<<<<<<<<<<<<
 *         cdef:
 *             FRBuffer buf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.build_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_res);
  __Pyx_XDECREF(__pyx_v_codecs_list);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14CodecsRegistry_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_6__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_6__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.base_codec_overrides, self.codecs, self.codecs_build_cache)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->base_codec_overrides);
  __Pyx_GIVEREF(__pyx_v_self->base_codec_overrides);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->base_codec_overrides)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->codecs);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->codecs);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->codecs))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->codecs_build_cache);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->codecs_build_cache);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_self->codecs_build_cache))) __PYX_ERR(2, 5, __pyx_L1_error);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.base_codec_overrides, self.codecs, self.codecs_build_cache)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":7
 *     state = (self.base_codec_overrides, self.codecs, self.codecs_build_cache)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_2 = (__pyx_v__dict != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error);
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.base_codec_overrides is not None or self.codecs is not None or self.codecs_build_cache is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.base_codec_overrides, self.codecs, self.codecs_build_cache)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.base_codec_overrides is not None or self.codecs is not None or self.codecs_build_cache is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, None), state
 */
  /*else*/ {
    __pyx_t_4 = (__pyx_v_self->base_codec_overrides != ((PyObject*)Py_None));
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (((PyObject *)__pyx_v_self->codecs) != Py_None);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = (((PyObject *)__pyx_v_self->codecs_build_cache) != Py_None);
    __pyx_t_2 = __pyx_t_4;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_2;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.base_codec_overrides is not None or self.codecs is not None or self.codecs_build_cache is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.base_codec_overrides is not None or self.codecs is not None or self.codecs_build_cache is not None
 *     if use_setstate:
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_CodecsRegistry); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_228165448);
    __Pyx_GIVEREF(__pyx_int_228165448);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_228165448)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.base_codec_overrides is not None or self.codecs is not None or self.codecs_build_cache is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, None), state
 *     else:
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CodecsRegistry__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_CodecsRegistry); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_228165448);
    __Pyx_GIVEREF(__pyx_int_228165448);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_228165448)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_1);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CodecsRegistry__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14CodecsRegistry_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_8__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14CodecsRegistry_8__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_CodecsRegistry__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_CodecsRegistry__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CodecsRegistry__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.CodecsRegistry.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":572
 * 
 * 
 * cdef register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         str name,
 *         pgproto.encode_func encoder,
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(PyObject *__pyx_v_name, __pyx_t_3gel_7pgproto_7pgproto_encode_func __pyx_v_encoder, __pyx_t_3gel_7pgproto_7pgproto_decode_func __pyx_v_decoder, struct __pyx_opt_args_3gel_8protocol_8protocol_register_base_scalar_codec *__pyx_optional_args) {

  /* "gel/protocol/codecs/codecs.pyx":576
 *         pgproto.encode_func encoder,
 *         pgproto.decode_func decoder,
 *         object tid = None):             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
  PyObject *__pyx_v_tid = ((PyObject *)Py_None);
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_codec = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_UCS4 __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_base_scalar_codec", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_tid = __pyx_optional_args->tid;
    }
  }
  __Pyx_INCREF(__pyx_v_tid);

  /* "gel/protocol/codecs/codecs.pyx":581
 *         BaseCodec codec
 * 
 *     if tid is None:             # <<<<<<<<<<<<<<
 *         tid = TYPE_IDS.get(name)
 *         if tid is None:
 */
  __pyx_t_1 = (__pyx_v_tid == Py_None);
  if (__pyx_t_1) {

    /* "gel/protocol/codecs/codecs.pyx":582
 * 
 *     if tid is None:
 *         tid = TYPE_IDS.get(name)             # <<<<<<<<<<<<<<
 *         if tid is None:
 *             raise RuntimeError(f'cannot find known ID for type {name!r}')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TYPE_IDS); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 582, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_name};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 582, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF_SET(__pyx_v_tid, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "gel/protocol/codecs/codecs.pyx":583
 *     if tid is None:
 *         tid = TYPE_IDS.get(name)
 *         if tid is None:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(f'cannot find known ID for type {name!r}')
 *     tid = tid.bytes
 */
    __pyx_t_1 = (__pyx_v_tid == Py_None);
    if (unlikely(__pyx_t_1)) {

      /* "gel/protocol/codecs/codecs.pyx":584
 *         tid = TYPE_IDS.get(name)
 *         if tid is None:
 *             raise RuntimeError(f'cannot find known ID for type {name!r}')             # <<<<<<<<<<<<<<
 *     tid = tid.bytes
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_name), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_cannot_find_known_ID_for_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 584, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(7, 584, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":583
 *     if tid is None:
 *         tid = TYPE_IDS.get(name)
 *         if tid is None:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(f'cannot find known ID for type {name!r}')
 *     tid = tid.bytes
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":581
 *         BaseCodec codec
 * 
 *     if tid is None:             # <<<<<<<<<<<<<<
 *         tid = TYPE_IDS.get(name)
 *         if tid is None:
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":585
 *         if tid is None:
 *             raise RuntimeError(f'cannot find known ID for type {name!r}')
 *     tid = tid.bytes             # <<<<<<<<<<<<<<
 * 
 *     if tid in BASE_SCALAR_CODECS:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tid, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_tid, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":587
 *     tid = tid.bytes
 * 
 *     if tid in BASE_SCALAR_CODECS:             # <<<<<<<<<<<<<<
 *         raise RuntimeError(f'base scalar codec for {id} is already registered')
 * 
 */
  if (unlikely(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(7, 587, __pyx_L1_error)
  }
  __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_v_tid, __pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(7, 587, __pyx_L1_error)
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/codecs.pyx":588
 * 
 *     if tid in BASE_SCALAR_CODECS:
 *         raise RuntimeError(f'base scalar codec for {id} is already registered')             # <<<<<<<<<<<<<<
 * 
 *     codec = ScalarCodec.new(tid, name, encoder, decoder)
 */
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_7 = 127;
    __Pyx_INCREF(__pyx_kp_u_base_scalar_codec_for);
    __pyx_t_6 += 22;
    __Pyx_GIVEREF(__pyx_kp_u_base_scalar_codec_for);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_base_scalar_codec_for);
    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_builtin_id, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
    __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_INCREF(__pyx_kp_u_is_already_registered);
    __pyx_t_6 += 22;
    __Pyx_GIVEREF(__pyx_kp_u_is_already_registered);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_is_already_registered);
    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 588, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 588, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":587
 *     tid = tid.bytes
 * 
 *     if tid in BASE_SCALAR_CODECS:             # <<<<<<<<<<<<<<
 *         raise RuntimeError(f'base scalar codec for {id} is already registered')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":590
 *         raise RuntimeError(f'base scalar codec for {id} is already registered')
 * 
 *     codec = ScalarCodec.new(tid, name, encoder, decoder)             # <<<<<<<<<<<<<<
 *     BASE_SCALAR_CODECS[tid] = codec
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_tid))||((__pyx_v_tid) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_tid))) __PYX_ERR(7, 590, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_new(((PyObject*)__pyx_v_tid), __pyx_v_name, __pyx_v_encoder, __pyx_v_decoder)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":591
 * 
 *     codec = ScalarCodec.new(tid, name, encoder, decoder)
 *     BASE_SCALAR_CODECS[tid] = codec             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(7, 591, __pyx_L1_error)
  }
  if (unlikely((PyDict_SetItem(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS, __pyx_v_tid, ((PyObject *)__pyx_v_codec)) < 0))) __PYX_ERR(7, 591, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":572
 * 
 * 
 * cdef register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         str name,
 *         pgproto.encode_func encoder,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.register_base_scalar_codec", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_tid);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":594
 * 
 * 
 * cdef time_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     if getattr(obj, 'tzinfo', None) is not None:
 *         raise TypeError(
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_time_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":595
 * 
 * cdef time_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if getattr(obj, 'tzinfo', None) is not None:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a naive time object (tzinfo is None) was expected')
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_tzinfo, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":596
 * cdef time_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if getattr(obj, 'tzinfo', None) is not None:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a naive time object (tzinfo is None) was expected')
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 596, __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(7, 596, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":595
 * 
 * cdef time_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if getattr(obj, 'tzinfo', None) is not None:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a naive time object (tzinfo is None) was expected')
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":599
 *             f'a naive time object (tzinfo is None) was expected')
 * 
 *     pgproto.time_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_time_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":594
 * 
 * 
 * cdef time_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     if getattr(obj, 'tzinfo', None) is not None:
 *         raise TypeError(
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.time_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":602
 * 
 * 
 * cdef date_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     # Python `datetime.date` object does not have a `tzinfo` attribute
 *     # nor it is timezone-aware.  But since we're accepting duck types
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_date_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":606
 *     # nor it is timezone-aware.  But since we're accepting duck types
 *     # let's ensure it doesn't have tzinfo anyways.
 *     if getattr(obj, 'tzinfo', None) is not None:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a naive date object (tzinfo is None) was expected')
 */
  __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_tzinfo, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":607
 *     # let's ensure it doesn't have tzinfo anyways.
 *     if getattr(obj, 'tzinfo', None) is not None:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a naive date object (tzinfo is None) was expected')
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 607, __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(7, 607, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":606
 *     # nor it is timezone-aware.  But since we're accepting duck types
 *     # let's ensure it doesn't have tzinfo anyways.
 *     if getattr(obj, 'tzinfo', None) is not None:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a naive date object (tzinfo is None) was expected')
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":610
 *             f'a naive date object (tzinfo is None) was expected')
 * 
 *     pgproto.date_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_date_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":602
 * 
 * 
 * cdef date_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     # Python `datetime.date` object does not have a `tzinfo` attribute
 *     # nor it is timezone-aware.  But since we're accepting duck types
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.date_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":613
 * 
 * 
 * cdef timestamp_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     if not cpython.datetime.PyDateTime_Check(obj):
 *         raise TypeError(
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_timestamp_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timestamp_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":614
 * 
 * cdef timestamp_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if not cpython.datetime.PyDateTime_Check(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a datetime.datetime object was expected, got {obj!r}')
 */
  __pyx_t_1 = (!PyDateTime_Check(__pyx_v_obj));
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/codecs.pyx":616
 *     if not cpython.datetime.PyDateTime_Check(obj):
 *         raise TypeError(
 *             f'a datetime.datetime object was expected, got {obj!r}')             # <<<<<<<<<<<<<<
 * 
 *     if getattr(obj, 'tzinfo', None) is not None:
 */
    __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_obj), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_a_datetime_datetime_object_was_e, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/codecs/codecs.pyx":615
 * cdef timestamp_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if not cpython.datetime.PyDateTime_Check(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a datetime.datetime object was expected, got {obj!r}')
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 615, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(7, 615, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":614
 * 
 * cdef timestamp_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if not cpython.datetime.PyDateTime_Check(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a datetime.datetime object was expected, got {obj!r}')
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":618
 *             f'a datetime.datetime object was expected, got {obj!r}')
 * 
 *     if getattr(obj, 'tzinfo', None) is not None:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a naive datetime object (tzinfo is None) was expected')
 */
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_tzinfo, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/codecs.pyx":619
 * 
 *     if getattr(obj, 'tzinfo', None) is not None:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a naive datetime object (tzinfo is None) was expected')
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 619, __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(7, 619, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":618
 *             f'a datetime.datetime object was expected, got {obj!r}')
 * 
 *     if getattr(obj, 'tzinfo', None) is not None:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a naive datetime object (tzinfo is None) was expected')
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":622
 *             f'a naive datetime object (tzinfo is None) was expected')
 * 
 *     pgproto.timestamp_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_timestamp_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":613
 * 
 * 
 * cdef timestamp_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     if not cpython.datetime.PyDateTime_Check(obj):
 *         raise TypeError(
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.timestamp_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":625
 * 
 * 
 * cdef timestamptz_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     if not cpython.datetime.PyDateTime_Check(obj):
 *         raise TypeError(
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_timestamptz_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timestamptz_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":626
 * 
 * cdef timestamptz_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if not cpython.datetime.PyDateTime_Check(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a datetime.datetime object was expected')
 */
  __pyx_t_1 = (!PyDateTime_Check(__pyx_v_obj));
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/codecs.pyx":627
 * cdef timestamptz_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if not cpython.datetime.PyDateTime_Check(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a datetime.datetime object was expected')
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 627, __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(7, 627, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":626
 * 
 * cdef timestamptz_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if not cpython.datetime.PyDateTime_Check(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a datetime.datetime object was expected')
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":630
 *             f'a datetime.datetime object was expected')
 * 
 *     if getattr(obj, 'tzinfo', None) is None:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a timezone-aware datetime object (tzinfo is not None) '
 */
  __pyx_t_2 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_n_u_tzinfo, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/codecs.pyx":631
 * 
 *     if getattr(obj, 'tzinfo', None) is None:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a timezone-aware datetime object (tzinfo is not None) '
 *             f'was expected')
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 631, __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(7, 631, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":630
 *             f'a datetime.datetime object was expected')
 * 
 *     if getattr(obj, 'tzinfo', None) is None:             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             f'a timezone-aware datetime object (tzinfo is not None) '
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":635
 *             f'was expected')
 * 
 *     pgproto.timestamptz_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_timestamptz_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":625
 * 
 * 
 * cdef timestamptz_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     if not cpython.datetime.PyDateTime_Check(obj):
 *         raise TypeError(
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.timestamptz_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":638
 * 
 * 
 * cdef duration_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                      object obj):
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_duration_encode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_microseconds = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int64_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duration_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":641
 *                      object obj):
 * 
 *     cdef microseconds = obj / datetime.timedelta(microseconds=1)             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(16)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 641, __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(7, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_microseconds, __pyx_int_1) < 0) __PYX_ERR(7, 641, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_obj, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_microseconds = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":643
 *     cdef microseconds = obj / datetime.timedelta(microseconds=1)
 * 
 *     buf.write_int32(16)             # <<<<<<<<<<<<<<
 *     buf.write_int64(microseconds)
 *     buf.write_int32(0)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":644
 * 
 *     buf.write_int32(16)
 *     buf.write_int64(microseconds)             # <<<<<<<<<<<<<<
 *     buf.write_int32(0)
 *     buf.write_int32(0)
 */
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_microseconds); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 644, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int64(__pyx_v_buf, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 644, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":645
 *     buf.write_int32(16)
 *     buf.write_int64(microseconds)
 *     buf.write_int32(0)             # <<<<<<<<<<<<<<
 *     buf.write_int32(0)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":646
 *     buf.write_int64(microseconds)
 *     buf.write_int32(0)
 *     buf.write_int32(0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":638
 * 
 * 
 * cdef duration_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                      object obj):
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.duration_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_microseconds);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":649
 * 
 * 
 * cdef duration_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t days
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_duration_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  int32_t __pyx_v_days;
  int32_t __pyx_v_months;
  int64_t __pyx_v_microseconds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("duration_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":655
 *         int64_t microseconds
 * 
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))             # <<<<<<<<<<<<<<
 *     days = hton.unpack_int32(frb_read(buf, 4))
 *     months = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 655, __pyx_L1_error)
  __pyx_v_microseconds = unpack_int64(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":656
 * 
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))
 *     days = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *     months = hton.unpack_int32(frb_read(buf, 4))
 *     if days != 0 or months != 0:
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 656, __pyx_L1_error)
  __pyx_v_days = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":657
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))
 *     days = hton.unpack_int32(frb_read(buf, 4))
 *     months = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *     if days != 0 or months != 0:
 *         raise RuntimeError(f'non-zero reserved bytes in duration')
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 657, __pyx_L1_error)
  __pyx_v_months = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":658
 *     days = hton.unpack_int32(frb_read(buf, 4))
 *     months = hton.unpack_int32(frb_read(buf, 4))
 *     if days != 0 or months != 0:             # <<<<<<<<<<<<<<
 *         raise RuntimeError(f'non-zero reserved bytes in duration')
 * 
 */
  __pyx_t_3 = (__pyx_v_days != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_months != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":659
 *     months = hton.unpack_int32(frb_read(buf, 4))
 *     if days != 0 or months != 0:
 *         raise RuntimeError(f'non-zero reserved bytes in duration')             # <<<<<<<<<<<<<<
 * 
 *     return datetime.timedelta(microseconds=microseconds)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 659, __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(7, 659, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":658
 *     days = hton.unpack_int32(frb_read(buf, 4))
 *     months = hton.unpack_int32(frb_read(buf, 4))
 *     if days != 0 or months != 0:             # <<<<<<<<<<<<<<
 *         raise RuntimeError(f'non-zero reserved bytes in duration')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":661
 *         raise RuntimeError(f'non-zero reserved bytes in duration')
 * 
 *     return datetime.timedelta(microseconds=microseconds)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_6) < 0) __PYX_ERR(7, 661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":649
 * 
 * 
 * cdef duration_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t days
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.duration_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":664
 * 
 * 
 * cdef relative_duration_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                               object obj):
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_relative_duration_encode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_microseconds = 0;
  PyObject *__pyx_v_days = 0;
  PyObject *__pyx_v_months = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  int32_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relative_duration_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":668
 * 
 *     cdef:
 *         microseconds = obj.microseconds             # <<<<<<<<<<<<<<
 *         days = obj.days
 *         months = obj.months
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_microseconds); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_microseconds = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":669
 *     cdef:
 *         microseconds = obj.microseconds
 *         days = obj.days             # <<<<<<<<<<<<<<
 *         months = obj.months
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_days = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":670
 *         microseconds = obj.microseconds
 *         days = obj.days
 *         months = obj.months             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(16)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_months); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_months = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":672
 *         months = obj.months
 * 
 *     buf.write_int32(16)             # <<<<<<<<<<<<<<
 *     buf.write_int64(microseconds)
 *     buf.write_int32(days)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":673
 * 
 *     buf.write_int32(16)
 *     buf.write_int64(microseconds)             # <<<<<<<<<<<<<<
 *     buf.write_int32(days)
 *     buf.write_int32(months)
 */
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_v_microseconds); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 673, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int64(__pyx_v_buf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 673, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":674
 *     buf.write_int32(16)
 *     buf.write_int64(microseconds)
 *     buf.write_int32(days)             # <<<<<<<<<<<<<<
 *     buf.write_int32(months)
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_days); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 674, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":675
 *     buf.write_int64(microseconds)
 *     buf.write_int32(days)
 *     buf.write_int32(months)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_As_int32_t(__pyx_v_months); if (unlikely((__pyx_t_3 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 675, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":664
 * 
 * 
 * cdef relative_duration_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                               object obj):
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.relative_duration_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_microseconds);
  __Pyx_XDECREF(__pyx_v_days);
  __Pyx_XDECREF(__pyx_v_months);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":678
 * 
 * 
 * cdef relative_duration_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t days
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_relative_duration_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  int32_t __pyx_v_days;
  int32_t __pyx_v_months;
  int64_t __pyx_v_microseconds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relative_duration_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":684
 *         int64_t microseconds
 * 
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))             # <<<<<<<<<<<<<<
 *     days = hton.unpack_int32(frb_read(buf, 4))
 *     months = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 684, __pyx_L1_error)
  __pyx_v_microseconds = unpack_int64(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":685
 * 
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))
 *     days = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *     months = hton.unpack_int32(frb_read(buf, 4))
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 685, __pyx_L1_error)
  __pyx_v_days = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":686
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))
 *     days = hton.unpack_int32(frb_read(buf, 4))
 *     months = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *     return datatypes.RelativeDuration(
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 686, __pyx_L1_error)
  __pyx_v_months = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":688
 *     months = hton.unpack_int32(frb_read(buf, 4))
 * 
 *     return datatypes.RelativeDuration(             # <<<<<<<<<<<<<<
 *         microseconds=microseconds, days=days, months=months)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "gel/protocol/codecs/codecs.pyx":689
 * 
 *     return datatypes.RelativeDuration(
 *         microseconds=microseconds, days=days, months=months)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_microseconds); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_microseconds, __pyx_t_3) < 0) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_days); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_days, __pyx_t_3) < 0) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_months); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_months, __pyx_t_3) < 0) __PYX_ERR(7, 689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":688
 *     months = hton.unpack_int32(frb_read(buf, 4))
 * 
 *     return datatypes.RelativeDuration(             # <<<<<<<<<<<<<<
 *         microseconds=microseconds, days=days, months=months)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_3gel_9datatypes_9datatypes_RelativeDuration), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 688, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":678
 * 
 * 
 * cdef relative_duration_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t days
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.relative_duration_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":692
 * 
 * 
 * cdef date_duration_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                           object obj):
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_date_duration_encode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_days = 0;
  PyObject *__pyx_v_months = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int32_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_duration_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":696
 * 
 *     cdef:
 *         days = obj.days             # <<<<<<<<<<<<<<
 *         months = obj.months
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_days); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_days = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":697
 *     cdef:
 *         days = obj.days
 *         months = obj.months             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(16)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_months); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_months = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":699
 *         months = obj.months
 * 
 *     buf.write_int32(16)             # <<<<<<<<<<<<<<
 *     buf.write_int64(0)
 *     buf.write_int32(days)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":700
 * 
 *     buf.write_int32(16)
 *     buf.write_int64(0)             # <<<<<<<<<<<<<<
 *     buf.write_int32(days)
 *     buf.write_int32(months)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int64(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":701
 *     buf.write_int32(16)
 *     buf.write_int64(0)
 *     buf.write_int32(days)             # <<<<<<<<<<<<<<
 *     buf.write_int32(months)
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_v_days); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 701, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":702
 *     buf.write_int64(0)
 *     buf.write_int32(days)
 *     buf.write_int32(months)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_v_months); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 702, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":692
 * 
 * 
 * cdef date_duration_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                           object obj):
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.date_duration_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_days);
  __Pyx_XDECREF(__pyx_v_months);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":705
 * 
 * 
 * cdef date_duration_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t days
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_date_duration_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  int32_t __pyx_v_days;
  int32_t __pyx_v_months;
  int64_t __pyx_v_microseconds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("date_duration_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":711
 *         int64_t microseconds
 * 
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))             # <<<<<<<<<<<<<<
 *     days = hton.unpack_int32(frb_read(buf, 4))
 *     months = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 711, __pyx_L1_error)
  __pyx_v_microseconds = unpack_int64(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":712
 * 
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))
 *     days = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *     months = hton.unpack_int32(frb_read(buf, 4))
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 712, __pyx_L1_error)
  __pyx_v_days = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":713
 *     microseconds = hton.unpack_int64(frb_read(buf, 8))
 *     days = hton.unpack_int32(frb_read(buf, 4))
 *     months = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *     if microseconds != 0:
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 713, __pyx_L1_error)
  __pyx_v_months = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":715
 *     months = hton.unpack_int32(frb_read(buf, 4))
 * 
 *     if microseconds != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("date duration has non-zero microseconds")
 * 
 */
  __pyx_t_2 = (__pyx_v_microseconds != 0);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":716
 * 
 *     if microseconds != 0:
 *         raise ValueError("date duration has non-zero microseconds")             # <<<<<<<<<<<<<<
 * 
 *     return datatypes.DateDuration(days=days, months=months)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 716, __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(7, 716, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":715
 *     months = hton.unpack_int32(frb_read(buf, 4))
 * 
 *     if microseconds != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("date duration has non-zero microseconds")
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":718
 *         raise ValueError("date duration has non-zero microseconds")
 * 
 *     return datatypes.DateDuration(days=days, months=months)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_days); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_days, __pyx_t_4) < 0) __PYX_ERR(7, 718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_months); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_months, __pyx_t_4) < 0) __PYX_ERR(7, 718, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_3gel_9datatypes_9datatypes_DateDuration), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":705
 * 
 * 
 * cdef date_duration_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t days
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.date_duration_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":721
 * 
 * 
 * cdef config_memory_encode(pgproto.CodecContext settings,             # <<<<<<<<<<<<<<
 *                           WriteBuffer buf,
 *                           object obj):
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_config_memory_encode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_bytes = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int64_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_memory_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":725
 *                           object obj):
 *     cdef:
 *         bytes = obj._bytes             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(8)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_bytes_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bytes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":727
 *         bytes = obj._bytes
 * 
 *     buf.write_int32(8)             # <<<<<<<<<<<<<<
 *     buf.write_int64(bytes)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":728
 * 
 *     buf.write_int32(8)
 *     buf.write_int64(bytes)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_As_int64_t(__pyx_v_bytes); if (unlikely((__pyx_t_2 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 728, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int64(__pyx_v_buf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":721
 * 
 * 
 * cdef config_memory_encode(pgproto.CodecContext settings,             # <<<<<<<<<<<<<<
 *                           WriteBuffer buf,
 *                           object obj):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.config_memory_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_bytes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":731
 * 
 * 
 * cdef config_memory_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int64_t bytes
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_config_memory_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  int64_t __pyx_v_bytes;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("config_memory_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":735
 *         int64_t bytes
 * 
 *     bytes = hton.unpack_int64(frb_read(buf, 8))             # <<<<<<<<<<<<<<
 * 
 *     return datatypes.ConfigMemory(bytes=bytes)
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 8); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 735, __pyx_L1_error)
  __pyx_v_bytes = unpack_int64(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":737
 *     bytes = hton.unpack_int64(frb_read(buf, 8))
 * 
 *     return datatypes.ConfigMemory(bytes=bytes)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bytes, __pyx_t_3) < 0) __PYX_ERR(7, 737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_3gel_9datatypes_9datatypes_ConfigMemory), __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":731
 * 
 * 
 * cdef config_memory_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int64_t bytes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.config_memory_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":743
 * 
 * 
 * cdef pgvector_encode_memview(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                              float[:] obj):
 *     cdef:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_encode_memview(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, __Pyx_memviewslice __pyx_v_obj) {
  Py_ssize_t __pyx_v_objlen;
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pgvector_encode_memview", 1);

  /* "gel/protocol/codecs/codecs.pyx":749
 *         Py_ssize_t i
 * 
 *     objlen = len(obj)             # <<<<<<<<<<<<<<
 *     if objlen > PGVECTOR_MAX_DIM:
 *         raise ValueError('too many elements in vector value')
 */
  __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_obj); 
  __pyx_v_objlen = __pyx_t_1;

  /* "gel/protocol/codecs/codecs.pyx":750
 * 
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in vector value')
 * 
 */
  __pyx_t_2 = (__pyx_v_objlen > 0xFFFF);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":751
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:
 *         raise ValueError('too many elements in vector value')             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(4 + objlen*4)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 751, __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(7, 751, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":750
 * 
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in vector value')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":753
 *         raise ValueError('too many elements in vector value')
 * 
 *     buf.write_int32(4 + objlen*4)             # <<<<<<<<<<<<<<
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (4 + (__pyx_v_objlen * 4))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":754
 * 
 *     buf.write_int32(4 + objlen*4)
 *     buf.write_int16(objlen)             # <<<<<<<<<<<<<<
 *     buf.write_int16(0)
 *     for i in range(objlen):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_v_objlen); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":755
 *     buf.write_int32(4 + objlen*4)
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)             # <<<<<<<<<<<<<<
 *     for i in range(objlen):
 *         buf.write_float(obj[i])
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":756
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)
 *     for i in range(objlen):             # <<<<<<<<<<<<<<
 *         buf.write_float(obj[i])
 * 
 */
  __pyx_t_1 = __pyx_v_objlen;
  __pyx_t_4 = __pyx_t_1;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "gel/protocol/codecs/codecs.pyx":757
 *     buf.write_int16(0)
 *     for i in range(objlen):
 *         buf.write_float(obj[i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_6 = __pyx_v_i;
    __pyx_t_7 = -1;
    if (__pyx_t_6 < 0) {
      __pyx_t_6 += __pyx_v_obj.shape[0];
      if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 0;
    } else if (unlikely(__pyx_t_6 >= __pyx_v_obj.shape[0])) __pyx_t_7 = 0;
    if (unlikely(__pyx_t_7 != -1)) {
      __Pyx_RaiseBufferIndexError(__pyx_t_7);
      __PYX_ERR(7, 757, __pyx_L1_error)
    }
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_float(__pyx_v_buf, (*((float *) ( /* dim=0 */ (__pyx_v_obj.data + __pyx_t_6 * __pyx_v_obj.strides[0]) )))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":743
 * 
 * 
 * cdef pgvector_encode_memview(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                              float[:] obj):
 *     cdef:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.pgvector_encode_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":760
 * 
 * 
 * cdef pgvector_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                      object obj):
 *     cdef:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  Py_ssize_t __pyx_v_objlen;
  __Pyx_memviewslice __pyx_v_memview = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_i;
  CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  Py_ssize_t __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  float __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pgvector_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":772
 *     # Otherwise we take the slow path, indexing into the array using
 *     # the normal protocol.
 *     try:             # <<<<<<<<<<<<<<
 *         memview = obj
 *     except (ValueError, TypeError) as e:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "gel/protocol/codecs/codecs.pyx":773
 *     # the normal protocol.
 *     try:
 *         memview = obj             # <<<<<<<<<<<<<<
 *     except (ValueError, TypeError) as e:
 *         pass
 */
      __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_obj, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(7, 773, __pyx_L3_error)
      __pyx_v_memview = __pyx_t_4;
      __pyx_t_4.memview = NULL;
      __pyx_t_4.data = NULL;

      /* "gel/protocol/codecs/codecs.pyx":772
 *     # Otherwise we take the slow path, indexing into the array using
 *     # the normal protocol.
 *     try:             # <<<<<<<<<<<<<<
 *         memview = obj
 *     except (ValueError, TypeError) as e:
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":777
 *         pass
 *     else:
 *         pgvector_encode_memview(settings, buf, memview)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    /*else:*/ {
      __pyx_t_5 = __pyx_f_3gel_8protocol_8protocol_pgvector_encode_memview(__pyx_v_settings, __pyx_v_buf, __pyx_v_memview); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 777, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "gel/protocol/codecs/codecs.pyx":778
 *     else:
 *         pgvector_encode_memview(settings, buf, memview)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if not _is_array_iterable(obj):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L6_except_return;
    }
    __pyx_L3_error:;
    __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
    __pyx_t_4.memview = NULL; __pyx_t_4.data = NULL;

    /* "gel/protocol/codecs/codecs.pyx":774
 *     try:
 *         memview = obj
 *     except (ValueError, TypeError) as e:             # <<<<<<<<<<<<<<
 *         pass
 *     else:
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_ValueError, __pyx_builtin_TypeError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("gel.protocol.protocol.pgvector_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(7, 774, __pyx_L5_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_e = __pyx_t_7;
      /*try:*/ {
      }
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          goto __pyx_L15;
        }
        __pyx_L15:;
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "gel/protocol/codecs/codecs.pyx":772
 *     # Otherwise we take the slow path, indexing into the array using
 *     # the normal protocol.
 *     try:             # <<<<<<<<<<<<<<
 *         memview = obj
 *     except (ValueError, TypeError) as e:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  }

  /* "gel/protocol/codecs/codecs.pyx":780
 *         return
 * 
 *     if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
 */
  __pyx_t_8 = __pyx_f_3gel_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(7, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_10 = (!__pyx_t_9);
  if (unlikely(__pyx_t_10)) {

    /* "gel/protocol/codecs/codecs.pyx":782
 *     if not _is_array_iterable(obj):
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                 type(obj).__name__))
 * 
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_sized_iterable_container_expec, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 782, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "gel/protocol/codecs/codecs.pyx":783
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
 *                 type(obj).__name__))             # <<<<<<<<<<<<<<
 * 
 *     # Annoyingly, this is literally identical code to the fast path...
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 783, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = NULL;
    __pyx_t_12 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_12 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_5};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }

    /* "gel/protocol/codecs/codecs.pyx":781
 * 
 *     if not _is_array_iterable(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             'a sized iterable container expected (got type {!r})'.format(
 *                 type(obj).__name__))
 */
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 781, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(7, 781, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":780
 *         return
 * 
 *     if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":787
 *     # Annoyingly, this is literally identical code to the fast path...
 *     # but the types are different in critical ways.
 *     objlen = len(obj)             # <<<<<<<<<<<<<<
 *     if objlen > PGVECTOR_MAX_DIM:
 *         raise ValueError('too many elements in vector value')
 */
  __pyx_t_13 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(7, 787, __pyx_L1_error)
  __pyx_v_objlen = __pyx_t_13;

  /* "gel/protocol/codecs/codecs.pyx":788
 *     # but the types are different in critical ways.
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in vector value')
 * 
 */
  __pyx_t_10 = (__pyx_v_objlen > 0xFFFF);
  if (unlikely(__pyx_t_10)) {

    /* "gel/protocol/codecs/codecs.pyx":789
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:
 *         raise ValueError('too many elements in vector value')             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(4 + objlen*4)
 */
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_Raise(__pyx_t_7, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __PYX_ERR(7, 789, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":788
 *     # but the types are different in critical ways.
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in vector value')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":791
 *         raise ValueError('too many elements in vector value')
 * 
 *     buf.write_int32(4 + objlen*4)             # <<<<<<<<<<<<<<
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (4 + (__pyx_v_objlen * 4))); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "gel/protocol/codecs/codecs.pyx":792
 * 
 *     buf.write_int32(4 + objlen*4)
 *     buf.write_int16(objlen)             # <<<<<<<<<<<<<<
 *     buf.write_int16(0)
 *     for i in range(objlen):
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_v_objlen); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "gel/protocol/codecs/codecs.pyx":793
 *     buf.write_int32(4 + objlen*4)
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)             # <<<<<<<<<<<<<<
 *     for i in range(objlen):
 *         buf.write_float(obj[i])
 */
  __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "gel/protocol/codecs/codecs.pyx":794
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)
 *     for i in range(objlen):             # <<<<<<<<<<<<<<
 *         buf.write_float(obj[i])
 * 
 */
  __pyx_t_13 = __pyx_v_objlen;
  __pyx_t_14 = __pyx_t_13;
  for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
    __pyx_v_i = __pyx_t_15;

    /* "gel/protocol/codecs/codecs.pyx":795
 *     buf.write_int16(0)
 *     for i in range(objlen):
 *         buf.write_float(obj[i])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_16 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_16 == (float)-1) && PyErr_Occurred())) __PYX_ERR(7, 795, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_float(__pyx_v_buf, __pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":760
 * 
 * 
 * cdef pgvector_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                      object obj):
 *     cdef:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("gel.protocol.protocol.pgvector_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_memview, 1);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":801
 * 
 * 
 * cdef pgvector_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t dim
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  int32_t __pyx_v_dim;
  Py_ssize_t __pyx_v_size;
  char *__pyx_v_p;
  __Pyx_memviewslice __pyx_v_array_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pgvector_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":809
 *         float[:] array_view
 * 
 *     dim = hton.unpack_uint16(frb_read(buf, 2))             # <<<<<<<<<<<<<<
 *     frb_read(buf, 2)
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 809, __pyx_L1_error)
  __pyx_v_dim = unpack_uint16(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":810
 * 
 *     dim = hton.unpack_uint16(frb_read(buf, 2))
 *     frb_read(buf, 2)             # <<<<<<<<<<<<<<
 * 
 *     size = dim * 4
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 810, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":812
 *     frb_read(buf, 2)
 * 
 *     size = dim * 4             # <<<<<<<<<<<<<<
 *     p = frb_read(buf, size)
 * 
 */
  __pyx_v_size = (__pyx_v_dim * 4);

  /* "gel/protocol/codecs/codecs.pyx":813
 * 
 *     size = dim * 4
 *     p = frb_read(buf, size)             # <<<<<<<<<<<<<<
 * 
 *     # Create a float array with size dim
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, __pyx_v_size); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 813, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;

  /* "gel/protocol/codecs/codecs.pyx":816
 * 
 *     # Create a float array with size dim
 *     val = ONE_EL_F32_ARRAY * dim             # <<<<<<<<<<<<<<
 * 
 *     # And fill it with the buffer contents
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_3gel_8protocol_8protocol_ONE_EL_F32_ARRAY, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_val = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":819
 * 
 *     # And fill it with the buffer contents
 *     array_view = val             # <<<<<<<<<<<<<<
 *     memcpy(&array_view[0], p, size)
 *     val.byteswap()
 */
  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_val, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(7, 819, __pyx_L1_error)
  __pyx_v_array_view = __pyx_t_4;
  __pyx_t_4.memview = NULL;
  __pyx_t_4.data = NULL;

  /* "gel/protocol/codecs/codecs.pyx":820
 *     # And fill it with the buffer contents
 *     array_view = val
 *     memcpy(&array_view[0], p, size)             # <<<<<<<<<<<<<<
 *     val.byteswap()
 * 
 */
  __pyx_t_5 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_5 < 0) {
    __pyx_t_5 += __pyx_v_array_view.shape[0];
    if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_5 >= __pyx_v_array_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(7, 820, __pyx_L1_error)
  }
  (void)(memcpy((&(*((float *) ( /* dim=0 */ (__pyx_v_array_view.data + __pyx_t_5 * __pyx_v_array_view.strides[0]) )))), __pyx_v_p, __pyx_v_size));

  /* "gel/protocol/codecs/codecs.pyx":821
 *     array_view = val
 *     memcpy(&array_view[0], p, size)
 *     val.byteswap()             # <<<<<<<<<<<<<<
 * 
 *     return val
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":823
 *     val.byteswap()
 * 
 *     return val             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_val);
  __pyx_r = __pyx_v_val;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":801
 * 
 * 
 * cdef pgvector_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t dim
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.pgvector_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_array_view, 1);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":849
 * 
 * 
 * cdef convertmantissa(uint32_t n):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t m
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_convertmantissa(uint32_t __pyx_v_n) {
  uint32_t __pyx_v_m;
  uint32_t __pyx_v_e;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convertmantissa", 1);

  /* "gel/protocol/codecs/codecs.pyx":854
 *         uint32_t e
 * 
 *     m = n << 13                 # Zero pad mantissa bits             # <<<<<<<<<<<<<<
 *     e = 0                       # Zero exponent
 *     # While not normalized
 */
  __pyx_v_m = (__pyx_v_n << 13);

  /* "gel/protocol/codecs/codecs.pyx":855
 * 
 *     m = n << 13                 # Zero pad mantissa bits
 *     e = 0                       # Zero exponent             # <<<<<<<<<<<<<<
 *     # While not normalized
 *     while (m & 0x00800000) == 0:
 */
  __pyx_v_e = 0;

  /* "gel/protocol/codecs/codecs.pyx":857
 *     e = 0                       # Zero exponent
 *     # While not normalized
 *     while (m & 0x00800000) == 0:             # <<<<<<<<<<<<<<
 *         e -= 0x00800000         # Decrement exponent (1<<23)
 *         m <<= 1                 # Shift mantissa
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_m & 0x00800000) == 0);
    if (!__pyx_t_1) break;

    /* "gel/protocol/codecs/codecs.pyx":858
 *     # While not normalized
 *     while (m & 0x00800000) == 0:
 *         e -= 0x00800000         # Decrement exponent (1<<23)             # <<<<<<<<<<<<<<
 *         m <<= 1                 # Shift mantissa
 * 
 */
    __pyx_v_e = (__pyx_v_e - 0x00800000);

    /* "gel/protocol/codecs/codecs.pyx":859
 *     while (m & 0x00800000) == 0:
 *         e -= 0x00800000         # Decrement exponent (1<<23)
 *         m <<= 1                 # Shift mantissa             # <<<<<<<<<<<<<<
 * 
 *     m &= ~0x00800000            # Clear leading 1 bit
 */
    __pyx_v_m = (__pyx_v_m << 1);
  }

  /* "gel/protocol/codecs/codecs.pyx":861
 *         m <<= 1                 # Shift mantissa
 * 
 *     m &= ~0x00800000            # Clear leading 1 bit             # <<<<<<<<<<<<<<
 *     e += 0x38800000             # Adjust bias ((127-14)<<23)
 * 
 */
  __pyx_v_m = (__pyx_v_m & (~0x00800000));

  /* "gel/protocol/codecs/codecs.pyx":862
 * 
 *     m &= ~0x00800000            # Clear leading 1 bit
 *     e += 0x38800000             # Adjust bias ((127-14)<<23)             # <<<<<<<<<<<<<<
 * 
 *     return m | e
 */
  __pyx_v_e = (__pyx_v_e + 0x38800000);

  /* "gel/protocol/codecs/codecs.pyx":864
 *     e += 0x38800000             # Adjust bias ((127-14)<<23)
 * 
 *     return m | e             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_uint32_t((__pyx_v_m | __pyx_v_e)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":849
 * 
 * 
 * cdef convertmantissa(uint32_t n):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t m
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.convertmantissa", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":867
 * 
 * 
 * cdef generate_tables():             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t i
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_generate_tables(void) {
  uint32_t __pyx_v_i;
  int32_t __pyx_v_e;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  uint32_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  uint32_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("generate_tables", 1);

  /* "gel/protocol/codecs/codecs.pyx":873
 * 
 *     # Generate the f16 to f32 conversion tables
 *     MANTISSA_TABLE[0] = 0             # <<<<<<<<<<<<<<
 *     for i in range(1, 1024):
 *         MANTISSA_TABLE[i] = convertmantissa(i)
 */
  (__pyx_v_3gel_8protocol_8protocol_MANTISSA_TABLE[0]) = 0;

  /* "gel/protocol/codecs/codecs.pyx":874
 *     # Generate the f16 to f32 conversion tables
 *     MANTISSA_TABLE[0] = 0
 *     for i in range(1, 1024):             # <<<<<<<<<<<<<<
 *         MANTISSA_TABLE[i] = convertmantissa(i)
 *     for i in range(1024, 2048):
 */
  for (__pyx_t_1 = 1; __pyx_t_1 < 0x400; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "gel/protocol/codecs/codecs.pyx":875
 *     MANTISSA_TABLE[0] = 0
 *     for i in range(1, 1024):
 *         MANTISSA_TABLE[i] = convertmantissa(i)             # <<<<<<<<<<<<<<
 *     for i in range(1024, 2048):
 *         MANTISSA_TABLE[i] = 0x38000000 + ((i - 1024) << 13)
 */
    __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol_convertmantissa(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 875, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    (__pyx_v_3gel_8protocol_8protocol_MANTISSA_TABLE[__pyx_v_i]) = __pyx_t_3;
  }

  /* "gel/protocol/codecs/codecs.pyx":876
 *     for i in range(1, 1024):
 *         MANTISSA_TABLE[i] = convertmantissa(i)
 *     for i in range(1024, 2048):             # <<<<<<<<<<<<<<
 *         MANTISSA_TABLE[i] = 0x38000000 + ((i - 1024) << 13)
 * 
 */
  for (__pyx_t_1 = 0x400; __pyx_t_1 < 0x800; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "gel/protocol/codecs/codecs.pyx":877
 *         MANTISSA_TABLE[i] = convertmantissa(i)
 *     for i in range(1024, 2048):
 *         MANTISSA_TABLE[i] = 0x38000000 + ((i - 1024) << 13)             # <<<<<<<<<<<<<<
 * 
 *     EXP_TABLE[0] = 0
 */
    (__pyx_v_3gel_8protocol_8protocol_MANTISSA_TABLE[__pyx_v_i]) = (0x38000000 + ((__pyx_v_i - 0x400) << 13));
  }

  /* "gel/protocol/codecs/codecs.pyx":879
 *         MANTISSA_TABLE[i] = 0x38000000 + ((i - 1024) << 13)
 * 
 *     EXP_TABLE[0] = 0             # <<<<<<<<<<<<<<
 *     EXP_TABLE[31]= 0x47800000
 *     EXP_TABLE[32]= 0x80000000
 */
  (__pyx_v_3gel_8protocol_8protocol_EXP_TABLE[0]) = 0;

  /* "gel/protocol/codecs/codecs.pyx":880
 * 
 *     EXP_TABLE[0] = 0
 *     EXP_TABLE[31]= 0x47800000             # <<<<<<<<<<<<<<
 *     EXP_TABLE[32]= 0x80000000
 *     EXP_TABLE[63]= 0xC7800000
 */
  (__pyx_v_3gel_8protocol_8protocol_EXP_TABLE[31]) = 0x47800000;

  /* "gel/protocol/codecs/codecs.pyx":881
 *     EXP_TABLE[0] = 0
 *     EXP_TABLE[31]= 0x47800000
 *     EXP_TABLE[32]= 0x80000000             # <<<<<<<<<<<<<<
 *     EXP_TABLE[63]= 0xC7800000
 *     for i in range(1, 31):
 */
  (__pyx_v_3gel_8protocol_8protocol_EXP_TABLE[32]) = 0x80000000;

  /* "gel/protocol/codecs/codecs.pyx":882
 *     EXP_TABLE[31]= 0x47800000
 *     EXP_TABLE[32]= 0x80000000
 *     EXP_TABLE[63]= 0xC7800000             # <<<<<<<<<<<<<<
 *     for i in range(1, 31):
 *         EXP_TABLE[i] = i << 23
 */
  (__pyx_v_3gel_8protocol_8protocol_EXP_TABLE[63]) = 0xC7800000;

  /* "gel/protocol/codecs/codecs.pyx":883
 *     EXP_TABLE[32]= 0x80000000
 *     EXP_TABLE[63]= 0xC7800000
 *     for i in range(1, 31):             # <<<<<<<<<<<<<<
 *         EXP_TABLE[i] = i << 23
 *     for i in range(33, 63):
 */
  for (__pyx_t_1 = 1; __pyx_t_1 < 31; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "gel/protocol/codecs/codecs.pyx":884
 *     EXP_TABLE[63]= 0xC7800000
 *     for i in range(1, 31):
 *         EXP_TABLE[i] = i << 23             # <<<<<<<<<<<<<<
 *     for i in range(33, 63):
 *         EXP_TABLE[i] = 0x80000000 + ((i - 32) << 23)
 */
    (__pyx_v_3gel_8protocol_8protocol_EXP_TABLE[__pyx_v_i]) = (__pyx_v_i << 23);
  }

  /* "gel/protocol/codecs/codecs.pyx":885
 *     for i in range(1, 31):
 *         EXP_TABLE[i] = i << 23
 *     for i in range(33, 63):             # <<<<<<<<<<<<<<
 *         EXP_TABLE[i] = 0x80000000 + ((i - 32) << 23)
 * 
 */
  for (__pyx_t_1 = 33; __pyx_t_1 < 63; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "gel/protocol/codecs/codecs.pyx":886
 *         EXP_TABLE[i] = i << 23
 *     for i in range(33, 63):
 *         EXP_TABLE[i] = 0x80000000 + ((i - 32) << 23)             # <<<<<<<<<<<<<<
 * 
 *     for i in range(64):
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(((__pyx_v_i - 32) << 23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyNumber_Add(__pyx_int_2147483648, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyInt_As_uint32_t(__pyx_t_4); if (unlikely((__pyx_t_3 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 886, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    (__pyx_v_3gel_8protocol_8protocol_EXP_TABLE[__pyx_v_i]) = __pyx_t_3;
  }

  /* "gel/protocol/codecs/codecs.pyx":888
 *         EXP_TABLE[i] = 0x80000000 + ((i - 32) << 23)
 * 
 *     for i in range(64):             # <<<<<<<<<<<<<<
 *         if i == 0 or i == 32:
 *             OFFSET_TABLE[i] = 0
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 64; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "gel/protocol/codecs/codecs.pyx":889
 * 
 *     for i in range(64):
 *         if i == 0 or i == 32:             # <<<<<<<<<<<<<<
 *             OFFSET_TABLE[i] = 0
 *         else:
 */
    switch (__pyx_v_i) {
      case 0:
      case 32:

      /* "gel/protocol/codecs/codecs.pyx":890
 *     for i in range(64):
 *         if i == 0 or i == 32:
 *             OFFSET_TABLE[i] = 0             # <<<<<<<<<<<<<<
 *         else:
 *             OFFSET_TABLE[i] = 1024
 */
      (__pyx_v_3gel_8protocol_8protocol_OFFSET_TABLE[__pyx_v_i]) = 0;

      /* "gel/protocol/codecs/codecs.pyx":889
 * 
 *     for i in range(64):
 *         if i == 0 or i == 32:             # <<<<<<<<<<<<<<
 *             OFFSET_TABLE[i] = 0
 *         else:
 */
      break;
      default:

      /* "gel/protocol/codecs/codecs.pyx":892
 *             OFFSET_TABLE[i] = 0
 *         else:
 *             OFFSET_TABLE[i] = 1024             # <<<<<<<<<<<<<<
 * 
 *     # Generate the f32 to f16 conversion tables
 */
      (__pyx_v_3gel_8protocol_8protocol_OFFSET_TABLE[__pyx_v_i]) = 0x400;
      break;
    }
  }

  /* "gel/protocol/codecs/codecs.pyx":895
 * 
 *     # Generate the f32 to f16 conversion tables
 *     for i in range(256):             # <<<<<<<<<<<<<<
 *         e = i - 127
 * 
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 0x100; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "gel/protocol/codecs/codecs.pyx":896
 *     # Generate the f32 to f16 conversion tables
 *     for i in range(256):
 *         e = i - 127             # <<<<<<<<<<<<<<
 * 
 *         # Very small numbers map to zero
 */
    __pyx_v_e = (__pyx_v_i - 0x7F);

    /* "gel/protocol/codecs/codecs.pyx":899
 * 
 *         # Very small numbers map to zero
 *         if e < -24:             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i] = 0
 *             BASE_TABLE[i + 256] = 0x8000
 */
    __pyx_t_5 = (__pyx_v_e < -24L);
    if (__pyx_t_5) {

      /* "gel/protocol/codecs/codecs.pyx":900
 *         # Very small numbers map to zero
 *         if e < -24:
 *             BASE_TABLE[i] = 0             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i + 256] = 0x8000
 *             SHIFT_TABLE[i] = 24
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[__pyx_v_i]) = 0;

      /* "gel/protocol/codecs/codecs.pyx":901
 *         if e < -24:
 *             BASE_TABLE[i] = 0
 *             BASE_TABLE[i + 256] = 0x8000             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i] = 24
 *             SHIFT_TABLE[i + 256] = 24
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[(__pyx_v_i + 0x100)]) = 0x8000;

      /* "gel/protocol/codecs/codecs.pyx":902
 *             BASE_TABLE[i] = 0
 *             BASE_TABLE[i + 256] = 0x8000
 *             SHIFT_TABLE[i] = 24             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i + 256] = 24
 * 
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[__pyx_v_i]) = 24;

      /* "gel/protocol/codecs/codecs.pyx":903
 *             BASE_TABLE[i + 256] = 0x8000
 *             SHIFT_TABLE[i] = 24
 *             SHIFT_TABLE[i + 256] = 24             # <<<<<<<<<<<<<<
 * 
 *         # Small numbers map to denorms
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[(__pyx_v_i + 0x100)]) = 24;

      /* "gel/protocol/codecs/codecs.pyx":899
 * 
 *         # Very small numbers map to zero
 *         if e < -24:             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i] = 0
 *             BASE_TABLE[i + 256] = 0x8000
 */
      goto __pyx_L15;
    }

    /* "gel/protocol/codecs/codecs.pyx":906
 * 
 *         # Small numbers map to denorms
 *         elif e < -14:             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i] = 0x0400 >> (-e - 14)
 *             BASE_TABLE[i + 256] = (0x0400 >> (-e - 14)) | 0x8000
 */
    __pyx_t_5 = (__pyx_v_e < -14L);
    if (__pyx_t_5) {

      /* "gel/protocol/codecs/codecs.pyx":907
 *         # Small numbers map to denorms
 *         elif e < -14:
 *             BASE_TABLE[i] = 0x0400 >> (-e - 14)             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i + 256] = (0x0400 >> (-e - 14)) | 0x8000
 *             SHIFT_TABLE[i] = -e - 1
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[__pyx_v_i]) = (0x0400 >> ((-__pyx_v_e) - 14));

      /* "gel/protocol/codecs/codecs.pyx":908
 *         elif e < -14:
 *             BASE_TABLE[i] = 0x0400 >> (-e - 14)
 *             BASE_TABLE[i + 256] = (0x0400 >> (-e - 14)) | 0x8000             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i] = -e - 1
 *             SHIFT_TABLE[i + 256] = -e - 1
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[(__pyx_v_i + 0x100)]) = ((0x0400 >> ((-__pyx_v_e) - 14)) | 0x8000);

      /* "gel/protocol/codecs/codecs.pyx":909
 *             BASE_TABLE[i] = 0x0400 >> (-e - 14)
 *             BASE_TABLE[i + 256] = (0x0400 >> (-e - 14)) | 0x8000
 *             SHIFT_TABLE[i] = -e - 1             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i + 256] = -e - 1
 * 
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[__pyx_v_i]) = ((-__pyx_v_e) - 1);

      /* "gel/protocol/codecs/codecs.pyx":910
 *             BASE_TABLE[i + 256] = (0x0400 >> (-e - 14)) | 0x8000
 *             SHIFT_TABLE[i] = -e - 1
 *             SHIFT_TABLE[i + 256] = -e - 1             # <<<<<<<<<<<<<<
 * 
 *         # Normal numbers just lose precision
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[(__pyx_v_i + 0x100)]) = ((-__pyx_v_e) - 1);

      /* "gel/protocol/codecs/codecs.pyx":906
 * 
 *         # Small numbers map to denorms
 *         elif e < -14:             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i] = 0x0400 >> (-e - 14)
 *             BASE_TABLE[i + 256] = (0x0400 >> (-e - 14)) | 0x8000
 */
      goto __pyx_L15;
    }

    /* "gel/protocol/codecs/codecs.pyx":913
 * 
 *         # Normal numbers just lose precision
 *         elif e <= 15:             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i] = (e + 15) << 10
 *             BASE_TABLE[i + 256] = ((e + 15) << 10) | 0x8000
 */
    __pyx_t_5 = (__pyx_v_e <= 15);
    if (__pyx_t_5) {

      /* "gel/protocol/codecs/codecs.pyx":914
 *         # Normal numbers just lose precision
 *         elif e <= 15:
 *             BASE_TABLE[i] = (e + 15) << 10             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i + 256] = ((e + 15) << 10) | 0x8000
 *             SHIFT_TABLE[i] = 13
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[__pyx_v_i]) = ((__pyx_v_e + 15) << 10);

      /* "gel/protocol/codecs/codecs.pyx":915
 *         elif e <= 15:
 *             BASE_TABLE[i] = (e + 15) << 10
 *             BASE_TABLE[i + 256] = ((e + 15) << 10) | 0x8000             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i] = 13
 *             SHIFT_TABLE[i + 256] = 13
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[(__pyx_v_i + 0x100)]) = (((__pyx_v_e + 15) << 10) | 0x8000);

      /* "gel/protocol/codecs/codecs.pyx":916
 *             BASE_TABLE[i] = (e + 15) << 10
 *             BASE_TABLE[i + 256] = ((e + 15) << 10) | 0x8000
 *             SHIFT_TABLE[i] = 13             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i + 256] = 13
 * 
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[__pyx_v_i]) = 13;

      /* "gel/protocol/codecs/codecs.pyx":917
 *             BASE_TABLE[i + 256] = ((e + 15) << 10) | 0x8000
 *             SHIFT_TABLE[i] = 13
 *             SHIFT_TABLE[i + 256] = 13             # <<<<<<<<<<<<<<
 * 
 *         # Large numbers map to Infinity
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[(__pyx_v_i + 0x100)]) = 13;

      /* "gel/protocol/codecs/codecs.pyx":913
 * 
 *         # Normal numbers just lose precision
 *         elif e <= 15:             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i] = (e + 15) << 10
 *             BASE_TABLE[i + 256] = ((e + 15) << 10) | 0x8000
 */
      goto __pyx_L15;
    }

    /* "gel/protocol/codecs/codecs.pyx":920
 * 
 *         # Large numbers map to Infinity
 *         elif e < 128:             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i] = 0x7C00
 *             BASE_TABLE[i + 256] = 0xFC00
 */
    __pyx_t_5 = (__pyx_v_e < 0x80);
    if (__pyx_t_5) {

      /* "gel/protocol/codecs/codecs.pyx":921
 *         # Large numbers map to Infinity
 *         elif e < 128:
 *             BASE_TABLE[i] = 0x7C00             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i + 256] = 0xFC00
 *             SHIFT_TABLE[i] = 24
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[__pyx_v_i]) = 0x7C00;

      /* "gel/protocol/codecs/codecs.pyx":922
 *         elif e < 128:
 *             BASE_TABLE[i] = 0x7C00
 *             BASE_TABLE[i + 256] = 0xFC00             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i] = 24
 *             SHIFT_TABLE[i + 256] = 24
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[(__pyx_v_i + 0x100)]) = 0xFC00;

      /* "gel/protocol/codecs/codecs.pyx":923
 *             BASE_TABLE[i] = 0x7C00
 *             BASE_TABLE[i + 256] = 0xFC00
 *             SHIFT_TABLE[i] = 24             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i + 256] = 24
 * 
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[__pyx_v_i]) = 24;

      /* "gel/protocol/codecs/codecs.pyx":924
 *             BASE_TABLE[i + 256] = 0xFC00
 *             SHIFT_TABLE[i] = 24
 *             SHIFT_TABLE[i + 256] = 24             # <<<<<<<<<<<<<<
 * 
 *         # Infinity and NaN's stay Infinity and NaN's
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[(__pyx_v_i + 0x100)]) = 24;

      /* "gel/protocol/codecs/codecs.pyx":920
 * 
 *         # Large numbers map to Infinity
 *         elif e < 128:             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i] = 0x7C00
 *             BASE_TABLE[i + 256] = 0xFC00
 */
      goto __pyx_L15;
    }

    /* "gel/protocol/codecs/codecs.pyx":928
 *         # Infinity and NaN's stay Infinity and NaN's
 *         else:
 *             BASE_TABLE[i] = 0x7C00             # <<<<<<<<<<<<<<
 *             BASE_TABLE[i + 256] = 0xFC00
 *             SHIFT_TABLE[i] = 13
 */
    /*else*/ {
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[__pyx_v_i]) = 0x7C00;

      /* "gel/protocol/codecs/codecs.pyx":929
 *         else:
 *             BASE_TABLE[i] = 0x7C00
 *             BASE_TABLE[i + 256] = 0xFC00             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i] = 13
 *             SHIFT_TABLE[i + 256] = 13
 */
      (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[(__pyx_v_i + 0x100)]) = 0xFC00;

      /* "gel/protocol/codecs/codecs.pyx":930
 *             BASE_TABLE[i] = 0x7C00
 *             BASE_TABLE[i + 256] = 0xFC00
 *             SHIFT_TABLE[i] = 13             # <<<<<<<<<<<<<<
 *             SHIFT_TABLE[i + 256] = 13
 * 
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[__pyx_v_i]) = 13;

      /* "gel/protocol/codecs/codecs.pyx":931
 *             BASE_TABLE[i + 256] = 0xFC00
 *             SHIFT_TABLE[i] = 13
 *             SHIFT_TABLE[i + 256] = 13             # <<<<<<<<<<<<<<
 * 
 * 
 */
      (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[(__pyx_v_i + 0x100)]) = 13;
    }
    __pyx_L15:;
  }

  /* "gel/protocol/codecs/codecs.pyx":867
 * 
 * 
 * cdef generate_tables():             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint32_t i
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.generate_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":937
 * 
 * 
 * cdef pgvector_hv_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                         object obj):
 *     cdef:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_hv_encode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  Py_ssize_t __pyx_v_objlen;
  Py_ssize_t __pyx_v_i;
  union __pyx_t_3gel_8protocol_8protocol_IntFloatSwap __pyx_v_swap;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  float __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pgvector_hv_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":945
 *         IntFloatSwap swap
 * 
 *     if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol__is_array_iterable(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 945, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (!__pyx_t_2);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/codecs.pyx":947
 *     if not _is_array_iterable(obj):
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                 type(obj).__name__))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_sized_iterable_container_expec, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "gel/protocol/codecs/codecs.pyx":948
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
 *                 type(obj).__name__))             # <<<<<<<<<<<<<<
 * 
 *     objlen = len(obj)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "gel/protocol/codecs/codecs.pyx":946
 * 
 *     if not _is_array_iterable(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             'a sized iterable container expected (got type {!r})'.format(
 *                 type(obj).__name__))
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 946, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":945
 *         IntFloatSwap swap
 * 
 *     if not _is_array_iterable(obj):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a sized iterable container expected (got type {!r})'.format(
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":950
 *                 type(obj).__name__))
 * 
 *     objlen = len(obj)             # <<<<<<<<<<<<<<
 *     if objlen > PGVECTOR_MAX_DIM:
 *         raise ValueError('too many elements in vector value')
 */
  __pyx_t_8 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(7, 950, __pyx_L1_error)
  __pyx_v_objlen = __pyx_t_8;

  /* "gel/protocol/codecs/codecs.pyx":951
 * 
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in vector value')
 * 
 */
  __pyx_t_3 = (__pyx_v_objlen > 0xFFFF);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/codecs/codecs.pyx":952
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:
 *         raise ValueError('too many elements in vector value')             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(4 + objlen * 2)
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 952, __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(7, 952, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":951
 * 
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in vector value')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":954
 *         raise ValueError('too many elements in vector value')
 * 
 *     buf.write_int32(4 + objlen * 2)             # <<<<<<<<<<<<<<
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (4 + (__pyx_v_objlen * 2))); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":955
 * 
 *     buf.write_int32(4 + objlen * 2)
 *     buf.write_int16(objlen)             # <<<<<<<<<<<<<<
 *     buf.write_int16(0)
 *     for i in range(objlen):
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_v_objlen); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":956
 *     buf.write_int32(4 + objlen * 2)
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)             # <<<<<<<<<<<<<<
 *     for i in range(objlen):
 *         swap.f = obj[i]
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":957
 *     buf.write_int16(objlen)
 *     buf.write_int16(0)
 *     for i in range(objlen):             # <<<<<<<<<<<<<<
 *         swap.f = obj[i]
 *         swap.i = (
 */
  __pyx_t_8 = __pyx_v_objlen;
  __pyx_t_9 = __pyx_t_8;
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
    __pyx_v_i = __pyx_t_10;

    /* "gel/protocol/codecs/codecs.pyx":958
 *     buf.write_int16(0)
 *     for i in range(objlen):
 *         swap.f = obj[i]             # <<<<<<<<<<<<<<
 *         swap.i = (
 *             BASE_TABLE[(swap.i >> 23) & 0x1ff]
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(7, 958, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_swap.f = __pyx_t_11;

    /* "gel/protocol/codecs/codecs.pyx":959
 *     for i in range(objlen):
 *         swap.f = obj[i]
 *         swap.i = (             # <<<<<<<<<<<<<<
 *             BASE_TABLE[(swap.i >> 23) & 0x1ff]
 *             + ((swap.i & 0x007fffff) >> SHIFT_TABLE[(swap.i >> 23) & 0x1ff])
 */
    __pyx_v_swap.i = ((__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[((__pyx_v_swap.i >> 23) & 0x1ff)]) + ((__pyx_v_swap.i & 0x007fffff) >> (__pyx_v_3gel_8protocol_8protocol_SHIFT_TABLE[((__pyx_v_swap.i >> 23) & 0x1ff)])));

    /* "gel/protocol/codecs/codecs.pyx":964
 *         )
 * 
 *         if swap.i == BASE_TABLE[255] or swap.i == BASE_TABLE[511]:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 '{!r} is out of range for type halfvec'.format(obj[i]))
 */
    __pyx_t_2 = (__pyx_v_swap.i == (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[0xFF]));
    if (!__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_2 = (__pyx_v_swap.i == (__pyx_v_3gel_8protocol_8protocol_BASE_TABLE[0x1FF]));
    __pyx_t_3 = __pyx_t_2;
    __pyx_L8_bool_binop_done:;
    if (unlikely(__pyx_t_3)) {

      /* "gel/protocol/codecs/codecs.pyx":966
 *         if swap.i == BASE_TABLE[255] or swap.i == BASE_TABLE[511]:
 *             raise ValueError(
 *                 '{!r} is out of range for type halfvec'.format(obj[i]))             # <<<<<<<<<<<<<<
 * 
 *         buf.write_int16(swap.i)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_r_is_out_of_range_for_type_half, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_obj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 966, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 966, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }

      /* "gel/protocol/codecs/codecs.pyx":965
 * 
 *         if swap.i == BASE_TABLE[255] or swap.i == BASE_TABLE[511]:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 '{!r} is out of range for type halfvec'.format(obj[i]))
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(7, 965, __pyx_L1_error)

      /* "gel/protocol/codecs/codecs.pyx":964
 *         )
 * 
 *         if swap.i == BASE_TABLE[255] or swap.i == BASE_TABLE[511]:             # <<<<<<<<<<<<<<
 *             raise ValueError(
 *                 '{!r} is out of range for type halfvec'.format(obj[i]))
 */
    }

    /* "gel/protocol/codecs/codecs.pyx":968
 *                 '{!r} is out of range for type halfvec'.format(obj[i]))
 * 
 *         buf.write_int16(swap.i)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_v_swap.i); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 968, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":937
 * 
 * 
 * cdef pgvector_hv_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                         object obj):
 *     cdef:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.pgvector_hv_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":974
 * 
 * 
 * cdef pgvector_hv_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t dim
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_hv_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  int32_t __pyx_v_dim;
  Py_ssize_t __pyx_v_size;
  char *__pyx_v_p;
  __Pyx_memviewslice __pyx_v_tmp_array_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_i;
  union __pyx_t_3gel_8protocol_8protocol_IntFloatSwap __pyx_v_swap;
  PyObject *__pyx_v_tmp = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_memviewslice __pyx_t_4 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int32_t __pyx_t_9;
  int32_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  uint32_t __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pgvector_hv_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":985
 *         IntFloatSwap swap
 * 
 *     dim = hton.unpack_uint16(frb_read(buf, 2))             # <<<<<<<<<<<<<<
 *     frb_read(buf, 2)
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 985, __pyx_L1_error)
  __pyx_v_dim = unpack_uint16(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":986
 * 
 *     dim = hton.unpack_uint16(frb_read(buf, 2))
 *     frb_read(buf, 2)             # <<<<<<<<<<<<<<
 * 
 *     # We'll read float16 values as an array of uint16 and then convert since
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 986, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":993
 *     # TODO: Potentially we might handle it differently if numpy is present since
 *     # numpy has half floats since 1.60.
 *     size = dim * 2             # <<<<<<<<<<<<<<
 *     p = frb_read(buf, size)
 *     tmp = ONE_EL16_ARRAY * dim
 */
  __pyx_v_size = (__pyx_v_dim * 2);

  /* "gel/protocol/codecs/codecs.pyx":994
 *     # numpy has half floats since 1.60.
 *     size = dim * 2
 *     p = frb_read(buf, size)             # <<<<<<<<<<<<<<
 *     tmp = ONE_EL16_ARRAY * dim
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, __pyx_v_size); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 994, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;

  /* "gel/protocol/codecs/codecs.pyx":995
 *     size = dim * 2
 *     p = frb_read(buf, size)
 *     tmp = ONE_EL16_ARRAY * dim             # <<<<<<<<<<<<<<
 * 
 *     # And fill it with the buffer contents
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_3gel_8protocol_8protocol_ONE_EL16_ARRAY, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_tmp = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":998
 * 
 *     # And fill it with the buffer contents
 *     tmp_array_view = tmp             # <<<<<<<<<<<<<<
 *     memcpy(&tmp_array_view[0], p, size)
 *     tmp.byteswap()
 */
  __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(__pyx_v_tmp, PyBUF_WRITABLE); if (unlikely(!__pyx_t_4.memview)) __PYX_ERR(7, 998, __pyx_L1_error)
  __pyx_v_tmp_array_view = __pyx_t_4;
  __pyx_t_4.memview = NULL;
  __pyx_t_4.data = NULL;

  /* "gel/protocol/codecs/codecs.pyx":999
 *     # And fill it with the buffer contents
 *     tmp_array_view = tmp
 *     memcpy(&tmp_array_view[0], p, size)             # <<<<<<<<<<<<<<
 *     tmp.byteswap()
 * 
 */
  __pyx_t_5 = 0;
  __pyx_t_6 = -1;
  if (__pyx_t_5 < 0) {
    __pyx_t_5 += __pyx_v_tmp_array_view.shape[0];
    if (unlikely(__pyx_t_5 < 0)) __pyx_t_6 = 0;
  } else if (unlikely(__pyx_t_5 >= __pyx_v_tmp_array_view.shape[0])) __pyx_t_6 = 0;
  if (unlikely(__pyx_t_6 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_6);
    __PYX_ERR(7, 999, __pyx_L1_error)
  }
  (void)(memcpy((&(*((unsigned short *) ( /* dim=0 */ (__pyx_v_tmp_array_view.data + __pyx_t_5 * __pyx_v_tmp_array_view.strides[0]) )))), __pyx_v_p, __pyx_v_size));

  /* "gel/protocol/codecs/codecs.pyx":1000
 *     tmp_array_view = tmp
 *     memcpy(&tmp_array_view[0], p, size)
 *     tmp.byteswap()             # <<<<<<<<<<<<<<
 * 
 *     # Create a float array with size dim
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1000, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1003
 * 
 *     # Create a float array with size dim
 *     val = ONE_EL_F32_ARRAY * dim             # <<<<<<<<<<<<<<
 *     for i in range(dim):
 *         swap.i = tmp[i]
 */
  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_3gel_8protocol_8protocol_ONE_EL_F32_ARRAY, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_val = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1004
 *     # Create a float array with size dim
 *     val = ONE_EL_F32_ARRAY * dim
 *     for i in range(dim):             # <<<<<<<<<<<<<<
 *         swap.i = tmp[i]
 *         swap.i = MANTISSA_TABLE[
 */
  __pyx_t_9 = __pyx_v_dim;
  __pyx_t_10 = __pyx_t_9;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "gel/protocol/codecs/codecs.pyx":1005
 *     val = ONE_EL_F32_ARRAY * dim
 *     for i in range(dim):
 *         swap.i = tmp[i]             # <<<<<<<<<<<<<<
 *         swap.i = MANTISSA_TABLE[
 *             OFFSET_TABLE[swap.i >> 10] + (swap.i & 0x000003ff)
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_tmp, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_12 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1005, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_swap.i = __pyx_t_12;

    /* "gel/protocol/codecs/codecs.pyx":1006
 *     for i in range(dim):
 *         swap.i = tmp[i]
 *         swap.i = MANTISSA_TABLE[             # <<<<<<<<<<<<<<
 *             OFFSET_TABLE[swap.i >> 10] + (swap.i & 0x000003ff)
 *         ] + EXP_TABLE[swap.i >> 10]
 */
    __pyx_v_swap.i = ((__pyx_v_3gel_8protocol_8protocol_MANTISSA_TABLE[((__pyx_v_3gel_8protocol_8protocol_OFFSET_TABLE[(__pyx_v_swap.i >> 10)]) + (__pyx_v_swap.i & 0x000003ff))]) + (__pyx_v_3gel_8protocol_8protocol_EXP_TABLE[(__pyx_v_swap.i >> 10)]));

    /* "gel/protocol/codecs/codecs.pyx":1009
 *             OFFSET_TABLE[swap.i >> 10] + (swap.i & 0x000003ff)
 *         ] + EXP_TABLE[swap.i >> 10]
 *         val[i] = swap.f             # <<<<<<<<<<<<<<
 * 
 *     return val
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_swap.f); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely((__Pyx_SetItemInt(__pyx_v_val, __pyx_v_i, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(7, 1009, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1011
 *         val[i] = swap.f
 * 
 *     return val             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_val);
  __pyx_r = __pyx_v_val;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":974
 * 
 * 
 * cdef pgvector_hv_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t dim
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_4, 1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.pgvector_hv_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_tmp_array_view, 1);
  __Pyx_XDECREF(__pyx_v_tmp);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1014
 * 
 * 
 * cdef pgvector_sv_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                         object obj):
 *     cdef:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_sv_encode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  int32_t __pyx_v_dim;
  Py_ssize_t __pyx_v_nnz;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_val = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int32_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_t_12;
  float __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pgvector_sv_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1020
 *         Py_ssize_t nnz
 * 
 *     if not (cpython.PyDict_Check(obj) or isinstance(obj, MappingABC)):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a dict or Mapping expected (got type {!r})'.format(
 */
  __pyx_t_2 = PyDict_Check(__pyx_v_obj);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_MappingABC); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 1020, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  __pyx_t_2 = (!__pyx_t_1);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":1022
 *     if not (cpython.PyDict_Check(obj) or isinstance(obj, MappingABC)):
 *         raise TypeError(
 *             'a dict or Mapping expected (got type {!r})'.format(             # <<<<<<<<<<<<<<
 *                 type(obj).__name__))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_a_dict_or_Mapping_expected_got_t, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "gel/protocol/codecs/codecs.pyx":1023
 *         raise TypeError(
 *             'a dict or Mapping expected (got type {!r})'.format(
 *                 type(obj).__name__))             # <<<<<<<<<<<<<<
 * 
 *     if 'dim' not in obj:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_obj)), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }

    /* "gel/protocol/codecs/codecs.pyx":1021
 * 
 *     if not (cpython.PyDict_Check(obj) or isinstance(obj, MappingABC)):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             'a dict or Mapping expected (got type {!r})'.format(
 *                 type(obj).__name__))
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(7, 1021, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":1020
 *         Py_ssize_t nnz
 * 
 *     if not (cpython.PyDict_Check(obj) or isinstance(obj, MappingABC)):             # <<<<<<<<<<<<<<
 *         raise TypeError(
 *             'a dict or Mapping expected (got type {!r})'.format(
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1025
 *                 type(obj).__name__))
 * 
 *     if 'dim' not in obj:             # <<<<<<<<<<<<<<
 *         raise TypeError('"dim" key is missing')
 * 
 */
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_dim, __pyx_v_obj, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 1025, __pyx_L1_error)
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":1026
 * 
 *     if 'dim' not in obj:
 *         raise TypeError('"dim" key is missing')             # <<<<<<<<<<<<<<
 * 
 *     dim = obj['dim']
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1026, __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(7, 1026, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":1025
 *                 type(obj).__name__))
 * 
 *     if 'dim' not in obj:             # <<<<<<<<<<<<<<
 *         raise TypeError('"dim" key is missing')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1028
 *         raise TypeError('"dim" key is missing')
 * 
 *     dim = obj['dim']             # <<<<<<<<<<<<<<
 * 
 *     # One of the keys is 'dim' so nnz is one less than the length
 */
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_u_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1028, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_t_4); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1028, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_dim = __pyx_t_8;

  /* "gel/protocol/codecs/codecs.pyx":1031
 * 
 *     # One of the keys is 'dim' so nnz is one less than the length
 *     nnz = len(obj) - 1             # <<<<<<<<<<<<<<
 *     if nnz > PGVECTOR_MAX_DIM or nnz > dim:
 *         raise ValueError('too many elements in vector value')
 */
  __pyx_t_9 = PyObject_Length(__pyx_v_obj); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1031, __pyx_L1_error)
  __pyx_v_nnz = (__pyx_t_9 - 1);

  /* "gel/protocol/codecs/codecs.pyx":1032
 *     # One of the keys is 'dim' so nnz is one less than the length
 *     nnz = len(obj) - 1
 *     if nnz > PGVECTOR_MAX_DIM or nnz > dim:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in vector value')
 * 
 */
  __pyx_t_1 = (__pyx_v_nnz > 0xFFFF);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_1 = (__pyx_v_nnz > __pyx_v_dim);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L8_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":1033
 *     nnz = len(obj) - 1
 *     if nnz > PGVECTOR_MAX_DIM or nnz > dim:
 *         raise ValueError('too many elements in vector value')             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(4 * (3 + 2 * nnz))
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1033, __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(7, 1033, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":1032
 *     # One of the keys is 'dim' so nnz is one less than the length
 *     nnz = len(obj) - 1
 *     if nnz > PGVECTOR_MAX_DIM or nnz > dim:             # <<<<<<<<<<<<<<
 *         raise ValueError('too many elements in vector value')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1035
 *         raise ValueError('too many elements in vector value')
 * 
 *     buf.write_int32(4 * (3 + 2 * nnz))             # <<<<<<<<<<<<<<
 *     buf.write_int32(dim)
 *     buf.write_int32(nnz)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (4 * (3 + (2 * __pyx_v_nnz)))); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1035, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1036
 * 
 *     buf.write_int32(4 * (3 + 2 * nnz))
 *     buf.write_int32(dim)             # <<<<<<<<<<<<<<
 *     buf.write_int32(nnz)
 *     buf.write_int32(0)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1037
 *     buf.write_int32(4 * (3 + 2 * nnz))
 *     buf.write_int32(dim)
 *     buf.write_int32(nnz)             # <<<<<<<<<<<<<<
 *     buf.write_int32(0)
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_v_nnz); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1037, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1038
 *     buf.write_int32(dim)
 *     buf.write_int32(nnz)
 *     buf.write_int32(0)             # <<<<<<<<<<<<<<
 * 
 *     for key in obj.keys():
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1038, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1040
 *     buf.write_int32(0)
 * 
 *     for key in obj.keys():             # <<<<<<<<<<<<<<
 *         if key != 'dim':
 *             ensure_is_int(key)
 */
  __pyx_t_9 = 0;
  if (unlikely(__pyx_v_obj == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
    __PYX_ERR(7, 1040, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_obj, 0, __pyx_n_s_keys, (&__pyx_t_10), (&__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1040, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __pyx_t_4 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_10, &__pyx_t_9, &__pyx_t_3, NULL, NULL, __pyx_t_11);
    if (unlikely(__pyx_t_12 == 0)) break;
    if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(7, 1040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1041
 * 
 *     for key in obj.keys():
 *         if key != 'dim':             # <<<<<<<<<<<<<<
 *             ensure_is_int(key)
 *             buf.write_int32(key)
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_dim, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 1041, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":1042
 *     for key in obj.keys():
 *         if key != 'dim':
 *             ensure_is_int(key)             # <<<<<<<<<<<<<<
 *             buf.write_int32(key)
 * 
 */
      __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_ensure_is_int(__pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1042, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "gel/protocol/codecs/codecs.pyx":1043
 *         if key != 'dim':
 *             ensure_is_int(key)
 *             buf.write_int32(key)             # <<<<<<<<<<<<<<
 * 
 *     for key, val in obj.items():
 */
      __pyx_t_8 = __Pyx_PyInt_As_int32_t(__pyx_v_key); if (unlikely((__pyx_t_8 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1043, __pyx_L1_error)
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1043, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "gel/protocol/codecs/codecs.pyx":1041
 * 
 *     for key in obj.keys():
 *         if key != 'dim':             # <<<<<<<<<<<<<<
 *             ensure_is_int(key)
 *             buf.write_int32(key)
 */
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1045
 *             buf.write_int32(key)
 * 
 *     for key, val in obj.items():             # <<<<<<<<<<<<<<
 *         if key != 'dim':
 *             if val == 0:
 */
  __pyx_t_10 = 0;
  if (unlikely(__pyx_v_obj == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(7, 1045, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_obj, 0, __pyx_n_s_items, (&__pyx_t_9), (&__pyx_t_11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __pyx_t_4 = __pyx_t_3;
  __pyx_t_3 = 0;
  while (1) {
    __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_9, &__pyx_t_10, &__pyx_t_3, &__pyx_t_5, NULL, __pyx_t_11);
    if (unlikely(__pyx_t_12 == 0)) break;
    if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(7, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1046
 * 
 *     for key, val in obj.items():
 *         if key != 'dim':             # <<<<<<<<<<<<<<
 *             if val == 0:
 *                 raise ValueError('elements in a sparse vector cannot be 0')
 */
    __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_dim, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 1046, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":1047
 *     for key, val in obj.items():
 *         if key != 'dim':
 *             if val == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('elements in a sparse vector cannot be 0')
 *             buf.write_float(<float>val)
 */
      __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_val, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 1047, __pyx_L1_error)
      if (unlikely(__pyx_t_2)) {

        /* "gel/protocol/codecs/codecs.pyx":1048
 *         if key != 'dim':
 *             if val == 0:
 *                 raise ValueError('elements in a sparse vector cannot be 0')             # <<<<<<<<<<<<<<
 *             buf.write_float(<float>val)
 * 
 */
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1048, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(7, 1048, __pyx_L1_error)

        /* "gel/protocol/codecs/codecs.pyx":1047
 *     for key, val in obj.items():
 *         if key != 'dim':
 *             if val == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('elements in a sparse vector cannot be 0')
 *             buf.write_float(<float>val)
 */
      }

      /* "gel/protocol/codecs/codecs.pyx":1049
 *             if val == 0:
 *                 raise ValueError('elements in a sparse vector cannot be 0')
 *             buf.write_float(<float>val)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_v_val); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) __PYX_ERR(7, 1049, __pyx_L1_error)
      __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_float(__pyx_v_buf, ((float)__pyx_t_13)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1049, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "gel/protocol/codecs/codecs.pyx":1046
 * 
 *     for key, val in obj.items():
 *         if key != 'dim':             # <<<<<<<<<<<<<<
 *             if val == 0:
 *                 raise ValueError('elements in a sparse vector cannot be 0')
 */
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1014
 * 
 * 
 * cdef pgvector_sv_encode(pgproto.CodecContext settings, WriteBuffer buf,             # <<<<<<<<<<<<<<
 *                         object obj):
 *     cdef:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.pgvector_sv_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1055
 * 
 * 
 * cdef pgvector_sv_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t dim
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_pgvector_sv_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  int32_t __pyx_v_dim;
  int32_t __pyx_v_nnz;
  Py_ssize_t __pyx_v_size;
  char *__pyx_v_p;
  __Pyx_memviewslice __pyx_v_array_view = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_keys = NULL;
  PyObject *__pyx_v_vals = NULL;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int32_t __pyx_t_4;
  int32_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("pgvector_sv_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1064
 *         Py_ssize_t i
 * 
 *     dim = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *     nnz = hton.unpack_int32(frb_read(buf, 4))
 *     frb_read(buf, 4)
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1064, __pyx_L1_error)
  __pyx_v_dim = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":1065
 * 
 *     dim = hton.unpack_int32(frb_read(buf, 4))
 *     nnz = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 *     frb_read(buf, 4)
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1065, __pyx_L1_error)
  __pyx_v_nnz = unpack_int32(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":1066
 *     dim = hton.unpack_int32(frb_read(buf, 4))
 *     nnz = hton.unpack_int32(frb_read(buf, 4))
 *     frb_read(buf, 4)             # <<<<<<<<<<<<<<
 * 
 *     # Create an int array with size nnz (for indexes)
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1066, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":1069
 * 
 *     # Create an int array with size nnz (for indexes)
 *     keys = ONE_EL_I32_ARRAY * nnz             # <<<<<<<<<<<<<<
 *     for i in range(nnz):
 *         keys[i] = hton.unpack_int32(frb_read(buf, 4))
 */
  __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_nnz); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_3gel_8protocol_8protocol_ONE_EL_I32_ARRAY, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_keys = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1070
 *     # Create an int array with size nnz (for indexes)
 *     keys = ONE_EL_I32_ARRAY * nnz
 *     for i in range(nnz):             # <<<<<<<<<<<<<<
 *         keys[i] = hton.unpack_int32(frb_read(buf, 4))
 * 
 */
  __pyx_t_4 = __pyx_v_nnz;
  __pyx_t_5 = __pyx_t_4;
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
    __pyx_v_i = __pyx_t_6;

    /* "gel/protocol/codecs/codecs.pyx":1071
 *     keys = ONE_EL_I32_ARRAY * nnz
 *     for i in range(nnz):
 *         keys[i] = hton.unpack_int32(frb_read(buf, 4))             # <<<<<<<<<<<<<<
 * 
 *     size = nnz * 4
 */
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 4); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1071, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyInt_From_int32_t(unpack_int32(__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely((__Pyx_SetItemInt(__pyx_v_keys, __pyx_v_i, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1) < 0))) __PYX_ERR(7, 1071, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1073
 *         keys[i] = hton.unpack_int32(frb_read(buf, 4))
 * 
 *     size = nnz * 4             # <<<<<<<<<<<<<<
 *     p = frb_read(buf, size)
 * 
 */
  __pyx_v_size = (__pyx_v_nnz * 4);

  /* "gel/protocol/codecs/codecs.pyx":1074
 * 
 *     size = nnz * 4
 *     p = frb_read(buf, size)             # <<<<<<<<<<<<<<
 * 
 *     # Create a float array with size nnz (for values)
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, __pyx_v_size); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1074, __pyx_L1_error)
  __pyx_v_p = __pyx_t_1;

  /* "gel/protocol/codecs/codecs.pyx":1077
 * 
 *     # Create a float array with size nnz (for values)
 *     vals = ONE_EL_F32_ARRAY * nnz             # <<<<<<<<<<<<<<
 * 
 *     # And fill it with the buffer contents
 */
  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_nnz); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_3gel_8protocol_8protocol_ONE_EL_F32_ARRAY, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_vals = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1080
 * 
 *     # And fill it with the buffer contents
 *     array_view = vals             # <<<<<<<<<<<<<<
 *     memcpy(&array_view[0], p, size)
 *     vals.byteswap()
 */
  __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_vals, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(7, 1080, __pyx_L1_error)
  __pyx_v_array_view = __pyx_t_7;
  __pyx_t_7.memview = NULL;
  __pyx_t_7.data = NULL;

  /* "gel/protocol/codecs/codecs.pyx":1081
 *     # And fill it with the buffer contents
 *     array_view = vals
 *     memcpy(&array_view[0], p, size)             # <<<<<<<<<<<<<<
 *     vals.byteswap()
 * 
 */
  __pyx_t_8 = 0;
  __pyx_t_9 = -1;
  if (__pyx_t_8 < 0) {
    __pyx_t_8 += __pyx_v_array_view.shape[0];
    if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
  } else if (unlikely(__pyx_t_8 >= __pyx_v_array_view.shape[0])) __pyx_t_9 = 0;
  if (unlikely(__pyx_t_9 != -1)) {
    __Pyx_RaiseBufferIndexError(__pyx_t_9);
    __PYX_ERR(7, 1081, __pyx_L1_error)
  }
  (void)(memcpy((&(*((float *) ( /* dim=0 */ (__pyx_v_array_view.data + __pyx_t_8 * __pyx_v_array_view.strides[0]) )))), __pyx_v_p, __pyx_v_size));

  /* "gel/protocol/codecs/codecs.pyx":1082
 *     array_view = vals
 *     memcpy(&array_view[0], p, size)
 *     vals.byteswap()             # <<<<<<<<<<<<<<
 * 
 *     res = {'dim': dim}
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vals, __pyx_n_s_byteswap); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1082, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1084
 *     vals.byteswap()
 * 
 *     res = {'dim': dim}             # <<<<<<<<<<<<<<
 *     res.update(zip(keys, vals))
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_dim, __pyx_t_3) < 0) __PYX_ERR(7, 1084, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_res = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1085
 * 
 *     res = {'dim': dim}
 *     res.update(zip(keys, vals))             # <<<<<<<<<<<<<<
 * 
 *     return res
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_keys);
  __Pyx_GIVEREF(__pyx_v_keys);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_keys)) __PYX_ERR(7, 1085, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_vals);
  __Pyx_GIVEREF(__pyx_v_vals);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vals)) __PYX_ERR(7, 1085, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_update, __pyx_v_res, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1087
 *     res.update(zip(keys, vals))
 * 
 *     return res             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":1055
 * 
 * 
 * cdef pgvector_sv_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         int32_t dim
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("gel.protocol.protocol.pgvector_sv_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __PYX_XCLEAR_MEMVIEW(&__pyx_v_array_view, 1);
  __Pyx_XDECREF(__pyx_v_keys);
  __Pyx_XDECREF(__pyx_v_vals);
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1090
 * 
 * 
 * cdef checked_decimal_encode(             # <<<<<<<<<<<<<<
 *     pgproto.CodecContext settings, WriteBuffer buf, obj
 * ):
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_checked_decimal_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("checked_decimal_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1093
 *     pgproto.CodecContext settings, WriteBuffer buf, obj
 * ):
 *     if not isinstance(obj, decimal.Decimal) and not isinstance(obj, int):             # <<<<<<<<<<<<<<
 *         raise TypeError('expected a Decimal or an int')
 *     pgproto.numeric_encode_binary(settings, buf, obj)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decimal); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 1093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = (!__pyx_t_4);
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = PyInt_Check(__pyx_v_obj); 
  __pyx_t_4 = (!__pyx_t_5);
  __pyx_t_1 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/codecs.pyx":1094
 * ):
 *     if not isinstance(obj, decimal.Decimal) and not isinstance(obj, int):
 *         raise TypeError('expected a Decimal or an int')             # <<<<<<<<<<<<<<
 *     pgproto.numeric_encode_binary(settings, buf, obj)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1094, __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(7, 1094, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":1093
 *     pgproto.CodecContext settings, WriteBuffer buf, obj
 * ):
 *     if not isinstance(obj, decimal.Decimal) and not isinstance(obj, int):             # <<<<<<<<<<<<<<
 *         raise TypeError('expected a Decimal or an int')
 *     pgproto.numeric_encode_binary(settings, buf, obj)
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1095
 *     if not isinstance(obj, decimal.Decimal) and not isinstance(obj, int):
 *         raise TypeError('expected a Decimal or an int')
 *     pgproto.numeric_encode_binary(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_numeric_encode_binary(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1095, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1090
 * 
 * 
 * cdef checked_decimal_encode(             # <<<<<<<<<<<<<<
 *     pgproto.CodecContext settings, WriteBuffer buf, obj
 * ):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.checked_decimal_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1098
 * 
 * 
 * cdef decimal_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     return pgproto.numeric_decode_binary_ex(settings, buf, True)
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_decimal_decode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  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("decimal_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1099
 * 
 * cdef decimal_decode(pgproto.CodecContext settings, FRBuffer *buf):
 *     return pgproto.numeric_decode_binary_ex(settings, buf, True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_numeric_decode_binary_ex(__pyx_v_settings, __pyx_v_buf, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1099, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":1098
 * 
 * 
 * cdef decimal_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     return pgproto.numeric_decode_binary_ex(settings, buf, True)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.decimal_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1102
 * 
 * 
 * cdef ensure_is_int(obj):             # <<<<<<<<<<<<<<
 *     if type(obj) is not int and not isinstance(obj, int):
 *         raise TypeError('expected an int')
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_ensure_is_int(PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ensure_is_int", 1);

  /* "gel/protocol/codecs/codecs.pyx":1103
 * 
 * cdef ensure_is_int(obj):
 *     if type(obj) is not int and not isinstance(obj, int):             # <<<<<<<<<<<<<<
 *         raise TypeError('expected an int')
 * 
 */
  __pyx_t_2 = (((PyObject *)Py_TYPE(__pyx_v_obj)) != ((PyObject *)(&PyInt_Type)));
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyInt_Check(__pyx_v_obj); 
  __pyx_t_3 = (!__pyx_t_2);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/codecs/codecs.pyx":1104
 * cdef ensure_is_int(obj):
 *     if type(obj) is not int and not isinstance(obj, int):
 *         raise TypeError('expected an int')             # <<<<<<<<<<<<<<
 * 
 * cdef checked_int2_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1104, __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(7, 1104, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":1103
 * 
 * cdef ensure_is_int(obj):
 *     if type(obj) is not int and not isinstance(obj, int):             # <<<<<<<<<<<<<<
 *         raise TypeError('expected an int')
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1102
 * 
 * 
 * cdef ensure_is_int(obj):             # <<<<<<<<<<<<<<
 *     if type(obj) is not int and not isinstance(obj, int):
 *         raise TypeError('expected an int')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.ensure_is_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1106
 *         raise TypeError('expected an int')
 * 
 * cdef checked_int2_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     ensure_is_int(obj)
 *     pgproto.int2_encode(settings, buf, obj)
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_checked_int2_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  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("checked_int2_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1107
 * 
 * cdef checked_int2_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     ensure_is_int(obj)             # <<<<<<<<<<<<<<
 *     pgproto.int2_encode(settings, buf, obj)
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_ensure_is_int(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1108
 * cdef checked_int2_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     ensure_is_int(obj)
 *     pgproto.int2_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_int2_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1106
 *         raise TypeError('expected an int')
 * 
 * cdef checked_int2_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     ensure_is_int(obj)
 *     pgproto.int2_encode(settings, buf, obj)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.checked_int2_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1111
 * 
 * 
 * cdef checked_int4_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     ensure_is_int(obj)
 *     pgproto.int4_encode(settings, buf, obj)
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_checked_int4_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  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("checked_int4_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1112
 * 
 * cdef checked_int4_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     ensure_is_int(obj)             # <<<<<<<<<<<<<<
 *     pgproto.int4_encode(settings, buf, obj)
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_ensure_is_int(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1113
 * cdef checked_int4_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     ensure_is_int(obj)
 *     pgproto.int4_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_int4_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1111
 * 
 * 
 * cdef checked_int4_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     ensure_is_int(obj)
 *     pgproto.int4_encode(settings, buf, obj)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.checked_int4_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1116
 * 
 * 
 * cdef checked_int8_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     ensure_is_int(obj)
 *     pgproto.int8_encode(settings, buf, obj)
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_checked_int8_encode(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  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("checked_int8_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1117
 * 
 * cdef checked_int8_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     ensure_is_int(obj)             # <<<<<<<<<<<<<<
 *     pgproto.int8_encode(settings, buf, obj)
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_ensure_is_int(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1118
 * cdef checked_int8_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     ensure_is_int(obj)
 *     pgproto.int8_encode(settings, buf, obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_int8_encode(__pyx_v_settings, __pyx_v_buf, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1116
 * 
 * 
 * cdef checked_int8_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     ensure_is_int(obj)
 *     pgproto.int8_encode(settings, buf, obj)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.checked_int8_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1121
 * 
 * 
 * cdef bigint_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint16_t sign = NUMERIC_POS
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_bigint_encode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  uint16_t __pyx_v_sign;
  PyObject *__pyx_v_digits = 0;
  PyObject *__pyx_v_mod = NULL;
  PyObject *__pyx_v_dig = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int16_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bigint_encode", 0);
  __Pyx_INCREF(__pyx_v_obj);

  /* "gel/protocol/codecs/codecs.pyx":1123
 * cdef bigint_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     cdef:
 *         uint16_t sign = NUMERIC_POS             # <<<<<<<<<<<<<<
 *         list digits = []
 * 
 */
  __pyx_v_sign = 0;

  /* "gel/protocol/codecs/codecs.pyx":1124
 *     cdef:
 *         uint16_t sign = NUMERIC_POS
 *         list digits = []             # <<<<<<<<<<<<<<
 * 
 *     ensure_is_int(obj)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_digits = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1126
 *         list digits = []
 * 
 *     ensure_is_int(obj)             # <<<<<<<<<<<<<<
 * 
 *     if obj == 0:
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_ensure_is_int(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1128
 *     ensure_is_int(obj)
 * 
 *     if obj == 0:             # <<<<<<<<<<<<<<
 *         buf.write_int32(8)  # len
 *         buf.write_int32(0)  # ndigits + weight
 */
  __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_obj, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 1128, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":1129
 * 
 *     if obj == 0:
 *         buf.write_int32(8)  # len             # <<<<<<<<<<<<<<
 *         buf.write_int32(0)  # ndigits + weight
 *         buf.write_int16(NUMERIC_POS)  # sign
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 8); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1130
 *     if obj == 0:
 *         buf.write_int32(8)  # len
 *         buf.write_int32(0)  # ndigits + weight             # <<<<<<<<<<<<<<
 *         buf.write_int16(NUMERIC_POS)  # sign
 *         buf.write_int16(0)  # dscale
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1131
 *         buf.write_int32(8)  # len
 *         buf.write_int32(0)  # ndigits + weight
 *         buf.write_int16(NUMERIC_POS)  # sign             # <<<<<<<<<<<<<<
 *         buf.write_int16(0)  # dscale
 *         return
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1132
 *         buf.write_int32(0)  # ndigits + weight
 *         buf.write_int16(NUMERIC_POS)  # sign
 *         buf.write_int16(0)  # dscale             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1133
 *         buf.write_int16(NUMERIC_POS)  # sign
 *         buf.write_int16(0)  # dscale
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if obj < 0:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "gel/protocol/codecs/codecs.pyx":1128
 *     ensure_is_int(obj)
 * 
 *     if obj == 0:             # <<<<<<<<<<<<<<
 *         buf.write_int32(8)  # len
 *         buf.write_int32(0)  # ndigits + weight
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1135
 *         return
 * 
 *     if obj < 0:             # <<<<<<<<<<<<<<
 *         sign = NUMERIC_NEG
 *         obj = -obj
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_obj, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1135, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":1136
 * 
 *     if obj < 0:
 *         sign = NUMERIC_NEG             # <<<<<<<<<<<<<<
 *         obj = -obj
 * 
 */
    __pyx_v_sign = 0x4000;

    /* "gel/protocol/codecs/codecs.pyx":1137
 *     if obj < 0:
 *         sign = NUMERIC_NEG
 *         obj = -obj             # <<<<<<<<<<<<<<
 * 
 *     while obj:
 */
    __pyx_t_1 = PyNumber_Negative(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1135
 *         return
 * 
 *     if obj < 0:             # <<<<<<<<<<<<<<
 *         sign = NUMERIC_NEG
 *         obj = -obj
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1139
 *         obj = -obj
 * 
 *     while obj:             # <<<<<<<<<<<<<<
 *         mod = obj % NBASE
 *         obj //= NBASE
 */
  while (1) {
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(7, 1139, __pyx_L1_error)
    if (!__pyx_t_2) break;

    /* "gel/protocol/codecs/codecs.pyx":1140
 * 
 *     while obj:
 *         mod = obj % NBASE             # <<<<<<<<<<<<<<
 *         obj //= NBASE
 *         digits.append(mod)
 */
    __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_obj, __pyx_int_10000, 0x2710, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_mod, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1141
 *     while obj:
 *         mod = obj % NBASE
 *         obj //= NBASE             # <<<<<<<<<<<<<<
 *         digits.append(mod)
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_obj, __pyx_int_10000, 0x2710, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1142
 *         mod = obj % NBASE
 *         obj //= NBASE
 *         digits.append(mod)             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(8 + len(digits) * 2)  # len
 */
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_digits, __pyx_v_mod); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 1142, __pyx_L1_error)
  }

  /* "gel/protocol/codecs/codecs.pyx":1144
 *         digits.append(mod)
 * 
 *     buf.write_int32(8 + len(digits) * 2)  # len             # <<<<<<<<<<<<<<
 *     buf.write_int16(len(digits))  # ndigits
 *     buf.write_int16(len(digits) - 1)  # weight
 */
  __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_v_digits); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1144, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, (8 + (__pyx_t_4 * 2))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1145
 * 
 *     buf.write_int32(8 + len(digits) * 2)  # len
 *     buf.write_int16(len(digits))  # ndigits             # <<<<<<<<<<<<<<
 *     buf.write_int16(len(digits) - 1)  # weight
 *     buf.write_int16(sign)  # sign
 */
  __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_v_digits); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1145, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1146
 *     buf.write_int32(8 + len(digits) * 2)  # len
 *     buf.write_int16(len(digits))  # ndigits
 *     buf.write_int16(len(digits) - 1)  # weight             # <<<<<<<<<<<<<<
 *     buf.write_int16(sign)  # sign
 *     buf.write_int16(0)  # dscale
 */
  __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_v_digits); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1146, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, (__pyx_t_4 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1147
 *     buf.write_int16(len(digits))  # ndigits
 *     buf.write_int16(len(digits) - 1)  # weight
 *     buf.write_int16(sign)  # sign             # <<<<<<<<<<<<<<
 *     buf.write_int16(0)  # dscale
 *     for dig in reversed(digits):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_v_sign); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1148
 *     buf.write_int16(len(digits) - 1)  # weight
 *     buf.write_int16(sign)  # sign
 *     buf.write_int16(0)  # dscale             # <<<<<<<<<<<<<<
 *     for dig in reversed(digits):
 *         buf.write_int16(dig)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1149
 *     buf.write_int16(sign)  # sign
 *     buf.write_int16(0)  # dscale
 *     for dig in reversed(digits):             # <<<<<<<<<<<<<<
 *         buf.write_int16(dig)
 * 
 */
  __pyx_t_1 = __pyx_v_digits; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyList_GET_SIZE(__pyx_t_1);
  #if !CYTHON_ASSUME_SAFE_MACROS
  if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(7, 1149, __pyx_L1_error)
  #endif
  --__pyx_t_4;
  for (;;) {
    if (__pyx_t_4 < 0) break;
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(7, 1149, __pyx_L1_error)
      #endif
      if (__pyx_t_4 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4--; if (unlikely((0 < 0))) __PYX_ERR(7, 1149, __pyx_L1_error)
    #else
    __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4--; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_dig, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1150
 *     buf.write_int16(0)  # dscale
 *     for dig in reversed(digits):
 *         buf.write_int16(dig)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_dig); if (unlikely((__pyx_t_6 == ((int16_t)-1)) && PyErr_Occurred())) __PYX_ERR(7, 1150, __pyx_L1_error)
    __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "gel/protocol/codecs/codecs.pyx":1149
 *     buf.write_int16(sign)  # sign
 *     buf.write_int16(0)  # dscale
 *     for dig in reversed(digits):             # <<<<<<<<<<<<<<
 *         buf.write_int16(dig)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1121
 * 
 * 
 * cdef bigint_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint16_t sign = NUMERIC_POS
 */

  /* 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_5);
  __Pyx_AddTraceback("gel.protocol.protocol.bigint_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_digits);
  __Pyx_XDECREF(__pyx_v_mod);
  __Pyx_XDECREF(__pyx_v_dig);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1153
 * 
 * 
 * cdef bigint_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint16_t ndigits = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_bigint_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  uint16_t __pyx_v_ndigits;
  uint16_t __pyx_v_weight;
  uint16_t __pyx_v_sign;
  uint16_t __pyx_v_dscale;
  PyObject *__pyx_v_result = 0;
  int32_t __pyx_v_i;
  uint16_t __pyx_v_d;
  PyObject *__pyx_v_num = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("bigint_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1155
 * cdef bigint_decode(pgproto.CodecContext settings, FRBuffer *buf):
 *     cdef:
 *         uint16_t ndigits = <uint16_t>hton.unpack_int16(frb_read(buf, 2))             # <<<<<<<<<<<<<<
 *         uint16_t weight = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         uint16_t sign = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1155, __pyx_L1_error)
  __pyx_v_ndigits = ((uint16_t)unpack_int16(__pyx_t_1));

  /* "gel/protocol/codecs/codecs.pyx":1156
 *     cdef:
 *         uint16_t ndigits = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         uint16_t weight = <uint16_t>hton.unpack_int16(frb_read(buf, 2))             # <<<<<<<<<<<<<<
 *         uint16_t sign = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         uint16_t dscale = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1156, __pyx_L1_error)
  __pyx_v_weight = ((uint16_t)unpack_int16(__pyx_t_1));

  /* "gel/protocol/codecs/codecs.pyx":1157
 *         uint16_t ndigits = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         uint16_t weight = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         uint16_t sign = <uint16_t>hton.unpack_int16(frb_read(buf, 2))             # <<<<<<<<<<<<<<
 *         uint16_t dscale = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         result = ''
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1157, __pyx_L1_error)
  __pyx_v_sign = ((uint16_t)unpack_int16(__pyx_t_1));

  /* "gel/protocol/codecs/codecs.pyx":1158
 *         uint16_t weight = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         uint16_t sign = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         uint16_t dscale = <uint16_t>hton.unpack_int16(frb_read(buf, 2))             # <<<<<<<<<<<<<<
 *         result = ''
 *         int32_t i = <int32_t>weight
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1158, __pyx_L1_error)
  __pyx_v_dscale = ((uint16_t)unpack_int16(__pyx_t_1));

  /* "gel/protocol/codecs/codecs.pyx":1159
 *         uint16_t sign = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         uint16_t dscale = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         result = ''             # <<<<<<<<<<<<<<
 *         int32_t i = <int32_t>weight
 *         uint16_t d = 0
 */
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_v_result = __pyx_kp_u_;

  /* "gel/protocol/codecs/codecs.pyx":1160
 *         uint16_t dscale = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 *         result = ''
 *         int32_t i = <int32_t>weight             # <<<<<<<<<<<<<<
 *         uint16_t d = 0
 * 
 */
  __pyx_v_i = ((int32_t)__pyx_v_weight);

  /* "gel/protocol/codecs/codecs.pyx":1161
 *         result = ''
 *         int32_t i = <int32_t>weight
 *         uint16_t d = 0             # <<<<<<<<<<<<<<
 * 
 *     if sign == NUMERIC_NEG:
 */
  __pyx_v_d = 0;

  /* "gel/protocol/codecs/codecs.pyx":1163
 *         uint16_t d = 0
 * 
 *     if sign == NUMERIC_NEG:             # <<<<<<<<<<<<<<
 *         result = '-'
 *     elif sign != NUMERIC_POS:
 */
  __pyx_t_2 = (__pyx_v_sign == 0x4000);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":1164
 * 
 *     if sign == NUMERIC_NEG:
 *         result = '-'             # <<<<<<<<<<<<<<
 *     elif sign != NUMERIC_POS:
 *         raise ValueError("bad bigint sign data")
 */
    __Pyx_INCREF(__pyx_kp_u__48);
    __Pyx_DECREF_SET(__pyx_v_result, __pyx_kp_u__48);

    /* "gel/protocol/codecs/codecs.pyx":1163
 *         uint16_t d = 0
 * 
 *     if sign == NUMERIC_NEG:             # <<<<<<<<<<<<<<
 *         result = '-'
 *     elif sign != NUMERIC_POS:
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/codecs/codecs.pyx":1165
 *     if sign == NUMERIC_NEG:
 *         result = '-'
 *     elif sign != NUMERIC_POS:             # <<<<<<<<<<<<<<
 *         raise ValueError("bad bigint sign data")
 * 
 */
  __pyx_t_2 = (__pyx_v_sign != 0);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":1166
 *         result = '-'
 *     elif sign != NUMERIC_POS:
 *         raise ValueError("bad bigint sign data")             # <<<<<<<<<<<<<<
 * 
 *     if dscale != 0:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1166, __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(7, 1166, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":1165
 *     if sign == NUMERIC_NEG:
 *         result = '-'
 *     elif sign != NUMERIC_POS:             # <<<<<<<<<<<<<<
 *         raise ValueError("bad bigint sign data")
 * 
 */
  }
  __pyx_L3:;

  /* "gel/protocol/codecs/codecs.pyx":1168
 *         raise ValueError("bad bigint sign data")
 * 
 *     if dscale != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("bigint data has fractional part")
 * 
 */
  __pyx_t_2 = (__pyx_v_dscale != 0);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/codecs/codecs.pyx":1169
 * 
 *     if dscale != 0:
 *         raise ValueError("bigint data has fractional part")             # <<<<<<<<<<<<<<
 * 
 *     if ndigits == 0:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1169, __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(7, 1169, __pyx_L1_error)

    /* "gel/protocol/codecs/codecs.pyx":1168
 *         raise ValueError("bad bigint sign data")
 * 
 *     if dscale != 0:             # <<<<<<<<<<<<<<
 *         raise ValueError("bigint data has fractional part")
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1171
 *         raise ValueError("bigint data has fractional part")
 * 
 *     if ndigits == 0:             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_2 = (__pyx_v_ndigits == 0);
  if (__pyx_t_2) {

    /* "gel/protocol/codecs/codecs.pyx":1172
 * 
 *     if ndigits == 0:
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     while i >= 0:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "gel/protocol/codecs/codecs.pyx":1171
 *         raise ValueError("bigint data has fractional part")
 * 
 *     if ndigits == 0:             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  }

  /* "gel/protocol/codecs/codecs.pyx":1174
 *         return 0
 * 
 *     while i >= 0:             # <<<<<<<<<<<<<<
 *         if i <= weight and d < ndigits:
 *             num = str(<uint16_t>hton.unpack_int16(frb_read(buf, 2)))
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_i >= 0);
    if (!__pyx_t_2) break;

    /* "gel/protocol/codecs/codecs.pyx":1175
 * 
 *     while i >= 0:
 *         if i <= weight and d < ndigits:             # <<<<<<<<<<<<<<
 *             num = str(<uint16_t>hton.unpack_int16(frb_read(buf, 2)))
 *             result += num.zfill(4)
 */
    __pyx_t_4 = (__pyx_v_i <= __pyx_v_weight);
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_4 = (__pyx_v_d < __pyx_v_ndigits);
    __pyx_t_2 = __pyx_t_4;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_2) {

      /* "gel/protocol/codecs/codecs.pyx":1176
 *     while i >= 0:
 *         if i <= weight and d < ndigits:
 *             num = str(<uint16_t>hton.unpack_int16(frb_read(buf, 2)))             # <<<<<<<<<<<<<<
 *             result += num.zfill(4)
 *             d += 1
 */
      __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_buf, 2); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(7, 1176, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyInt_From_uint16_t(((uint16_t)unpack_int16(__pyx_t_1))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_PyObject_Unicode(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_num, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "gel/protocol/codecs/codecs.pyx":1177
 *         if i <= weight and d < ndigits:
 *             num = str(<uint16_t>hton.unpack_int16(frb_read(buf, 2)))
 *             result += num.zfill(4)             # <<<<<<<<<<<<<<
 *             d += 1
 *         else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_num, __pyx_n_s_zfill); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_int_4};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 1177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "gel/protocol/codecs/codecs.pyx":1178
 *             num = str(<uint16_t>hton.unpack_int16(frb_read(buf, 2)))
 *             result += num.zfill(4)
 *             d += 1             # <<<<<<<<<<<<<<
 *         else:
 *             result += '0000'
 */
      __pyx_v_d = (__pyx_v_d + 1);

      /* "gel/protocol/codecs/codecs.pyx":1175
 * 
 *     while i >= 0:
 *         if i <= weight and d < ndigits:             # <<<<<<<<<<<<<<
 *             num = str(<uint16_t>hton.unpack_int16(frb_read(buf, 2)))
 *             result += num.zfill(4)
 */
      goto __pyx_L8;
    }

    /* "gel/protocol/codecs/codecs.pyx":1180
 *             d += 1
 *         else:
 *             result += '0000'             # <<<<<<<<<<<<<<
 *         i -= 1
 * 
 */
    /*else*/ {
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_u_0000); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
      __pyx_t_3 = 0;
    }
    __pyx_L8:;

    /* "gel/protocol/codecs/codecs.pyx":1181
 *         else:
 *             result += '0000'
 *         i -= 1             # <<<<<<<<<<<<<<
 * 
 *     return int(result)
 */
    __pyx_v_i = (__pyx_v_i - 1);
  }

  /* "gel/protocol/codecs/codecs.pyx":1183
 *         i -= 1
 * 
 *     return int(result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_v_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":1153
 * 
 * 
 * cdef bigint_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         uint16_t ndigits = <uint16_t>hton.unpack_int16(frb_read(buf, 2))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.bigint_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_num);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1186
 * 
 * 
 * cdef geometry_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     buf.write_int32(len(obj.wkb))
 *     buf.write_bytes(obj.wkb)
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_geometry_encode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("geometry_encode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1187
 * 
 * cdef geometry_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     buf.write_int32(len(obj.wkb))             # <<<<<<<<<<<<<<
 *     buf.write_bytes(obj.wkb)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_wkb); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(7, 1187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int32(__pyx_v_buf, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1188
 * cdef geometry_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     buf.write_int32(len(obj.wkb))
 *     buf.write_bytes(obj.wkb)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_wkb); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(7, 1188, __pyx_L1_error)
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1186
 * 
 * 
 * cdef geometry_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):             # <<<<<<<<<<<<<<
 *     buf.write_int32(len(obj.wkb))
 *     buf.write_bytes(obj.wkb)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.geometry_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1191
 * 
 * 
 * cdef geometry_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object result
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_geometry_decode(CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *__pyx_v_settings, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_buf) {
  PyObject *__pyx_v_result = 0;
  Py_ssize_t __pyx_v_buf_len;
  PyObject *__pyx_v_descriptor = NULL;
  PyObject *__pyx_v_elem = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  char const *__pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("geometry_decode", 1);

  /* "gel/protocol/codecs/codecs.pyx":1197
 * 
 *     # Just wrap the bytes into a named tuple with a single field `wkb`
 *     descriptor = datatypes.record_desc_new(             # <<<<<<<<<<<<<<
 *         ('wkb',), <object>NULL, <object>NULL)
 *     result = datatypes.namedtuple_new(
 */
  __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_record_desc_new(__pyx_tuple__51, ((PyObject *)NULL), ((PyObject *)NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_descriptor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1200
 *         ('wkb',), <object>NULL, <object>NULL)
 *     result = datatypes.namedtuple_new(
 *         datatypes.namedtuple_type_new(descriptor))             # <<<<<<<<<<<<<<
 * 
 *     # frb_read_all adjusts buf.len, so we need to read it out first
 */
  __pyx_t_1 = __pyx_f_3gel_9datatypes_9datatypes_namedtuple_type_new(__pyx_v_descriptor); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "gel/protocol/codecs/codecs.pyx":1199
 *     descriptor = datatypes.record_desc_new(
 *         ('wkb',), <object>NULL, <object>NULL)
 *     result = datatypes.namedtuple_new(             # <<<<<<<<<<<<<<
 *         datatypes.namedtuple_type_new(descriptor))
 * 
 */
  __pyx_t_2 = __pyx_f_3gel_9datatypes_9datatypes_namedtuple_new(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1203
 * 
 *     # frb_read_all adjusts buf.len, so we need to read it out first
 *     buf_len = buf.len             # <<<<<<<<<<<<<<
 *     elem = PyBytes_FromStringAndSize(frb_read_all(buf), buf_len)
 *     cpython.Py_INCREF(elem)
 */
  __pyx_t_3 = __pyx_v_buf->len;
  __pyx_v_buf_len = __pyx_t_3;

  /* "gel/protocol/codecs/codecs.pyx":1204
 *     # frb_read_all adjusts buf.len, so we need to read it out first
 *     buf_len = buf.len
 *     elem = PyBytes_FromStringAndSize(frb_read_all(buf), buf_len)             # <<<<<<<<<<<<<<
 *     cpython.Py_INCREF(elem)
 *     cpython.PyTuple_SET_ITEM(result, 0, elem)
 */
  __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_frb_read_all(__pyx_v_buf); if (unlikely(__pyx_t_4 == ((char const *)NULL) && PyErr_Occurred())) __PYX_ERR(7, 1204, __pyx_L1_error)
  __pyx_t_2 = PyBytes_FromStringAndSize(__pyx_t_4, __pyx_v_buf_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_elem = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1205
 *     buf_len = buf.len
 *     elem = PyBytes_FromStringAndSize(frb_read_all(buf), buf_len)
 *     cpython.Py_INCREF(elem)             # <<<<<<<<<<<<<<
 *     cpython.PyTuple_SET_ITEM(result, 0, elem)
 * 
 */
  Py_INCREF(__pyx_v_elem);

  /* "gel/protocol/codecs/codecs.pyx":1206
 *     elem = PyBytes_FromStringAndSize(frb_read_all(buf), buf_len)
 *     cpython.Py_INCREF(elem)
 *     cpython.PyTuple_SET_ITEM(result, 0, elem)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  PyTuple_SET_ITEM(__pyx_v_result, 0, __pyx_v_elem);

  /* "gel/protocol/codecs/codecs.pyx":1208
 *     cpython.PyTuple_SET_ITEM(result, 0, elem)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "gel/protocol/codecs/codecs.pyx":1191
 * 
 * 
 * cdef geometry_decode(pgproto.CodecContext settings, FRBuffer *buf):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.geometry_decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_descriptor);
  __Pyx_XDECREF(__pyx_v_elem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/codecs/codecs.pyx":1211
 * 
 * 
 * cdef register_base_scalar_codecs():             # <<<<<<<<<<<<<<
 *     register_base_scalar_codec(
 *         'std::uuid',
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_register_base_scalar_codecs(void) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  struct __pyx_opt_args_3gel_8protocol_8protocol_register_base_scalar_codec __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("register_base_scalar_codecs", 1);

  /* "gel/protocol/codecs/codecs.pyx":1212
 * 
 * cdef register_base_scalar_codecs():
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::uuid',
 *         pgproto.uuid_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_uuid, __pyx_f_3gel_7pgproto_7pgproto_uuid_encode, __pyx_f_3gel_7pgproto_7pgproto_uuid_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1217
 *         pgproto.uuid_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::str',
 *         pgproto.text_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_str, __pyx_f_3gel_7pgproto_7pgproto_text_encode, __pyx_f_3gel_7pgproto_7pgproto_text_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1222
 *         pgproto.text_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::bytes',
 *         pgproto.bytea_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_bytes, __pyx_f_3gel_7pgproto_7pgproto_bytea_encode, __pyx_f_3gel_7pgproto_7pgproto_bytea_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1227
 *         pgproto.bytea_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::int16',
 *         checked_int2_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_int16, __pyx_f_3gel_8protocol_8protocol_checked_int2_encode, __pyx_f_3gel_7pgproto_7pgproto_int2_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1232
 *         pgproto.int2_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::int32',
 *         checked_int4_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_int32, __pyx_f_3gel_8protocol_8protocol_checked_int4_encode, __pyx_f_3gel_7pgproto_7pgproto_int4_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1237
 *         pgproto.int4_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::int64',
 *         checked_int8_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_int64, __pyx_f_3gel_8protocol_8protocol_checked_int8_encode, __pyx_f_3gel_7pgproto_7pgproto_int8_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1242
 *         pgproto.int8_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::float32',
 *         pgproto.float4_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_float32, __pyx_f_3gel_7pgproto_7pgproto_float4_encode, __pyx_f_3gel_7pgproto_7pgproto_float4_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1247
 *         pgproto.float4_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::float64',
 *         pgproto.float8_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_float64, __pyx_f_3gel_7pgproto_7pgproto_float8_encode, __pyx_f_3gel_7pgproto_7pgproto_float8_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1252
 *         pgproto.float8_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::decimal',
 *         checked_decimal_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_decimal, __pyx_f_3gel_8protocol_8protocol_checked_decimal_encode, __pyx_f_3gel_8protocol_8protocol_decimal_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1257
 *         decimal_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::bigint',
 *         bigint_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_bigint, __pyx_f_3gel_8protocol_8protocol_bigint_encode, __pyx_f_3gel_8protocol_8protocol_bigint_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1262
 *         bigint_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::bool',
 *         pgproto.bool_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_bool, __pyx_f_3gel_7pgproto_7pgproto_bool_encode, __pyx_f_3gel_7pgproto_7pgproto_bool_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1267
 *         pgproto.bool_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::datetime',
 *         timestamptz_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_datetime, __pyx_f_3gel_8protocol_8protocol_timestamptz_encode, __pyx_f_3gel_7pgproto_7pgproto_timestamptz_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1272
 *         pgproto.timestamptz_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::pg::timestamptz',
 *         timestamptz_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_pg_timestamptz, __pyx_f_3gel_8protocol_8protocol_timestamptz_encode, __pyx_f_3gel_7pgproto_7pgproto_timestamptz_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1277
 *         pgproto.timestamptz_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'cal::local_datetime',
 *         timestamp_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_cal_local_datetime, __pyx_f_3gel_8protocol_8protocol_timestamp_encode, __pyx_f_3gel_7pgproto_7pgproto_timestamp_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1282
 *         pgproto.timestamp_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::pg::timestamp',
 *         timestamp_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_pg_timestamp, __pyx_f_3gel_8protocol_8protocol_timestamp_encode, __pyx_f_3gel_7pgproto_7pgproto_timestamp_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1287
 *         pgproto.timestamp_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'cal::local_date',
 *         date_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_cal_local_date, __pyx_f_3gel_8protocol_8protocol_date_encode, __pyx_f_3gel_7pgproto_7pgproto_date_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1292
 *         pgproto.date_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::pg::date',
 *         date_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_pg_date, __pyx_f_3gel_8protocol_8protocol_date_encode, __pyx_f_3gel_7pgproto_7pgproto_date_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1297
 *         pgproto.date_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'cal::local_time',
 *         time_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_cal_local_time, __pyx_f_3gel_8protocol_8protocol_time_encode, __pyx_f_3gel_7pgproto_7pgproto_time_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1302
 *         pgproto.time_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::duration',
 *         duration_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_duration, __pyx_f_3gel_8protocol_8protocol_duration_encode, __pyx_f_3gel_8protocol_8protocol_duration_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1307
 *         duration_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::json',
 *         pgproto.jsonb_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_json, __pyx_f_3gel_7pgproto_7pgproto_jsonb_encode, __pyx_f_3gel_7pgproto_7pgproto_jsonb_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1312
 *         pgproto.jsonb_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::pg::json',
 *         pgproto.json_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_pg_json, __pyx_f_3gel_7pgproto_7pgproto_json_encode, __pyx_f_3gel_7pgproto_7pgproto_json_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1317
 *         pgproto.json_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'cal::relative_duration',
 *         relative_duration_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_cal_relative_duration, __pyx_f_3gel_8protocol_8protocol_relative_duration_encode, __pyx_f_3gel_8protocol_8protocol_relative_duration_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1322
 *         relative_duration_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'std::pg::interval',
 *         relative_duration_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_std_pg_interval, __pyx_f_3gel_8protocol_8protocol_relative_duration_encode, __pyx_f_3gel_8protocol_8protocol_relative_duration_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1327
 *         relative_duration_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'cal::date_duration',
 *         date_duration_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_cal_date_duration, __pyx_f_3gel_8protocol_8protocol_date_duration_encode, __pyx_f_3gel_8protocol_8protocol_date_duration_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1332
 *         date_duration_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'cfg::memory',
 *         config_memory_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_cfg_memory, __pyx_f_3gel_8protocol_8protocol_config_memory_encode, __pyx_f_3gel_8protocol_8protocol_config_memory_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1337
 *         config_memory_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'fts::language',
 *         pgproto.text_encode,
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_fts_language, __pyx_f_3gel_7pgproto_7pgproto_text_encode, __pyx_f_3gel_7pgproto_7pgproto_text_decode, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1346
 *         pgvector_encode,
 *         pgvector_decode,
 *         uuid.UUID('9565dd88-04f5-11ee-a691-0b6ebe179825'),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UUID); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_9565dd88_04f5_11ee_a691_0b6ebe17};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1346, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1342
 *         pgproto.text_decode)
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'ext::pgvector::vector',
 *         pgvector_encode,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.tid = __pyx_t_1;
  __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_ext_pgvector_vector, __pyx_f_3gel_8protocol_8protocol_pgvector_encode, __pyx_f_3gel_8protocol_8protocol_pgvector_decode, &__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1353
 *         pgvector_hv_encode,
 *         pgvector_hv_decode,
 *         uuid.UUID('4ba84534-188e-43b4-a7ce-cea2af0f405b'),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_uuid); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_4ba84534_188e_43b4_a7ce_cea2af0f};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1349
 *     )
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'ext::pgvector::halfvec',
 *         pgvector_hv_encode,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.tid = __pyx_t_3;
  __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_ext_pgvector_halfvec, __pyx_f_3gel_8protocol_8protocol_pgvector_hv_encode, __pyx_f_3gel_8protocol_8protocol_pgvector_hv_decode, &__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1360
 *         pgvector_sv_encode,
 *         pgvector_sv_decode,
 *         uuid.UUID('003e434d-cac2-430a-b238-fb39d73447d2'),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_003e434d_cac2_430a_b238_fb39d734};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1356
 *     )
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'ext::pgvector::sparsevec',
 *         pgvector_sv_encode,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.tid = __pyx_t_2;
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_ext_pgvector_sparsevec, __pyx_f_3gel_8protocol_8protocol_pgvector_sv_encode, __pyx_f_3gel_8protocol_8protocol_pgvector_sv_decode, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1367
 *         geometry_encode,
 *         geometry_decode,
 *         uuid.UUID('44c901c0-d922-4894-83c8-061bd05e4840'),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UUID); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_44c901c0_d922_4894_83c8_061bd05e};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1363
 *     )
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'ext::postgis::geometry',
 *         geometry_encode,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.tid = __pyx_t_1;
  __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_ext_postgis_geometry, __pyx_f_3gel_8protocol_8protocol_geometry_encode, __pyx_f_3gel_8protocol_8protocol_geometry_decode, &__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1374
 *         geometry_encode,
 *         geometry_decode,
 *         uuid.UUID('4d738878-3a5f-4821-ab76-9d8e7d6b32c4'),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_uuid); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UUID); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_4d738878_3a5f_4821_ab76_9d8e7d6b};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1370
 *     )
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'ext::postgis::geography',
 *         geometry_encode,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.tid = __pyx_t_3;
  __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_ext_postgis_geography, __pyx_f_3gel_8protocol_8protocol_geometry_encode, __pyx_f_3gel_8protocol_8protocol_geometry_decode, &__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1381
 *         geometry_encode,
 *         geometry_decode,
 *         uuid.UUID('7fae5536-6311-4f60-8eb9-096a5d972f48'),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_7fae5536_6311_4f60_8eb9_096a5d97};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1377
 *     )
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'ext::postgis::box2d',
 *         geometry_encode,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.tid = __pyx_t_2;
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_ext_postgis_box2d, __pyx_f_3gel_8protocol_8protocol_geometry_encode, __pyx_f_3gel_8protocol_8protocol_geometry_decode, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1388
 *         geometry_encode,
 *         geometry_decode,
 *         uuid.UUID('c1a50ff8-fded-48b0-85c2-4905a8481433'),             # <<<<<<<<<<<<<<
 *     )
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_uuid); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_UUID); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_c1a50ff8_fded_48b0_85c2_4905a848};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "gel/protocol/codecs/codecs.pyx":1384
 *     )
 * 
 *     register_base_scalar_codec(             # <<<<<<<<<<<<<<
 *         'ext::postgis::box3d',
 *         geometry_encode,
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.tid = __pyx_t_1;
  __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codec(__pyx_kp_u_ext_postgis_box3d, __pyx_f_3gel_8protocol_8protocol_geometry_encode, __pyx_f_3gel_8protocol_8protocol_geometry_decode, &__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1211
 * 
 * 
 * cdef register_base_scalar_codecs():             # <<<<<<<<<<<<<<
 *     register_base_scalar_codec(
 *         'std::uuid',
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.register_base_scalar_codecs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":95
 * 
 * cdef class ExecuteContext:
 *     def __init__(             # <<<<<<<<<<<<<<
 *         self,
 *         *,
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_qc = 0;
  enum __pyx_t_3gel_8protocol_8protocol_InputLanguage __pyx_v_input_language;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format;
  PyObject *__pyx_v_expect_one = 0;
  PyObject *__pyx_v_required_one = 0;
  PyObject *__pyx_v_implicit_limit = 0;
  PyObject *__pyx_v_inline_typenames = 0;
  PyObject *__pyx_v_inline_typeids = 0;
  PyObject *__pyx_v_allow_capabilities = 0;
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v_annotations = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_reg,&__pyx_n_s_qc,&__pyx_n_s_input_language,&__pyx_n_s_output_format,&__pyx_n_s_expect_one,&__pyx_n_s_required_one,&__pyx_n_s_implicit_limit,&__pyx_n_s_inline_typenames,&__pyx_n_s_inline_typeids,&__pyx_n_s_allow_capabilities,&__pyx_n_s_state,&__pyx_n_s_annotations,0};

    /* "gel/protocol/protocol.pyx":105
 *         input_language: InputLanguage,
 *         output_format: OutputFormat,
 *         expect_one: bool = False,             # <<<<<<<<<<<<<<
 *         required_one: bool = False,
 *         implicit_limit: int = 0,
 */
    values[7] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False));

    /* "gel/protocol/protocol.pyx":106
 *         output_format: OutputFormat,
 *         expect_one: bool = False,
 *         required_one: bool = False,             # <<<<<<<<<<<<<<
 *         implicit_limit: int = 0,
 *         inline_typenames: bool = False,
 */
    values[8] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False));
    values[9] = __Pyx_Arg_NewRef_VARARGS(__pyx_k__52);

    /* "gel/protocol/protocol.pyx":108
 *         required_one: bool = False,
 *         implicit_limit: int = 0,
 *         inline_typenames: bool = False,             # <<<<<<<<<<<<<<
 *         inline_typeids: bool = False,
 *         allow_capabilities: enums.Capability = enums.Capability.ALL,
 */
    values[10] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False));

    /* "gel/protocol/protocol.pyx":109
 *         implicit_limit: int = 0,
 *         inline_typenames: bool = False,
 *         inline_typeids: bool = False,             # <<<<<<<<<<<<<<
 *         allow_capabilities: enums.Capability = enums.Capability.ALL,
 *         state: typing.Optional[dict] = None,
 */
    values[11] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)Py_False));
    values[12] = __Pyx_Arg_NewRef_VARARGS(__pyx_k__53);

    /* "gel/protocol/protocol.pyx":111
 *         inline_typeids: bool = False,
 *         allow_capabilities: enums.Capability = enums.Capability.ALL,
 *         state: typing.Optional[dict] = None,             # <<<<<<<<<<<<<<
 *         annotations: typing.Optional[dict[str, str]] = None,
 *     ):
 */
    values[13] = __Pyx_Arg_NewRef_VARARGS(((PyObject*)Py_None));

    /* "gel/protocol/protocol.pyx":112
 *         allow_capabilities: enums.Capability = enums.Capability.ALL,
 *         state: typing.Optional[dict] = None,
 *         annotations: typing.Optional[dict[str, str]] = None,             # <<<<<<<<<<<<<<
 *     ):
 *         self.query = query
 */
    values[14] = __Pyx_Arg_NewRef_VARARGS(((PyObject*)Py_None));
    if (likely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) {
        (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
        kw_args--;
      }
      else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 95, __pyx_L3_error)
      else {
        __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_query); __PYX_ERR(8, 95, __pyx_L3_error)
      }
      if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) {
        (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
        kw_args--;
      }
      else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 95, __pyx_L3_error)
      else {
        __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_args); __PYX_ERR(8, 95, __pyx_L3_error)
      }
      if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kwargs)) != 0)) {
        (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
        kw_args--;
      }
      else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 95, __pyx_L3_error)
      else {
        __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_kwargs); __PYX_ERR(8, 95, __pyx_L3_error)
      }
      if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reg)) != 0)) {
        (void)__Pyx_Arg_NewRef_VARARGS(values[3]);
        kw_args--;
      }
      else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 95, __pyx_L3_error)
      else {
        __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_reg); __PYX_ERR(8, 95, __pyx_L3_error)
      }
      if (likely((values[4] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_qc)) != 0)) {
        (void)__Pyx_Arg_NewRef_VARARGS(values[4]);
        kw_args--;
      }
      else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 95, __pyx_L3_error)
      else {
        __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_qc); __PYX_ERR(8, 95, __pyx_L3_error)
      }
      if (likely((values[5] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_input_language)) != 0)) {
        (void)__Pyx_Arg_NewRef_VARARGS(values[5]);
        kw_args--;
      }
      else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 95, __pyx_L3_error)
      else {
        __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_input_language); __PYX_ERR(8, 95, __pyx_L3_error)
      }
      if (likely((values[6] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_output_format)) != 0)) {
        (void)__Pyx_Arg_NewRef_VARARGS(values[6]);
        kw_args--;
      }
      else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 95, __pyx_L3_error)
      else {
        __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_output_format); __PYX_ERR(8, 95, __pyx_L3_error)
      }
      if (kw_args > 0 && likely(kw_args <= 8)) {
        Py_ssize_t index;
        for (index = 7; index < 15 && kw_args > 0; index++) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]);
          if (value) { values[index] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 95, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "__init__") < 0)) __PYX_ERR(8, 95, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 0)) {
      goto __pyx_L5_argtuple_error;
    } else {
      __Pyx_RaiseKeywordRequired("__init__", __pyx_n_s_query); __PYX_ERR(8, 95, __pyx_L3_error)
    }
    __pyx_v_query = ((PyObject*)values[0]);
    __pyx_v_args = values[1];
    __pyx_v_kwargs = values[2];
    __pyx_v_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)values[3]);
    __pyx_v_qc = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)values[4]);
    __pyx_v_input_language = ((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)__Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(values[5])); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 103, __pyx_L3_error)
    __pyx_v_output_format = ((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)__Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(values[6])); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 104, __pyx_L3_error)
    __pyx_v_expect_one = values[7];
    __pyx_v_required_one = values[8];
    __pyx_v_implicit_limit = ((PyObject*)values[9]);
    __pyx_v_inline_typenames = values[10];
    __pyx_v_inline_typeids = values[11];
    __pyx_v_allow_capabilities = values[12];
    __pyx_v_state = ((PyObject*)values[13]);
    __pyx_v_annotations = ((PyObject*)values[14]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); __PYX_ERR(8, 95, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 0, "query", 1))) __PYX_ERR(8, 98, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reg), __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry, 0, "reg", 0))) __PYX_ERR(8, 101, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_qc), __pyx_ptype_3gel_8protocol_8protocol_LRUMapping, 0, "qc", 0))) __PYX_ERR(8, 102, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_implicit_limit), (&PyInt_Type), 0, "implicit_limit", 1))) __PYX_ERR(8, 107, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), (&PyDict_Type), 1, "state", 1))) __PYX_ERR(8, 111, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_annotations), (&PyDict_Type), 1, "annotations", 1))) __PYX_ERR(8, 112, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext___init__(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v_self), __pyx_v_query, __pyx_v_args, __pyx_v_kwargs, __pyx_v_reg, __pyx_v_qc, __pyx_v_input_language, __pyx_v_output_format, __pyx_v_expect_one, __pyx_v_required_one, __pyx_v_implicit_limit, __pyx_v_inline_typenames, __pyx_v_inline_typeids, __pyx_v_allow_capabilities, __pyx_v_state, __pyx_v_annotations);

  /* "gel/protocol/protocol.pyx":95
 * 
 * cdef class ExecuteContext:
 *     def __init__(             # <<<<<<<<<<<<<<
 *         self,
 *         *,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext___init__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg, struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v_qc, enum __pyx_t_3gel_8protocol_8protocol_InputLanguage __pyx_v_input_language, enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format, PyObject *__pyx_v_expect_one, PyObject *__pyx_v_required_one, PyObject *__pyx_v_implicit_limit, PyObject *__pyx_v_inline_typenames, PyObject *__pyx_v_inline_typeids, PyObject *__pyx_v_allow_capabilities, PyObject *__pyx_v_state, PyObject *__pyx_v_annotations) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  uint64_t __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "gel/protocol/protocol.pyx":114
 *         annotations: typing.Optional[dict[str, str]] = None,
 *     ):
 *         self.query = query             # <<<<<<<<<<<<<<
 *         self.args = args
 *         self.kwargs = kwargs
 */
  __Pyx_INCREF(__pyx_v_query);
  __Pyx_GIVEREF(__pyx_v_query);
  __Pyx_GOTREF(__pyx_v_self->query);
  __Pyx_DECREF(__pyx_v_self->query);
  __pyx_v_self->query = __pyx_v_query;

  /* "gel/protocol/protocol.pyx":115
 *     ):
 *         self.query = query
 *         self.args = args             # <<<<<<<<<<<<<<
 *         self.kwargs = kwargs
 *         self.reg = reg
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

  /* "gel/protocol/protocol.pyx":116
 *         self.query = query
 *         self.args = args
 *         self.kwargs = kwargs             # <<<<<<<<<<<<<<
 *         self.reg = reg
 *         self.qc = qc
 */
  __Pyx_INCREF(__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_v_kwargs);
  __Pyx_GOTREF(__pyx_v_self->kwargs);
  __Pyx_DECREF(__pyx_v_self->kwargs);
  __pyx_v_self->kwargs = __pyx_v_kwargs;

  /* "gel/protocol/protocol.pyx":117
 *         self.args = args
 *         self.kwargs = kwargs
 *         self.reg = reg             # <<<<<<<<<<<<<<
 *         self.qc = qc
 *         self.input_language = input_language
 */
  __Pyx_INCREF((PyObject *)__pyx_v_reg);
  __Pyx_GIVEREF((PyObject *)__pyx_v_reg);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->reg);
  __Pyx_DECREF((PyObject *)__pyx_v_self->reg);
  __pyx_v_self->reg = __pyx_v_reg;

  /* "gel/protocol/protocol.pyx":118
 *         self.kwargs = kwargs
 *         self.reg = reg
 *         self.qc = qc             # <<<<<<<<<<<<<<
 *         self.input_language = input_language
 *         self.output_format = output_format
 */
  __Pyx_INCREF((PyObject *)__pyx_v_qc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_qc);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->qc);
  __Pyx_DECREF((PyObject *)__pyx_v_self->qc);
  __pyx_v_self->qc = __pyx_v_qc;

  /* "gel/protocol/protocol.pyx":119
 *         self.reg = reg
 *         self.qc = qc
 *         self.input_language = input_language             # <<<<<<<<<<<<<<
 *         self.output_format = output_format
 *         self.expect_one = bool(expect_one)
 */
  __pyx_v_self->input_language = __pyx_v_input_language;

  /* "gel/protocol/protocol.pyx":120
 *         self.qc = qc
 *         self.input_language = input_language
 *         self.output_format = output_format             # <<<<<<<<<<<<<<
 *         self.expect_one = bool(expect_one)
 *         self.required_one = bool(required_one)
 */
  __pyx_v_self->output_format = __pyx_v_output_format;

  /* "gel/protocol/protocol.pyx":121
 *         self.input_language = input_language
 *         self.output_format = output_format
 *         self.expect_one = bool(expect_one)             # <<<<<<<<<<<<<<
 *         self.required_one = bool(required_one)
 *         self.implicit_limit = implicit_limit
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_expect_one); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 121, __pyx_L1_error)
  __pyx_v_self->expect_one = (!(!__pyx_t_1));

  /* "gel/protocol/protocol.pyx":122
 *         self.output_format = output_format
 *         self.expect_one = bool(expect_one)
 *         self.required_one = bool(required_one)             # <<<<<<<<<<<<<<
 *         self.implicit_limit = implicit_limit
 *         self.inline_typenames = bool(inline_typenames)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_required_one); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 122, __pyx_L1_error)
  __pyx_v_self->required_one = (!(!__pyx_t_1));

  /* "gel/protocol/protocol.pyx":123
 *         self.expect_one = bool(expect_one)
 *         self.required_one = bool(required_one)
 *         self.implicit_limit = implicit_limit             # <<<<<<<<<<<<<<
 *         self.inline_typenames = bool(inline_typenames)
 *         self.inline_typeids = bool(inline_typeids)
 */
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_implicit_limit); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 123, __pyx_L1_error)
  __pyx_v_self->implicit_limit = __pyx_t_2;

  /* "gel/protocol/protocol.pyx":124
 *         self.required_one = bool(required_one)
 *         self.implicit_limit = implicit_limit
 *         self.inline_typenames = bool(inline_typenames)             # <<<<<<<<<<<<<<
 *         self.inline_typeids = bool(inline_typeids)
 *         self.allow_capabilities = allow_capabilities
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_inline_typenames); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 124, __pyx_L1_error)
  __pyx_v_self->inline_typenames = (!(!__pyx_t_1));

  /* "gel/protocol/protocol.pyx":125
 *         self.implicit_limit = implicit_limit
 *         self.inline_typenames = bool(inline_typenames)
 *         self.inline_typeids = bool(inline_typeids)             # <<<<<<<<<<<<<<
 *         self.allow_capabilities = allow_capabilities
 *         self.state = state
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_inline_typeids); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 125, __pyx_L1_error)
  __pyx_v_self->inline_typeids = (!(!__pyx_t_1));

  /* "gel/protocol/protocol.pyx":126
 *         self.inline_typenames = bool(inline_typenames)
 *         self.inline_typeids = bool(inline_typeids)
 *         self.allow_capabilities = allow_capabilities             # <<<<<<<<<<<<<<
 *         self.state = state
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_As_uint64_t(__pyx_v_allow_capabilities); if (unlikely((__pyx_t_3 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 126, __pyx_L1_error)
  __pyx_v_self->allow_capabilities = __pyx_t_3;

  /* "gel/protocol/protocol.pyx":127
 *         self.inline_typeids = bool(inline_typeids)
 *         self.allow_capabilities = allow_capabilities
 *         self.state = state             # <<<<<<<<<<<<<<
 * 
 *         self.cardinality = None
 */
  __Pyx_INCREF(__pyx_v_state);
  __Pyx_GIVEREF(__pyx_v_state);
  __Pyx_GOTREF(__pyx_v_self->state);
  __Pyx_DECREF(__pyx_v_self->state);
  __pyx_v_self->state = __pyx_v_state;

  /* "gel/protocol/protocol.pyx":129
 *         self.state = state
 * 
 *         self.cardinality = None             # <<<<<<<<<<<<<<
 *         self.in_dc = self.out_dc = None
 *         self.capabilities = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cardinality);
  __Pyx_DECREF(__pyx_v_self->cardinality);
  __pyx_v_self->cardinality = ((PyObject*)Py_None);

  /* "gel/protocol/protocol.pyx":130
 * 
 *         self.cardinality = None
 *         self.in_dc = self.out_dc = None             # <<<<<<<<<<<<<<
 *         self.capabilities = 0
 *         self.warnings = ()
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->in_dc);
  __Pyx_DECREF((PyObject *)__pyx_v_self->in_dc);
  __pyx_v_self->in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->out_dc);
  __Pyx_DECREF((PyObject *)__pyx_v_self->out_dc);
  __pyx_v_self->out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);

  /* "gel/protocol/protocol.pyx":131
 *         self.cardinality = None
 *         self.in_dc = self.out_dc = None
 *         self.capabilities = 0             # <<<<<<<<<<<<<<
 *         self.warnings = ()
 *         self.annotations = annotations
 */
  __pyx_v_self->capabilities = 0;

  /* "gel/protocol/protocol.pyx":132
 *         self.in_dc = self.out_dc = None
 *         self.capabilities = 0
 *         self.warnings = ()             # <<<<<<<<<<<<<<
 *         self.annotations = annotations
 * 
 */
  __Pyx_INCREF(__pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  __Pyx_GOTREF(__pyx_v_self->warnings);
  __Pyx_DECREF(__pyx_v_self->warnings);
  __pyx_v_self->warnings = __pyx_empty_tuple;

  /* "gel/protocol/protocol.pyx":133
 *         self.capabilities = 0
 *         self.warnings = ()
 *         self.annotations = annotations             # <<<<<<<<<<<<<<
 * 
 *     cdef inline bint has_na_cardinality(self):
 */
  __Pyx_INCREF(__pyx_v_annotations);
  __Pyx_GIVEREF(__pyx_v_annotations);
  __Pyx_GOTREF(__pyx_v_self->annotations);
  __Pyx_DECREF(__pyx_v_self->annotations);
  __pyx_v_self->annotations = __pyx_v_annotations;

  /* "gel/protocol/protocol.pyx":95
 * 
 * cdef class ExecuteContext:
 *     def __init__(             # <<<<<<<<<<<<<<
 *         self,
 *         *,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":135
 *         self.annotations = annotations
 * 
 *     cdef inline bint has_na_cardinality(self):             # <<<<<<<<<<<<<<
 *         return self.cardinality == CARDINALITY_NOT_APPLICABLE
 * 
 */

static CYTHON_INLINE int __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_has_na_cardinality(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "gel/protocol/protocol.pyx":136
 * 
 *     cdef inline bint has_na_cardinality(self):
 *         return self.cardinality == CARDINALITY_NOT_APPLICABLE             # <<<<<<<<<<<<<<
 * 
 *     cdef bint load_from_cache(self):
 */
  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_v_self->cardinality, __pyx_n_b_n, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 136, __pyx_L1_error)
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":135
 *         self.annotations = annotations
 * 
 *     cdef inline bint has_na_cardinality(self):             # <<<<<<<<<<<<<<
 *         return self.cardinality == CARDINALITY_NOT_APPLICABLE
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.has_na_cardinality", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":138
 *         return self.cardinality == CARDINALITY_NOT_APPLICABLE
 * 
 *     cdef bint load_from_cache(self):             # <<<<<<<<<<<<<<
 *         key = (
 *             self.query,
 */

static int __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_load_from_cache(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_rv = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  uint64_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("load_from_cache", 1);

  /* "gel/protocol/protocol.pyx":141
 *         key = (
 *             self.query,
 *             self.output_format,             # <<<<<<<<<<<<<<
 *             self.implicit_limit,
 *             self.inline_typenames,
 */
  __pyx_t_1 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_v_self->output_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "gel/protocol/protocol.pyx":142
 *             self.query,
 *             self.output_format,
 *             self.implicit_limit,             # <<<<<<<<<<<<<<
 *             self.inline_typenames,
 *             self.inline_typeids,
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->implicit_limit); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "gel/protocol/protocol.pyx":143
 *             self.output_format,
 *             self.implicit_limit,
 *             self.inline_typenames,             # <<<<<<<<<<<<<<
 *             self.inline_typeids,
 *             self.expect_one,
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->inline_typenames); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "gel/protocol/protocol.pyx":144
 *             self.implicit_limit,
 *             self.inline_typenames,
 *             self.inline_typeids,             # <<<<<<<<<<<<<<
 *             self.expect_one,
 *         )
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->inline_typeids); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "gel/protocol/protocol.pyx":145
 *             self.inline_typenames,
 *             self.inline_typeids,
 *             self.expect_one,             # <<<<<<<<<<<<<<
 *         )
 *         rv = self.qc.get(key, None)
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->expect_one); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "gel/protocol/protocol.pyx":140
 *     cdef bint load_from_cache(self):
 *         key = (
 *             self.query,             # <<<<<<<<<<<<<<
 *             self.output_format,
 *             self.implicit_limit,
 */
  __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->query);
  __Pyx_GIVEREF(__pyx_v_self->query);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->query)) __PYX_ERR(8, 140, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(8, 140, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2)) __PYX_ERR(8, 140, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_3)) __PYX_ERR(8, 140, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_4)) __PYX_ERR(8, 140, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_5)) __PYX_ERR(8, 140, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_v_key = ((PyObject*)__pyx_t_6);
  __pyx_t_6 = 0;

  /* "gel/protocol/protocol.pyx":147
 *             self.expect_one,
 *         )
 *         rv = self.qc.get(key, None)             # <<<<<<<<<<<<<<
 *         if rv is None:
 *             return False
 */
  __pyx_t_6 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_LRUMapping *)__pyx_v_self->qc->__pyx_vtab)->get(__pyx_v_self->qc, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_v_rv = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "gel/protocol/protocol.pyx":148
 *         )
 *         rv = self.qc.get(key, None)
 *         if rv is None:             # <<<<<<<<<<<<<<
 *             return False
 *         else:
 */
  __pyx_t_7 = (__pyx_v_rv == Py_None);
  if (__pyx_t_7) {

    /* "gel/protocol/protocol.pyx":149
 *         rv = self.qc.get(key, None)
 *         if rv is None:
 *             return False             # <<<<<<<<<<<<<<
 *         else:
 *             self.cardinality, self.in_dc, self.out_dc, self.capabilities = rv
 */
    __pyx_r = 0;
    goto __pyx_L0;

    /* "gel/protocol/protocol.pyx":148
 *         )
 *         rv = self.qc.get(key, None)
 *         if rv is None:             # <<<<<<<<<<<<<<
 *             return False
 *         else:
 */
  }

  /* "gel/protocol/protocol.pyx":151
 *             return False
 *         else:
 *             self.cardinality, self.in_dc, self.out_dc, self.capabilities = rv             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  /*else*/ {
    if ((likely(PyTuple_CheckExact(__pyx_v_rv))) || (PyList_CheckExact(__pyx_v_rv))) {
      PyObject* sequence = __pyx_v_rv;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 4)) {
        if (size > 4) __Pyx_RaiseTooManyValuesError(4);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(8, 151, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 3); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 3); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_5,&__pyx_t_4,&__pyx_t_3};
        for (i=0; i < 4; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(8, 151, __pyx_L1_error)
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_5,&__pyx_t_4,&__pyx_t_3};
      __pyx_t_2 = PyObject_GetIter(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
      for (index=0; index < 4; index++) {
        PyObject* item = __pyx_t_8(__pyx_t_2); if (unlikely(!item)) goto __pyx_L4_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_2), 4) < 0) __PYX_ERR(8, 151, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(8, 151, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_6))) __PYX_ERR(8, 151, __pyx_L1_error)
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(8, 151, __pyx_L1_error)
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(8, 151, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyInt_As_uint64_t(__pyx_t_3); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 151, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_v_self->cardinality);
    __Pyx_DECREF(__pyx_v_self->cardinality);
    __pyx_v_self->cardinality = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->in_dc);
    __Pyx_DECREF((PyObject *)__pyx_v_self->in_dc);
    __pyx_v_self->in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_v_self->out_dc);
    __Pyx_DECREF((PyObject *)__pyx_v_self->out_dc);
    __pyx_v_self->out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_v_self->capabilities = __pyx_t_9;

    /* "gel/protocol/protocol.pyx":152
 *         else:
 *             self.cardinality, self.in_dc, self.out_dc, self.capabilities = rv
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     cdef inline store_to_cache(self):
 */
    __pyx_r = 1;
    goto __pyx_L0;
  }

  /* "gel/protocol/protocol.pyx":138
 *         return self.cardinality == CARDINALITY_NOT_APPLICABLE
 * 
 *     cdef bint load_from_cache(self):             # <<<<<<<<<<<<<<
 *         key = (
 *             self.query,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.load_from_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":154
 *             return True
 * 
 *     cdef inline store_to_cache(self):             # <<<<<<<<<<<<<<
 *         assert self.in_dc is not None
 *         assert self.out_dc is not None
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14ExecuteContext_store_to_cache(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("store_to_cache", 1);

  /* "gel/protocol/protocol.pyx":155
 * 
 *     cdef inline store_to_cache(self):
 *         assert self.in_dc is not None             # <<<<<<<<<<<<<<
 *         assert self.out_dc is not None
 *         key = (
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (((PyObject *)__pyx_v_self->in_dc) != Py_None);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(8, 155, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(8, 155, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol.pyx":156
 *     cdef inline store_to_cache(self):
 *         assert self.in_dc is not None
 *         assert self.out_dc is not None             # <<<<<<<<<<<<<<
 *         key = (
 *             self.query,
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = (((PyObject *)__pyx_v_self->out_dc) != Py_None);
    if (unlikely(!__pyx_t_1)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(8, 156, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(8, 156, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol.pyx":159
 *         key = (
 *             self.query,
 *             self.output_format,             # <<<<<<<<<<<<<<
 *             self.implicit_limit,
 *             self.inline_typenames,
 */
  __pyx_t_2 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_v_self->output_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "gel/protocol/protocol.pyx":160
 *             self.query,
 *             self.output_format,
 *             self.implicit_limit,             # <<<<<<<<<<<<<<
 *             self.inline_typenames,
 *             self.inline_typeids,
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->implicit_limit); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "gel/protocol/protocol.pyx":161
 *             self.output_format,
 *             self.implicit_limit,
 *             self.inline_typenames,             # <<<<<<<<<<<<<<
 *             self.inline_typeids,
 *             self.expect_one,
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->inline_typenames); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "gel/protocol/protocol.pyx":162
 *             self.implicit_limit,
 *             self.inline_typenames,
 *             self.inline_typeids,             # <<<<<<<<<<<<<<
 *             self.expect_one,
 *         )
 */
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->inline_typeids); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "gel/protocol/protocol.pyx":163
 *             self.inline_typenames,
 *             self.inline_typeids,
 *             self.expect_one,             # <<<<<<<<<<<<<<
 *         )
 *         self.qc[key] = (
 */
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->expect_one); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);

  /* "gel/protocol/protocol.pyx":158
 *         assert self.out_dc is not None
 *         key = (
 *             self.query,             # <<<<<<<<<<<<<<
 *             self.output_format,
 *             self.implicit_limit,
 */
  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_self->query);
  __Pyx_GIVEREF(__pyx_v_self->query);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->query)) __PYX_ERR(8, 158, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(8, 158, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3)) __PYX_ERR(8, 158, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_4)) __PYX_ERR(8, 158, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_5)) __PYX_ERR(8, 158, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_t_6)) __PYX_ERR(8, 158, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_v_key = ((PyObject*)__pyx_t_7);
  __pyx_t_7 = 0;

  /* "gel/protocol/protocol.pyx":166
 *         )
 *         self.qc[key] = (
 *             self.cardinality, self.in_dc, self.out_dc, self.capabilities             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_7 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->capabilities); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->cardinality);
  __Pyx_GIVEREF(__pyx_v_self->cardinality);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->cardinality)) __PYX_ERR(8, 166, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->in_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->in_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_self->in_dc))) __PYX_ERR(8, 166, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->out_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->out_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_self->out_dc))) __PYX_ERR(8, 166, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_7)) __PYX_ERR(8, 166, __pyx_L1_error);
  __pyx_t_7 = 0;

  /* "gel/protocol/protocol.pyx":165
 *             self.expect_one,
 *         )
 *         self.qc[key] = (             # <<<<<<<<<<<<<<
 *             self.cardinality, self.in_dc, self.out_dc, self.capabilities
 *         )
 */
  if (unlikely((PyObject_SetItem(((PyObject *)__pyx_v_self->qc), __pyx_v_key, __pyx_t_6) < 0))) __PYX_ERR(8, 165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "gel/protocol/protocol.pyx":154
 *             return True
 * 
 *     cdef inline store_to_cache(self):             # <<<<<<<<<<<<<<
 *         assert self.in_dc is not None
 *         assert self.out_dc is not None
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.store_to_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pxd":95
 * 
 *         # Contextual variables
 *         readonly bytes cardinality             # <<<<<<<<<<<<<<
 *         readonly BaseCodec in_dc
 *         readonly BaseCodec out_dc
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_11cardinality_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_11cardinality_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_11cardinality___get__(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_11cardinality___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->cardinality);
  __pyx_r = __pyx_v_self->cardinality;
  goto __pyx_L0;

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

/* "gel/protocol/protocol.pxd":96
 *         # Contextual variables
 *         readonly bytes cardinality
 *         readonly BaseCodec in_dc             # <<<<<<<<<<<<<<
 *         readonly BaseCodec out_dc
 *         readonly uint64_t capabilities
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_5in_dc_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_5in_dc_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_5in_dc___get__(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_5in_dc___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->in_dc);
  __pyx_r = ((PyObject *)__pyx_v_self->in_dc);
  goto __pyx_L0;

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

/* "gel/protocol/protocol.pxd":97
 *         readonly bytes cardinality
 *         readonly BaseCodec in_dc
 *         readonly BaseCodec out_dc             # <<<<<<<<<<<<<<
 *         readonly uint64_t capabilities
 *         readonly tuple warnings
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_6out_dc_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_6out_dc_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_6out_dc___get__(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_6out_dc___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self->out_dc);
  __pyx_r = ((PyObject *)__pyx_v_self->out_dc);
  goto __pyx_L0;

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

/* "gel/protocol/protocol.pxd":98
 *         readonly BaseCodec in_dc
 *         readonly BaseCodec out_dc
 *         readonly uint64_t capabilities             # <<<<<<<<<<<<<<
 *         readonly tuple warnings
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_12capabilities_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_12capabilities_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_12capabilities___get__(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_12capabilities___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->capabilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.capabilities.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pxd":99
 *         readonly BaseCodec out_dc
 *         readonly uint64_t capabilities
 *         readonly tuple warnings             # <<<<<<<<<<<<<<
 * 
 *     cdef inline bint has_na_cardinality(self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_8warnings_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_8warnings_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_8warnings___get__(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_8warnings___get__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->warnings);
  __pyx_r = __pyx_v_self->warnings;
  goto __pyx_L0;

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14ExecuteContext_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_2__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_2__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.allow_capabilities, self.annotations, self.args, self.capabilities, self.cardinality, self.expect_one, self.implicit_limit, self.in_dc, self.inline_typeids, self.inline_typenames, self.input_language, self.kwargs, self.out_dc, self.output_format, self.qc, self.query, self.reg, self.required_one, self.state, self.warnings)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->allow_capabilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(__pyx_v_self->capabilities); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->expect_one); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->implicit_limit); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_self->inline_typeids); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_self->inline_typenames); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_Enum_ef4cfe__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_v_self->input_language); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_v_self->output_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_self->required_one); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyTuple_New(20); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->annotations);
  __Pyx_GIVEREF(__pyx_v_self->annotations);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_self->annotations)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->args);
  __Pyx_GIVEREF(__pyx_v_self->args);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_self->args)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->cardinality);
  __Pyx_GIVEREF(__pyx_v_self->cardinality);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_v_self->cardinality)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->in_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->in_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 7, ((PyObject *)__pyx_v_self->in_dc))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_5);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_6);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_t_6)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_7);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 10, __pyx_t_7)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->kwargs);
  __Pyx_GIVEREF(__pyx_v_self->kwargs);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_v_self->kwargs)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->out_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->out_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 12, ((PyObject *)__pyx_v_self->out_dc))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_8);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 13, __pyx_t_8)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->qc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->qc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 14, ((PyObject *)__pyx_v_self->qc))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->query);
  __Pyx_GIVEREF(__pyx_v_self->query);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 15, __pyx_v_self->query)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->reg);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->reg);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 16, ((PyObject *)__pyx_v_self->reg))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_9);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 17, __pyx_t_9)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->state);
  __Pyx_GIVEREF(__pyx_v_self->state);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 18, __pyx_v_self->state)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->warnings);
  __Pyx_GIVEREF(__pyx_v_self->warnings);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 19, __pyx_v_self->warnings)) __PYX_ERR(2, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.allow_capabilities, self.annotations, self.args, self.capabilities, self.cardinality, self.expect_one, self.implicit_limit, self.in_dc, self.inline_typeids, self.inline_typenames, self.input_language, self.kwargs, self.out_dc, self.output_format, self.qc, self.query, self.reg, self.required_one, self.state, self.warnings)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_v__dict = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "(tree fragment)":7
 *     state = (self.allow_capabilities, self.annotations, self.args, self.capabilities, self.cardinality, self.expect_one, self.implicit_limit, self.in_dc, self.inline_typeids, self.inline_typenames, self.input_language, self.kwargs, self.out_dc, self.output_format, self.qc, self.query, self.reg, self.required_one, self.state, self.warnings)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_11 = (__pyx_v__dict != Py_None);
  if (__pyx_t_11) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error);
    __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_9));
    __pyx_t_9 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.annotations is not None or self.args is not None or self.cardinality is not None or self.in_dc is not None or self.kwargs is not None or self.out_dc is not None or self.qc is not None or self.query is not None or self.reg is not None or self.state is not None or self.warnings is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.allow_capabilities, self.annotations, self.args, self.capabilities, self.cardinality, self.expect_one, self.implicit_limit, self.in_dc, self.inline_typeids, self.inline_typenames, self.input_language, self.kwargs, self.out_dc, self.output_format, self.qc, self.query, self.reg, self.required_one, self.state, self.warnings)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.annotations is not None or self.args is not None or self.cardinality is not None or self.in_dc is not None or self.kwargs is not None or self.out_dc is not None or self.qc is not None or self.query is not None or self.reg is not None or self.state is not None or self.warnings is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, None), state
 */
  /*else*/ {
    __pyx_t_12 = (__pyx_v_self->annotations != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->args != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->cardinality != ((PyObject*)Py_None));
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->in_dc) != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->kwargs != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->out_dc) != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->qc) != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->query != ((PyObject*)Py_None));
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (((PyObject *)__pyx_v_self->reg) != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->state != Py_None);
    if (!__pyx_t_12) {
    } else {
      __pyx_t_11 = __pyx_t_12;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_12 = (__pyx_v_self->warnings != ((PyObject*)Py_None));
    __pyx_t_11 = __pyx_t_12;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_11;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.annotations is not None or self.args is not None or self.cardinality is not None or self.in_dc is not None or self.kwargs is not None or self.out_dc is not None or self.qc is not None or self.query is not None or self.reg is not None or self.state is not None or self.warnings is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.annotations is not None or self.args is not None or self.cardinality is not None or self.in_dc is not None or self.kwargs is not None or self.out_dc is not None or self.qc is not None or self.query is not None or self.reg is not None or self.state is not None or self.warnings is not None
 *     if use_setstate:
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pyx_unpickle_ExecuteContext); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_65974055);
    __Pyx_GIVEREF(__pyx_int_65974055);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_65974055)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_9 = 0;
    __pyx_t_10 = 0;
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.annotations is not None or self.args is not None or self.cardinality is not None or self.in_dc is not None or self.kwargs is not None or self.out_dc is not None or self.qc is not None or self.query is not None or self.reg is not None or self.state is not None or self.warnings is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, None), state
 *     else:
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ExecuteContext__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_ExecuteContext); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_65974055);
    __Pyx_GIVEREF(__pyx_int_65974055);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_65974055)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_8 = 0;
    __pyx_t_10 = 0;
    __pyx_r = __pyx_t_9;
    __pyx_t_9 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ExecuteContext__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14ExecuteContext_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_4__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14ExecuteContext_4__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_ExecuteContext__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_ExecuteContext__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ExecuteContext__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.ExecuteContext.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":172
 * cdef class SansIOProtocol:
 * 
 *     def __init__(self, con_params):             # <<<<<<<<<<<<<<
 *         self.buffer = ReadBuffer()
 * 
 */

/* Python wrapper */
static int __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_con_params = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_con_params,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_con_params)) != 0)) {
          (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 172, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(8, 172, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
    }
    __pyx_v_con_params = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 172, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol___init__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_con_params);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol___init__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_con_params) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 1);

  /* "gel/protocol/protocol.pyx":173
 * 
 *     def __init__(self, con_params):
 *         self.buffer = ReadBuffer()             # <<<<<<<<<<<<<<
 * 
 *         self.con_params = con_params
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->buffer);
  __Pyx_DECREF((PyObject *)__pyx_v_self->buffer);
  __pyx_v_self->buffer = ((struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":175
 *         self.buffer = ReadBuffer()
 * 
 *         self.con_params = con_params             # <<<<<<<<<<<<<<
 * 
 *         self.connected = False
 */
  __Pyx_INCREF(__pyx_v_con_params);
  __Pyx_GIVEREF(__pyx_v_con_params);
  __Pyx_GOTREF(__pyx_v_self->con_params);
  __Pyx_DECREF(__pyx_v_self->con_params);
  __pyx_v_self->con_params = __pyx_v_con_params;

  /* "gel/protocol/protocol.pyx":177
 *         self.con_params = con_params
 * 
 *         self.connected = False             # <<<<<<<<<<<<<<
 *         self.cancelled = False
 *         self.backend_secret = None
 */
  __pyx_v_self->connected = 0;

  /* "gel/protocol/protocol.pyx":178
 * 
 *         self.connected = False
 *         self.cancelled = False             # <<<<<<<<<<<<<<
 *         self.backend_secret = None
 * 
 */
  __pyx_v_self->cancelled = 0;

  /* "gel/protocol/protocol.pyx":179
 *         self.connected = False
 *         self.cancelled = False
 *         self.backend_secret = None             # <<<<<<<<<<<<<<
 * 
 *         self.xact_status = TRANS_UNKNOWN
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->backend_secret);
  __Pyx_DECREF(__pyx_v_self->backend_secret);
  __pyx_v_self->backend_secret = Py_None;

  /* "gel/protocol/protocol.pyx":181
 *         self.backend_secret = None
 * 
 *         self.xact_status = TRANS_UNKNOWN             # <<<<<<<<<<<<<<
 * 
 *         self.internal_reg = CodecsRegistry()
 */
  __pyx_v_self->xact_status = __pyx_e_3gel_8protocol_8protocol_TRANS_UNKNOWN;

  /* "gel/protocol/protocol.pyx":183
 *         self.xact_status = TRANS_UNKNOWN
 * 
 *         self.internal_reg = CodecsRegistry()             # <<<<<<<<<<<<<<
 *         self.server_settings = {}
 *         self.reset_status()
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 183, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->internal_reg);
  __Pyx_DECREF((PyObject *)__pyx_v_self->internal_reg);
  __pyx_v_self->internal_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":184
 * 
 *         self.internal_reg = CodecsRegistry()
 *         self.server_settings = {}             # <<<<<<<<<<<<<<
 *         self.reset_status()
 *         self.protocol_version = (PROTO_VER_MAJOR, PROTO_VER_MINOR)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->server_settings);
  __Pyx_DECREF(__pyx_v_self->server_settings);
  __pyx_v_self->server_settings = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":185
 *         self.internal_reg = CodecsRegistry()
 *         self.server_settings = {}
 *         self.reset_status()             # <<<<<<<<<<<<<<
 *         self.protocol_version = (PROTO_VER_MAJOR, PROTO_VER_MINOR)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self->__pyx_vtab)->reset_status(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":186
 *         self.server_settings = {}
 *         self.reset_status()
 *         self.protocol_version = (PROTO_VER_MAJOR, PROTO_VER_MINOR)             # <<<<<<<<<<<<<<
 * 
 *         self.state_type_id = NULL_CODEC_ID
 */
  __Pyx_INCREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __Pyx_GOTREF(__pyx_v_self->protocol_version);
  __Pyx_DECREF(__pyx_v_self->protocol_version);
  __pyx_v_self->protocol_version = __pyx_tuple__54;

  /* "gel/protocol/protocol.pyx":188
 *         self.protocol_version = (PROTO_VER_MAJOR, PROTO_VER_MINOR)
 * 
 *         self.state_type_id = NULL_CODEC_ID             # <<<<<<<<<<<<<<
 *         self.state_codec = None
 *         self.state_cache = (None, None)
 */
  __Pyx_INCREF(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID);
  __Pyx_GIVEREF(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID);
  __Pyx_GOTREF(__pyx_v_self->state_type_id);
  __Pyx_DECREF(__pyx_v_self->state_type_id);
  __pyx_v_self->state_type_id = __pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID;

  /* "gel/protocol/protocol.pyx":189
 * 
 *         self.state_type_id = NULL_CODEC_ID
 *         self.state_codec = None             # <<<<<<<<<<<<<<
 *         self.state_cache = (None, None)
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->state_codec);
  __Pyx_DECREF((PyObject *)__pyx_v_self->state_codec);
  __pyx_v_self->state_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);

  /* "gel/protocol/protocol.pyx":190
 *         self.state_type_id = NULL_CODEC_ID
 *         self.state_codec = None
 *         self.state_cache = (None, None)             # <<<<<<<<<<<<<<
 * 
 *     cdef reset_status(self):
 */
  __Pyx_INCREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);
  __Pyx_GOTREF(__pyx_v_self->state_cache);
  __Pyx_DECREF(__pyx_v_self->state_cache);
  __pyx_v_self->state_cache = __pyx_tuple__55;

  /* "gel/protocol/protocol.pyx":172
 * cdef class SansIOProtocol:
 * 
 *     def __init__(self, con_params):             # <<<<<<<<<<<<<<
 *         self.buffer = ReadBuffer()
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":192
 *         self.state_cache = (None, None)
 * 
 *     cdef reset_status(self):             # <<<<<<<<<<<<<<
 *         self.last_status = None
 *         self.last_details = None
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_reset_status(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset_status", 1);

  /* "gel/protocol/protocol.pyx":193
 * 
 *     cdef reset_status(self):
 *         self.last_status = None             # <<<<<<<<<<<<<<
 *         self.last_details = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->last_status);
  __Pyx_DECREF(__pyx_v_self->last_status);
  __pyx_v_self->last_status = ((PyObject*)Py_None);

  /* "gel/protocol/protocol.pyx":194
 *     cdef reset_status(self):
 *         self.last_status = None
 *         self.last_details = None             # <<<<<<<<<<<<<<
 * 
 *     def get_settings(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->last_details);
  __Pyx_DECREF(__pyx_v_self->last_details);
  __pyx_v_self->last_details = ((PyObject*)Py_None);

  /* "gel/protocol/protocol.pyx":192
 *         self.state_cache = (None, None)
 * 
 *     cdef reset_status(self):             # <<<<<<<<<<<<<<
 *         self.last_status = None
 *         self.last_details = None
 */

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

/* "gel/protocol/protocol.pyx":196
 *         self.last_details = None
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         return types.MappingProxyType(self.server_settings)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_3get_settings(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_3get_settings = {"get_settings", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_3get_settings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_3get_settings(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_settings (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("get_settings", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "get_settings", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_2get_settings(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_2get_settings(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_settings", 1);

  /* "gel/protocol/protocol.pyx":197
 * 
 *     def get_settings(self):
 *         return types.MappingProxyType(self.server_settings)             # <<<<<<<<<<<<<<
 * 
 *     def is_in_transaction(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MappingProxyType); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self->server_settings};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":196
 *         self.last_details = None
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         return types.MappingProxyType(self.server_settings)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.get_settings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":199
 *         return types.MappingProxyType(self.server_settings)
 * 
 *     def is_in_transaction(self):             # <<<<<<<<<<<<<<
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_5is_in_transaction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_5is_in_transaction = {"is_in_transaction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_5is_in_transaction, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_5is_in_transaction(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_in_transaction (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("is_in_transaction", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_in_transaction", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_4is_in_transaction(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_4is_in_transaction(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_in_transaction", 1);

  /* "gel/protocol/protocol.pyx":200
 * 
 *     def is_in_transaction(self):
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)             # <<<<<<<<<<<<<<
 * 
 *     def set_connection(self, con):
 */
  __Pyx_XDECREF(__pyx_r);
  switch (__pyx_v_self->xact_status) {
    case __pyx_e_3gel_8protocol_8protocol_TRANS_INTRANS:
    case __pyx_e_3gel_8protocol_8protocol_TRANS_INERROR:
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":199
 *         return types.MappingProxyType(self.server_settings)
 * 
 *     def is_in_transaction(self):             # <<<<<<<<<<<<<<
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.is_in_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":202
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)
 * 
 *     def set_connection(self, con):             # <<<<<<<<<<<<<<
 *         self.con = weakref.ref(con)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_7set_connection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_7set_connection = {"set_connection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_7set_connection, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_7set_connection(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_con = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_connection (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_con,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_con)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 202, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "set_connection") < 0)) __PYX_ERR(8, 202, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_con = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_connection", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 202, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.set_connection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_6set_connection(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_con);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_6set_connection(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_con) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_connection", 1);

  /* "gel/protocol/protocol.pyx":203
 * 
 *     def set_connection(self, con):
 *         self.con = weakref.ref(con)             # <<<<<<<<<<<<<<
 * 
 *     cpdef abort(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_weakref); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ref); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_con};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->con);
  __Pyx_DECREF(__pyx_v_self->con);
  __pyx_v_self->con = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":202
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)
 * 
 *     def set_connection(self, con):             # <<<<<<<<<<<<<<
 *         self.con = weakref.ref(con)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.set_connection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":205
 *         self.con = weakref.ref(con)
 * 
 *     cpdef abort(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9abort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_abort(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, int __pyx_skip_dispatch) {
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abort", 1);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abort); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void*) __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9abort)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        __pyx_t_5 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_5 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 205, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "gel/protocol/protocol.pyx":206
 * 
 *     cpdef abort(self):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef write(self, WriteBuffer buf):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(8, 206, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":205
 *         self.con = weakref.ref(con)
 * 
 *     cpdef abort(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.abort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9abort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_9abort = {"abort", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9abort, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9abort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("abort (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("abort", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "abort", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_8abort(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_8abort(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("abort", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_abort(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.abort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":208
 *         raise NotImplementedError
 * 
 *     cdef write(self, WriteBuffer buf):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_write(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, CYTHON_UNUSED struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 1);

  /* "gel/protocol/protocol.pyx":209
 * 
 *     cdef write(self, WriteBuffer buf):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     async def wait_for_message(self):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(8, 209, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":208
 *         raise NotImplementedError
 * 
 *     cdef write(self, WriteBuffer buf):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_12generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":211
 *         raise NotImplementedError
 * 
 *     async def wait_for_message(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_11wait_for_message(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_11wait_for_message = {"wait_for_message", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_11wait_for_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_11wait_for_message(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait_for_message (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("wait_for_message", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wait_for_message", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_10wait_for_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_10wait_for_message(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wait_for_message", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 211, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_12generator, __pyx_codeobj__56, (PyObject *) __pyx_cur_scope, __pyx_n_s_wait_for_message, __pyx_n_s_SansIOProtocol_wait_for_message, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.wait_for_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_12generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait_for_message", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 211, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":212
 * 
 *     async def wait_for_message(self):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     async def try_recv_eagerly(self):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(8, 212, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":211
 *         raise NotImplementedError
 * 
 *     async def wait_for_message(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_AddTraceback("wait_for_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_15generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":214
 *         raise NotImplementedError
 * 
 *     async def try_recv_eagerly(self):             # <<<<<<<<<<<<<<
 *         # If there's data in the socket try reading it into the
 *         # buffer.  Needed for blocking-io connections.
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_14try_recv_eagerly(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_14try_recv_eagerly = {"try_recv_eagerly", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_14try_recv_eagerly, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_14try_recv_eagerly(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("try_recv_eagerly (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("try_recv_eagerly", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "try_recv_eagerly", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_13try_recv_eagerly(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_13try_recv_eagerly(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("try_recv_eagerly", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 214, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_15generator1, __pyx_codeobj__57, (PyObject *) __pyx_cur_scope, __pyx_n_s_try_recv_eagerly, __pyx_n_s_SansIOProtocol_try_recv_eagerly, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 214, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.try_recv_eagerly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_15generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("try_recv_eagerly", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 214, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":217
 *         # If there's data in the socket try reading it into the
 *         # buffer.  Needed for blocking-io connections.
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     async def wait_for_connect(self):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(8, 217, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":214
 *         raise NotImplementedError
 * 
 *     async def try_recv_eagerly(self):             # <<<<<<<<<<<<<<
 *         # If there's data in the socket try reading it into the
 *         # buffer.  Needed for blocking-io connections.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_AddTraceback("try_recv_eagerly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":219
 *         raise NotImplementedError
 * 
 *     async def wait_for_connect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_17wait_for_connect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_17wait_for_connect = {"wait_for_connect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_17wait_for_connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_17wait_for_connect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait_for_connect (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("wait_for_connect", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wait_for_connect", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_16wait_for_connect(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_16wait_for_connect(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wait_for_connect", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 219, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_18generator2, __pyx_codeobj__58, (PyObject *) __pyx_cur_scope, __pyx_n_s_wait_for_connect, __pyx_n_s_SansIOProtocol_wait_for_connect, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 219, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.wait_for_connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait_for_connect", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 219, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":220
 * 
 *     async def wait_for_connect(self):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     async def wait_for_disconnect(self):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(8, 220, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":219
 *         raise NotImplementedError
 * 
 *     async def wait_for_connect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_AddTraceback("wait_for_connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_21generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":222
 *         raise NotImplementedError
 * 
 *     async def wait_for_disconnect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_20wait_for_disconnect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_20wait_for_disconnect = {"wait_for_disconnect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_20wait_for_disconnect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_20wait_for_disconnect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait_for_disconnect (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("wait_for_disconnect", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wait_for_disconnect", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_19wait_for_disconnect(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_19wait_for_disconnect(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("wait_for_disconnect", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 222, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_21generator3, __pyx_codeobj__59, (PyObject *) __pyx_cur_scope, __pyx_n_s_wait_for_disconnect, __pyx_n_s_SansIOProtocol_wait_for_disconne, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 222, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.wait_for_disconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_21generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wait_for_disconnect", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 222, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":223
 * 
 *     async def wait_for_disconnect(self):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     cdef inline ignore_headers(self):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(8, 223, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":222
 *         raise NotImplementedError
 * 
 *     async def wait_for_disconnect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_AddTraceback("wait_for_disconnect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":225
 *         raise NotImplementedError
 * 
 *     cdef inline ignore_headers(self):             # <<<<<<<<<<<<<<
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         if self.is_legacy:
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  uint16_t __pyx_v_num_fields;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int16_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ignore_headers", 1);

  /* "gel/protocol/protocol.pyx":226
 * 
 *     cdef inline ignore_headers(self):
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()             # <<<<<<<<<<<<<<
 *         if self.is_legacy:
 *             while num_fields:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 226, __pyx_L1_error)
  __pyx_v_num_fields = ((uint16_t)__pyx_t_1);

  /* "gel/protocol/protocol.pyx":227
 *     cdef inline ignore_headers(self):
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         if self.is_legacy:             # <<<<<<<<<<<<<<
 *             while num_fields:
 *                 self.buffer.read_int16()  # key
 */
  if (__pyx_v_self->is_legacy) {

    /* "gel/protocol/protocol.pyx":228
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         if self.is_legacy:
 *             while num_fields:             # <<<<<<<<<<<<<<
 *                 self.buffer.read_int16()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value
 */
    while (1) {
      __pyx_t_2 = (__pyx_v_num_fields != 0);
      if (!__pyx_t_2) break;

      /* "gel/protocol/protocol.pyx":229
 *         if self.is_legacy:
 *             while num_fields:
 *                 self.buffer.read_int16()  # key             # <<<<<<<<<<<<<<
 *                 self.buffer.read_len_prefixed_bytes()  # value
 *                 num_fields -= 1
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 229, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":230
 *             while num_fields:
 *                 self.buffer.read_int16()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value             # <<<<<<<<<<<<<<
 *                 num_fields -= 1
 *         else:
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 230, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "gel/protocol/protocol.pyx":231
 *                 self.buffer.read_int16()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value
 *                 num_fields -= 1             # <<<<<<<<<<<<<<
 *         else:
 *             while num_fields:
 */
      __pyx_v_num_fields = (__pyx_v_num_fields - 1);
    }

    /* "gel/protocol/protocol.pyx":227
 *     cdef inline ignore_headers(self):
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         if self.is_legacy:             # <<<<<<<<<<<<<<
 *             while num_fields:
 *                 self.buffer.read_int16()  # key
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/protocol.pyx":233
 *                 num_fields -= 1
 *         else:
 *             while num_fields:             # <<<<<<<<<<<<<<
 *                 self.buffer.read_len_prefixed_bytes()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value
 */
  /*else*/ {
    while (1) {
      __pyx_t_2 = (__pyx_v_num_fields != 0);
      if (!__pyx_t_2) break;

      /* "gel/protocol/protocol.pyx":234
 *         else:
 *             while num_fields:
 *                 self.buffer.read_len_prefixed_bytes()  # key             # <<<<<<<<<<<<<<
 *                 self.buffer.read_len_prefixed_bytes()  # value
 *                 num_fields -= 1
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "gel/protocol/protocol.pyx":235
 *             while num_fields:
 *                 self.buffer.read_len_prefixed_bytes()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value             # <<<<<<<<<<<<<<
 *                 num_fields -= 1
 * 
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "gel/protocol/protocol.pyx":236
 *                 self.buffer.read_len_prefixed_bytes()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value
 *                 num_fields -= 1             # <<<<<<<<<<<<<<
 * 
 *     cdef inline dict read_headers(self):
 */
      __pyx_v_num_fields = (__pyx_v_num_fields - 1);
    }
  }
  __pyx_L3:;

  /* "gel/protocol/protocol.pyx":225
 *         raise NotImplementedError
 * 
 *     cdef inline ignore_headers(self):             # <<<<<<<<<<<<<<
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         if self.is_legacy:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.ignore_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":238
 *                 num_fields -= 1
 * 
 *     cdef inline dict read_headers(self):             # <<<<<<<<<<<<<<
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         headers = {}
 */

static CYTHON_INLINE PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_read_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  uint16_t __pyx_v_num_fields;
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int16_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_headers", 1);

  /* "gel/protocol/protocol.pyx":239
 * 
 *     cdef inline dict read_headers(self):
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()             # <<<<<<<<<<<<<<
 *         headers = {}
 *         if self.is_legacy:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 239, __pyx_L1_error)
  __pyx_v_num_fields = ((uint16_t)__pyx_t_1);

  /* "gel/protocol/protocol.pyx":240
 *     cdef inline dict read_headers(self):
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         headers = {}             # <<<<<<<<<<<<<<
 *         if self.is_legacy:
 *             while num_fields:
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_headers = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/protocol.pyx":241
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         headers = {}
 *         if self.is_legacy:             # <<<<<<<<<<<<<<
 *             while num_fields:
 *                 self.buffer.read_int16()  # key
 */
  if (__pyx_v_self->is_legacy) {

    /* "gel/protocol/protocol.pyx":242
 *         headers = {}
 *         if self.is_legacy:
 *             while num_fields:             # <<<<<<<<<<<<<<
 *                 self.buffer.read_int16()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value
 */
    while (1) {
      __pyx_t_3 = (__pyx_v_num_fields != 0);
      if (!__pyx_t_3) break;

      /* "gel/protocol/protocol.pyx":243
 *         if self.is_legacy:
 *             while num_fields:
 *                 self.buffer.read_int16()  # key             # <<<<<<<<<<<<<<
 *                 self.buffer.read_len_prefixed_bytes()  # value
 *                 num_fields -= 1
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 243, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":244
 *             while num_fields:
 *                 self.buffer.read_int16()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value             # <<<<<<<<<<<<<<
 *                 num_fields -= 1
 *         else:
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "gel/protocol/protocol.pyx":245
 *                 self.buffer.read_int16()  # key
 *                 self.buffer.read_len_prefixed_bytes()  # value
 *                 num_fields -= 1             # <<<<<<<<<<<<<<
 *         else:
 *             while num_fields:
 */
      __pyx_v_num_fields = (__pyx_v_num_fields - 1);
    }

    /* "gel/protocol/protocol.pyx":241
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         headers = {}
 *         if self.is_legacy:             # <<<<<<<<<<<<<<
 *             while num_fields:
 *                 self.buffer.read_int16()  # key
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/protocol.pyx":247
 *                 num_fields -= 1
 *         else:
 *             while num_fields:             # <<<<<<<<<<<<<<
 *                 key = self.buffer.read_len_prefixed_utf8()
 *                 value = self.buffer.read_len_prefixed_utf8()
 */
  /*else*/ {
    while (1) {
      __pyx_t_3 = (__pyx_v_num_fields != 0);
      if (!__pyx_t_3) break;

      /* "gel/protocol/protocol.pyx":248
 *         else:
 *             while num_fields:
 *                 key = self.buffer.read_len_prefixed_utf8()             # <<<<<<<<<<<<<<
 *                 value = self.buffer.read_len_prefixed_utf8()
 *                 headers[key] = value
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_utf8(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_key, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "gel/protocol/protocol.pyx":249
 *             while num_fields:
 *                 key = self.buffer.read_len_prefixed_utf8()
 *                 value = self.buffer.read_len_prefixed_utf8()             # <<<<<<<<<<<<<<
 *                 headers[key] = value
 *                 num_fields -= 1
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_utf8(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_value, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "gel/protocol/protocol.pyx":250
 *                 key = self.buffer.read_len_prefixed_utf8()
 *                 value = self.buffer.read_len_prefixed_utf8()
 *                 headers[key] = value             # <<<<<<<<<<<<<<
 *                 num_fields -= 1
 * 
 */
      if (unlikely((PyDict_SetItem(__pyx_v_headers, __pyx_v_key, __pyx_v_value) < 0))) __PYX_ERR(8, 250, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":251
 *                 value = self.buffer.read_len_prefixed_utf8()
 *                 headers[key] = value
 *                 num_fields -= 1             # <<<<<<<<<<<<<<
 * 
 *         return headers
 */
      __pyx_v_num_fields = (__pyx_v_num_fields - 1);
    }
  }
  __pyx_L3:;

  /* "gel/protocol/protocol.pyx":253
 *                 num_fields -= 1
 * 
 *         return headers             # <<<<<<<<<<<<<<
 * 
 *     cdef write_annotations(self, ExecuteContext ctx, WriteBuffer buf):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_headers);
  __pyx_r = __pyx_v_headers;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":238
 *                 num_fields -= 1
 * 
 *     cdef inline dict read_headers(self):             # <<<<<<<<<<<<<<
 *         cdef uint16_t num_fields = <uint16_t>self.buffer.read_int16()
 *         headers = {}
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.read_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":255
 *         return headers
 * 
 *     cdef write_annotations(self, ExecuteContext ctx, WriteBuffer buf):             # <<<<<<<<<<<<<<
 *         num_annos = len(ctx.annotations) if ctx.annotations is not None else 0
 *         if self.protocol_version >= (3, 0) and num_annos > 0:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_write_annotations(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf) {
  Py_ssize_t __pyx_v_num_annos;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_annotations", 1);

  /* "gel/protocol/protocol.pyx":256
 * 
 *     cdef write_annotations(self, ExecuteContext ctx, WriteBuffer buf):
 *         num_annos = len(ctx.annotations) if ctx.annotations is not None else 0             # <<<<<<<<<<<<<<
 *         if self.protocol_version >= (3, 0) and num_annos > 0:
 *             if num_annos >= 1 << 16:
 */
  __pyx_t_2 = (__pyx_v_ctx->annotations != Py_None);
  if (__pyx_t_2) {
    __pyx_t_3 = __pyx_v_ctx->annotations;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(8, 256, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_4;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_v_num_annos = __pyx_t_1;

  /* "gel/protocol/protocol.pyx":257
 *     cdef write_annotations(self, ExecuteContext ctx, WriteBuffer buf):
 *         num_annos = len(ctx.annotations) if ctx.annotations is not None else 0
 *         if self.protocol_version >= (3, 0) and num_annos > 0:             # <<<<<<<<<<<<<<
 *             if num_annos >= 1 << 16:
 *                 raise errors.InvalidArgumentError("too many annotations")
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->protocol_version, __pyx_tuple__54, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 257, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(8, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = (__pyx_v_num_annos > 0);
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "gel/protocol/protocol.pyx":258
 *         num_annos = len(ctx.annotations) if ctx.annotations is not None else 0
 *         if self.protocol_version >= (3, 0) and num_annos > 0:
 *             if num_annos >= 1 << 16:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError("too many annotations")
 *             buf.write_int16(num_annos)
 */
    __pyx_t_2 = (__pyx_v_num_annos >= 0x10000);
    if (unlikely(__pyx_t_2)) {

      /* "gel/protocol/protocol.pyx":259
 *         if self.protocol_version >= (3, 0) and num_annos > 0:
 *             if num_annos >= 1 << 16:
 *                 raise errors.InvalidArgumentError("too many annotations")             # <<<<<<<<<<<<<<
 *             buf.write_int16(num_annos)
 *             for key, value in ctx.annotations.items():
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_InvalidArgumentError); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_too_many_annotations};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(8, 259, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":258
 *         num_annos = len(ctx.annotations) if ctx.annotations is not None else 0
 *         if self.protocol_version >= (3, 0) and num_annos > 0:
 *             if num_annos >= 1 << 16:             # <<<<<<<<<<<<<<
 *                 raise errors.InvalidArgumentError("too many annotations")
 *             buf.write_int16(num_annos)
 */
    }

    /* "gel/protocol/protocol.pyx":260
 *             if num_annos >= 1 << 16:
 *                 raise errors.InvalidArgumentError("too many annotations")
 *             buf.write_int16(num_annos)             # <<<<<<<<<<<<<<
 *             for key, value in ctx.annotations.items():
 *                 buf.write_len_prefixed_utf8(key)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_v_num_annos); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":261
 *                 raise errors.InvalidArgumentError("too many annotations")
 *             buf.write_int16(num_annos)
 *             for key, value in ctx.annotations.items():             # <<<<<<<<<<<<<<
 *                 buf.write_len_prefixed_utf8(key)
 *                 buf.write_len_prefixed_utf8(value)
 */
    __pyx_t_1 = 0;
    if (unlikely(__pyx_v_ctx->annotations == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
      __PYX_ERR(8, 261, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_ctx->annotations, 0, __pyx_n_s_items, (&__pyx_t_4), (&__pyx_t_9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_3);
    __pyx_t_3 = __pyx_t_7;
    __pyx_t_7 = 0;
    while (1) {
      __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_4, &__pyx_t_1, &__pyx_t_7, &__pyx_t_6, NULL, __pyx_t_9);
      if (unlikely(__pyx_t_10 == 0)) break;
      if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(8, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "gel/protocol/protocol.pyx":262
 *             buf.write_int16(num_annos)
 *             for key, value in ctx.annotations.items():
 *                 buf.write_len_prefixed_utf8(key)             # <<<<<<<<<<<<<<
 *                 buf.write_len_prefixed_utf8(value)
 *         else:
 */
      if (!(likely(PyUnicode_CheckExact(__pyx_v_key))||((__pyx_v_key) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_key))) __PYX_ERR(8, 262, __pyx_L1_error)
      __pyx_t_6 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_v_buf, ((PyObject*)__pyx_v_key)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "gel/protocol/protocol.pyx":263
 *             for key, value in ctx.annotations.items():
 *                 buf.write_len_prefixed_utf8(key)
 *                 buf.write_len_prefixed_utf8(value)             # <<<<<<<<<<<<<<
 *         else:
 *             buf.write_int16(0)  # no annotations
 */
      if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_value))) __PYX_ERR(8, 263, __pyx_L1_error)
      __pyx_t_6 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_v_buf, ((PyObject*)__pyx_v_value)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":257
 *     cdef write_annotations(self, ExecuteContext ctx, WriteBuffer buf):
 *         num_annos = len(ctx.annotations) if ctx.annotations is not None else 0
 *         if self.protocol_version >= (3, 0) and num_annos > 0:             # <<<<<<<<<<<<<<
 *             if num_annos >= 1 << 16:
 *                 raise errors.InvalidArgumentError("too many annotations")
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/protocol.pyx":265
 *                 buf.write_len_prefixed_utf8(value)
 *         else:
 *             buf.write_int16(0)  # no annotations             # <<<<<<<<<<<<<<
 * 
 *     cdef ensure_connected(self):
 */
  /*else*/ {
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "gel/protocol/protocol.pyx":255
 *         return headers
 * 
 *     cdef write_annotations(self, ExecuteContext ctx, WriteBuffer buf):             # <<<<<<<<<<<<<<
 *         num_annos = len(ctx.annotations) if ctx.annotations is not None else 0
 *         if self.protocol_version >= (3, 0) and num_annos > 0:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.write_annotations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":267
 *             buf.write_int16(0)  # no annotations
 * 
 *     cdef ensure_connected(self):             # <<<<<<<<<<<<<<
 *         if self.cancelled:
 *             raise errors.ClientConnectionClosedError(
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ensure_connected(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ensure_connected", 1);

  /* "gel/protocol/protocol.pyx":268
 * 
 *     cdef ensure_connected(self):
 *         if self.cancelled:             # <<<<<<<<<<<<<<
 *             raise errors.ClientConnectionClosedError(
 *                 'the connection has been closed '
 */
  if (unlikely(__pyx_v_self->cancelled)) {

    /* "gel/protocol/protocol.pyx":269
 *     cdef ensure_connected(self):
 *         if self.cancelled:
 *             raise errors.ClientConnectionClosedError(             # <<<<<<<<<<<<<<
 *                 'the connection has been closed '
 *                 'because an operation was cancelled on it')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ClientConnectionClosedError); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_the_connection_has_been_closed_b};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(8, 269, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":268
 * 
 *     cdef ensure_connected(self):
 *         if self.cancelled:             # <<<<<<<<<<<<<<
 *             raise errors.ClientConnectionClosedError(
 *                 'the connection has been closed '
 */
  }

  /* "gel/protocol/protocol.pyx":272
 *                 'the connection has been closed '
 *                 'because an operation was cancelled on it')
 *         if not self.connected:             # <<<<<<<<<<<<<<
 *             raise errors.ClientConnectionClosedError(
 *                 'the connection has been closed')
 */
  __pyx_t_5 = (!__pyx_v_self->connected);
  if (unlikely(__pyx_t_5)) {

    /* "gel/protocol/protocol.pyx":273
 *                 'because an operation was cancelled on it')
 *         if not self.connected:
 *             raise errors.ClientConnectionClosedError(             # <<<<<<<<<<<<<<
 *                 'the connection has been closed')
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ClientConnectionClosedError); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_the_connection_has_been_closed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(8, 273, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":272
 *                 'the connection has been closed '
 *                 'because an operation was cancelled on it')
 *         if not self.connected:             # <<<<<<<<<<<<<<
 *             raise errors.ClientConnectionClosedError(
 *                 'the connection has been closed')
 */
  }

  /* "gel/protocol/protocol.pyx":267
 *             buf.write_int16(0)  # no annotations
 * 
 *     cdef ensure_connected(self):             # <<<<<<<<<<<<<<
 *         if self.cancelled:
 *             raise errors.ClientConnectionClosedError(
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.ensure_connected", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":276
 *                 'the connection has been closed')
 * 
 *     cdef WriteBuffer encode_parse_params(self, ExecuteContext ctx):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */

static struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_parse_params(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_v_compilation_flags = NULL;
  PyObject *__pyx_v_state_type_id = NULL;
  PyObject *__pyx_v_state_data = NULL;
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  uint64_t __pyx_t_3;
  int __pyx_t_4;
  char __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_parse_params", 1);

  /* "gel/protocol/protocol.pyx":280
 *             WriteBuffer buf
 * 
 *         compilation_flags = enums.CompilationFlag.INJECT_OUTPUT_OBJECT_IDS             # <<<<<<<<<<<<<<
 *         if ctx.inline_typenames:
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_NAMES
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_enums); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CompilationFlag); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_INJECT_OUTPUT_OBJECT_IDS); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_compilation_flags = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":281
 * 
 *         compilation_flags = enums.CompilationFlag.INJECT_OUTPUT_OBJECT_IDS
 *         if ctx.inline_typenames:             # <<<<<<<<<<<<<<
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_NAMES
 *         if ctx.inline_typeids:
 */
  if (__pyx_v_ctx->inline_typenames) {

    /* "gel/protocol/protocol.pyx":282
 *         compilation_flags = enums.CompilationFlag.INJECT_OUTPUT_OBJECT_IDS
 *         if ctx.inline_typenames:
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_NAMES             # <<<<<<<<<<<<<<
 *         if ctx.inline_typeids:
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_IDS
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_enums); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CompilationFlag); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_INJECT_OUTPUT_TYPE_NAMES); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceOr(__pyx_v_compilation_flags, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_compilation_flags, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":281
 * 
 *         compilation_flags = enums.CompilationFlag.INJECT_OUTPUT_OBJECT_IDS
 *         if ctx.inline_typenames:             # <<<<<<<<<<<<<<
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_NAMES
 *         if ctx.inline_typeids:
 */
  }

  /* "gel/protocol/protocol.pyx":283
 *         if ctx.inline_typenames:
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_NAMES
 *         if ctx.inline_typeids:             # <<<<<<<<<<<<<<
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_IDS
 * 
 */
  if (__pyx_v_ctx->inline_typeids) {

    /* "gel/protocol/protocol.pyx":284
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_NAMES
 *         if ctx.inline_typeids:
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_IDS             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_enums); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CompilationFlag); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 284, __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_INJECT_OUTPUT_TYPE_IDS); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceOr(__pyx_v_compilation_flags, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_compilation_flags, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":283
 *         if ctx.inline_typenames:
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_NAMES
 *         if ctx.inline_typeids:             # <<<<<<<<<<<<<<
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_IDS
 * 
 */
  }

  /* "gel/protocol/protocol.pyx":286
 *             compilation_flags |= enums.CompilationFlag.INJECT_OUTPUT_TYPE_IDS
 * 
 *         buf = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         buf.write_int64(<int64_t>ctx.allow_capabilities)
 *         buf.write_int64(<int64_t><uint64_t>compilation_flags)
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":287
 * 
 *         buf = WriteBuffer.new()
 *         buf.write_int64(<int64_t>ctx.allow_capabilities)             # <<<<<<<<<<<<<<
 *         buf.write_int64(<int64_t><uint64_t>compilation_flags)
 *         buf.write_int64(<int64_t>ctx.implicit_limit)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int64(__pyx_v_buf, ((int64_t)__pyx_v_ctx->allow_capabilities)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":288
 *         buf = WriteBuffer.new()
 *         buf.write_int64(<int64_t>ctx.allow_capabilities)
 *         buf.write_int64(<int64_t><uint64_t>compilation_flags)             # <<<<<<<<<<<<<<
 *         buf.write_int64(<int64_t>ctx.implicit_limit)
 *         if self.protocol_version >= (3, 0):
 */
  __pyx_t_3 = __Pyx_PyInt_As_uint64_t(__pyx_v_compilation_flags); if (unlikely((__pyx_t_3 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 288, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int64(__pyx_v_buf, ((int64_t)((uint64_t)__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":289
 *         buf.write_int64(<int64_t>ctx.allow_capabilities)
 *         buf.write_int64(<int64_t><uint64_t>compilation_flags)
 *         buf.write_int64(<int64_t>ctx.implicit_limit)             # <<<<<<<<<<<<<<
 *         if self.protocol_version >= (3, 0):
 *             buf.write_byte(ctx.input_language)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int64(__pyx_v_buf, ((int64_t)__pyx_v_ctx->implicit_limit)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":290
 *         buf.write_int64(<int64_t><uint64_t>compilation_flags)
 *         buf.write_int64(<int64_t>ctx.implicit_limit)
 *         if self.protocol_version >= (3, 0):             # <<<<<<<<<<<<<<
 *             buf.write_byte(ctx.input_language)
 *         buf.write_byte(ctx.output_format)
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_self->protocol_version, __pyx_tuple__54, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 290, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "gel/protocol/protocol.pyx":291
 *         buf.write_int64(<int64_t>ctx.implicit_limit)
 *         if self.protocol_version >= (3, 0):
 *             buf.write_byte(ctx.input_language)             # <<<<<<<<<<<<<<
 *         buf.write_byte(ctx.output_format)
 *         buf.write_byte(CARDINALITY_ONE if ctx.expect_one else CARDINALITY_MANY)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, __pyx_v_ctx->input_language); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":290
 *         buf.write_int64(<int64_t><uint64_t>compilation_flags)
 *         buf.write_int64(<int64_t>ctx.implicit_limit)
 *         if self.protocol_version >= (3, 0):             # <<<<<<<<<<<<<<
 *             buf.write_byte(ctx.input_language)
 *         buf.write_byte(ctx.output_format)
 */
  }

  /* "gel/protocol/protocol.pyx":292
 *         if self.protocol_version >= (3, 0):
 *             buf.write_byte(ctx.input_language)
 *         buf.write_byte(ctx.output_format)             # <<<<<<<<<<<<<<
 *         buf.write_byte(CARDINALITY_ONE if ctx.expect_one else CARDINALITY_MANY)
 *         buf.write_len_prefixed_utf8(ctx.query)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, __pyx_v_ctx->output_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":293
 *             buf.write_byte(ctx.input_language)
 *         buf.write_byte(ctx.output_format)
 *         buf.write_byte(CARDINALITY_ONE if ctx.expect_one else CARDINALITY_MANY)             # <<<<<<<<<<<<<<
 *         buf.write_len_prefixed_utf8(ctx.query)
 * 
 */
  if (__pyx_v_ctx->expect_one) {
    __pyx_t_5 = 'o';
  } else {
    __pyx_t_5 = 'm';
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_v_buf, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":294
 *         buf.write_byte(ctx.output_format)
 *         buf.write_byte(CARDINALITY_ONE if ctx.expect_one else CARDINALITY_MANY)
 *         buf.write_len_prefixed_utf8(ctx.query)             # <<<<<<<<<<<<<<
 * 
 *         state_type_id, state_data = self.encode_state(ctx.state)
 */
  __pyx_t_1 = __pyx_v_ctx->query;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 294, __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;

  /* "gel/protocol/protocol.pyx":296
 *         buf.write_len_prefixed_utf8(ctx.query)
 * 
 *         state_type_id, state_data = self.encode_state(ctx.state)             # <<<<<<<<<<<<<<
 *         buf.write_bytes(state_type_id)
 *         buf.write_bytes(state_data)
 */
  __pyx_t_2 = __pyx_v_ctx->state;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self->__pyx_vtab)->encode_state(__pyx_v_self, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    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(8, 296, __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_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
    index = 0; __pyx_t_2 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_2)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(8, 296, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L7_unpacking_done;
    __pyx_L6_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(8, 296, __pyx_L1_error)
    __pyx_L7_unpacking_done:;
  }
  __pyx_v_state_type_id = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_state_data = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "gel/protocol/protocol.pyx":297
 * 
 *         state_type_id, state_data = self.encode_state(ctx.state)
 *         buf.write_bytes(state_type_id)             # <<<<<<<<<<<<<<
 *         buf.write_bytes(state_data)
 * 
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_state_type_id))||((__pyx_v_state_type_id) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_state_type_id))) __PYX_ERR(8, 297, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_v_state_type_id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":298
 *         state_type_id, state_data = self.encode_state(ctx.state)
 *         buf.write_bytes(state_type_id)
 *         buf.write_bytes(state_data)             # <<<<<<<<<<<<<<
 * 
 *         return buf
 */
  if (!(likely(PyBytes_CheckExact(__pyx_v_state_data))||((__pyx_v_state_data) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_state_data))) __PYX_ERR(8, 298, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_v_state_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":300
 *         buf.write_bytes(state_data)
 * 
 *         return buf             # <<<<<<<<<<<<<<
 * 
 *     async def _parse(self, ctx: ExecuteContext):
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_buf);
  __pyx_r = __pyx_v_buf;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":276
 *                 'the connection has been closed')
 * 
 *     cdef WriteBuffer encode_parse_params(self, ExecuteContext ctx):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.encode_parse_params", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_compilation_flags);
  __Pyx_XDECREF(__pyx_v_state_type_id);
  __Pyx_XDECREF(__pyx_v_state_data);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_24generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":302
 *         return buf
 * 
 *     async def _parse(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf, params
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_23_parse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_23_parse = {"_parse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_23_parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_23_parse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_parse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctx)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 302, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse") < 0)) __PYX_ERR(8, 302, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_ctx = ((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_parse", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 302, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, 0, "ctx", 0))) __PYX_ERR(8, 302, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_22_parse(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_ctx);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_22_parse(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_parse", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_7__parse(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 302, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_ctx = __pyx_v_ctx;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_24generator4, __pyx_codeobj__60, (PyObject *) __pyx_cur_scope, __pyx_n_s_parse, __pyx_n_s_SansIOProtocol__parse, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 302, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_24generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int32_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  char __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  char const *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_UCS4 __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_parse", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 302, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":310
 *             bytes out_type_id
 * 
 *         if not self.connected:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('not connected')
 * 
 */
  __pyx_t_1 = (!__pyx_cur_scope->__pyx_v_self->connected);
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/protocol.pyx":311
 * 
 *         if not self.connected:
 *             raise RuntimeError('not connected')             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(PREPARE_MSG)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 311, __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(8, 311, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":310
 *             bytes out_type_id
 * 
 *         if not self.connected:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('not connected')
 * 
 */
  }

  /* "gel/protocol/protocol.pyx":313
 *             raise RuntimeError('not connected')
 * 
 *         buf = WriteBuffer.new_message(PREPARE_MSG)             # <<<<<<<<<<<<<<
 *         self.write_annotations(ctx, buf)
 * 
 */
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('P')); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/protocol.pyx":314
 * 
 *         buf = WriteBuffer.new_message(PREPARE_MSG)
 *         self.write_annotations(ctx, buf)             # <<<<<<<<<<<<<<
 * 
 *         params = self.encode_parse_params(ctx)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write_annotations(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_ctx, __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol.pyx":316
 *         self.write_annotations(ctx, buf)
 * 
 *         params = self.encode_parse_params(ctx)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_buffer(params)
 */
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->encode_parse_params(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_ctx)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_params = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/protocol.pyx":318
 *         params = self.encode_parse_params(ctx)
 * 
 *         buf.write_buffer(params)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol.pyx":319
 * 
 *         buf.write_buffer(params)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         buf.write_bytes(SYNC_MESSAGE)
 *         self.write(buf)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol.pyx":320
 *         buf.write_buffer(params)
 *         buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *         self.write(buf)
 * 
 */
  __pyx_t_2 = __pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":321
 *         buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)
 *         self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *         exc = None
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":323
 *         self.write(buf)
 * 
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol.pyx":324
 * 
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":325
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_4 == ((int32_t)-1))) __PYX_ERR(8, 325, __pyx_L1_error)
    __pyx_t_1 = (!(__pyx_t_4 != 0));
    if (__pyx_t_1) {

      /* "gel/protocol/protocol.pyx":326
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 326, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 326, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L8_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 326, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 326, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":325
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":327
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 327, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

    /* "gel/protocol/protocol.pyx":329
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == STMT_DATA_DESC_MSG:
 *                     self.parse_describe_type_message(ctx)
 */
    /*try:*/ {

      /* "gel/protocol/protocol.pyx":330
 * 
 *             try:
 *                 if mtype == STMT_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_describe_type_message(ctx)
 * 
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case 'T':

        /* "gel/protocol/protocol.pyx":331
 *             try:
 *                 if mtype == STMT_DATA_DESC_MSG:
 *                     self.parse_describe_type_message(ctx)             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == STATE_DATA_DESC_MSG:
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_describe_type_message(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_ctx); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 331, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":330
 * 
 *             try:
 *                 if mtype == STMT_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_describe_type_message(ctx)
 * 
 */
        break;
        case 's':

        /* "gel/protocol/protocol.pyx":334
 * 
 *                 elif mtype == STATE_DATA_DESC_MSG:
 *                     self.parse_describe_state_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_describe_state_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 334, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":333
 *                     self.parse_describe_type_message(ctx)
 * 
 *                 elif mtype == STATE_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_describe_state_message()
 * 
 */
        break;
        case 'E':

        /* "gel/protocol/protocol.pyx":337
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                     exc._query = ctx.query
 *                     exc = self._amend_parse_error(
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 337, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":338
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 *                     exc._query = ctx.query             # <<<<<<<<<<<<<<
 *                     exc = self._amend_parse_error(
 *                         exc,
 */
        __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->query;
        __Pyx_INCREF(__pyx_t_3);
        if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_exc, __pyx_n_s_query_2, __pyx_t_3) < 0) __PYX_ERR(8, 338, __pyx_L12_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":339
 *                     exc = self.parse_error_message()
 *                     exc._query = ctx.query
 *                     exc = self._amend_parse_error(             # <<<<<<<<<<<<<<
 *                         exc,
 *                         ctx.output_format,
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_amend_parse_error(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_exc, __pyx_cur_scope->__pyx_v_ctx->output_format, __pyx_cur_scope->__pyx_v_ctx->expect_one, __pyx_cur_scope->__pyx_v_ctx->required_one); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 339, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":336
 *                     self.parse_describe_state_message()
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 *                     exc._query = ctx.query
 */
        break;
        case 'Z':

        /* "gel/protocol/protocol.pyx":347
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_sync_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 347, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":348
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
        goto __pyx_L10_break;

        /* "gel/protocol/protocol.pyx":346
 *                     )
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_sync_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol.pyx":351
 * 
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 *             finally:
 *                 self.buffer.finish_message()
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 351, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol.pyx":353
 *                     self.fallthrough()
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L13;
      }
      __pyx_L12_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_16);
        __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
        {
          __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 353, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
        }
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
        __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
        __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
        goto __pyx_L1_error;
        __pyx_L17_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
        }
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L10_break: {
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L6_break;
      }
      __pyx_L13:;
    }
  }
  __pyx_L6_break:;

  /* "gel/protocol/protocol.pyx":355
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/protocol.pyx":356
 * 
 *         if exc is not None:
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *         if ctx.required_one and ctx.has_na_cardinality():
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(8, 356, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":355
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  }

  /* "gel/protocol/protocol.pyx":358
 *             raise exc
 * 
 *         if ctx.required_one and ctx.has_na_cardinality():             # <<<<<<<<<<<<<<
 *             assert ctx.output_format != OutputFormat.NONE
 *             methname = _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]
 */
  if (__pyx_cur_scope->__pyx_v_ctx->required_one) {
  } else {
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_ctx->required_one;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_17 = __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_has_na_cardinality(__pyx_cur_scope->__pyx_v_ctx); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 358, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_17;
  __pyx_L20_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/protocol.pyx":359
 * 
 *         if ctx.required_one and ctx.has_na_cardinality():
 *             assert ctx.output_format != OutputFormat.NONE             # <<<<<<<<<<<<<<
 *             methname = _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]
 *             raise errors.InterfaceError(
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = (__pyx_cur_scope->__pyx_v_ctx->output_format != __pyx_e_3gel_8protocol_8protocol_NONE);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(8, 359, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(8, 359, __pyx_L1_error)
    #endif

    /* "gel/protocol/protocol.pyx":360
 *         if ctx.required_one and ctx.has_na_cardinality():
 *             assert ctx.output_format != OutputFormat.NONE
 *             methname = _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]             # <<<<<<<<<<<<<<
 *             raise errors.InterfaceError(
 *                 f'query cannot be executed with {methname}() as it '
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_SINGLE_METHOD); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_ctx->required_one, int, 1, __Pyx_PyBool_FromLong, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_cur_scope->__pyx_v_ctx->output_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_cur_scope->__pyx_v_methname = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "gel/protocol/protocol.pyx":361
 *             assert ctx.output_format != OutputFormat.NONE
 *             methname = _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]
 *             raise errors.InterfaceError(             # <<<<<<<<<<<<<<
 *                 f'query cannot be executed with {methname}() as it '
 *                 f'does not return any data')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":362
 *             methname = _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]
 *             raise errors.InterfaceError(
 *                 f'query cannot be executed with {methname}() as it '             # <<<<<<<<<<<<<<
 *                 f'does not return any data')
 * 
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_18 = 0;
    __pyx_t_19 = 127;
    __Pyx_INCREF(__pyx_kp_u_query_cannot_be_executed_with);
    __pyx_t_18 += 30;
    __Pyx_GIVEREF(__pyx_kp_u_query_cannot_be_executed_with);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_query_cannot_be_executed_with);
    __pyx_t_20 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_methname, __pyx_empty_unicode); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __pyx_t_19 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_20) > __pyx_t_19) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_20) : __pyx_t_19;
    __pyx_t_18 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_20);
    __Pyx_GIVEREF(__pyx_t_20);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_20);
    __pyx_t_20 = 0;
    __Pyx_INCREF(__pyx_kp_u_as_it_does_not_return_any_data);
    __pyx_t_18 += 33;
    __Pyx_GIVEREF(__pyx_kp_u_as_it_does_not_return_any_data);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_as_it_does_not_return_any_data);
    __pyx_t_20 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_18, __pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 362, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_20);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_20};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 361, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(8, 361, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":358
 *             raise exc
 * 
 *         if ctx.required_one and ctx.has_na_cardinality():             # <<<<<<<<<<<<<<
 *             assert ctx.output_format != OutputFormat.NONE
 *             methname = _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":302
 *         return buf
 * 
 *     async def _parse(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf, params
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_AddTraceback("_parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_27generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":365
 *                 f'does not return any data')
 * 
 *     async def _execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_26_execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_26_execute = {"_execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_26_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_26_execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_execute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctx)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 365, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_execute") < 0)) __PYX_ERR(8, 365, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_ctx = ((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_execute", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 365, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, 0, "ctx", 0))) __PYX_ERR(8, 365, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_25_execute(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_ctx);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_25_execute(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_execute", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_8__execute(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 365, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_ctx = __pyx_v_ctx;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_27generator5, __pyx_codeobj__62, (PyObject *) __pyx_cur_scope, __pyx_n_s_execute, __pyx_n_s_SansIOProtocol__execute, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 365, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_27generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int32_t __pyx_t_5;
  int __pyx_t_6;
  unsigned int __pyx_t_7;
  char __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_t_23;
  char const *__pyx_t_24;
  char const *__pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_execute", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 365, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":373
 *             object result
 * 
 *         params = self.encode_parse_params(ctx)             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(EXECUTE_MSG)
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->encode_parse_params(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_ctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_params = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":375
 *         params = self.encode_parse_params(ctx)
 * 
 *         buf = WriteBuffer.new_message(EXECUTE_MSG)             # <<<<<<<<<<<<<<
 *         self.write_annotations(ctx, buf)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('O')); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":376
 * 
 *         buf = WriteBuffer.new_message(EXECUTE_MSG)
 *         self.write_annotations(ctx, buf)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_buffer(params)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write_annotations(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_ctx, __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":378
 *         self.write_annotations(ctx, buf)
 * 
 *         buf.write_buffer(params)             # <<<<<<<<<<<<<<
 * 
 *         buf.write_bytes(ctx.in_dc.get_tid())
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_buffer(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":380
 *         buf.write_buffer(params)
 * 
 *         buf.write_bytes(ctx.in_dc.get_tid())             # <<<<<<<<<<<<<<
 *         buf.write_bytes(ctx.out_dc.get_tid())
 * 
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_9BaseCodec_get_tid(__pyx_cur_scope->__pyx_v_ctx->in_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 380, __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;

  /* "gel/protocol/protocol.pyx":381
 * 
 *         buf.write_bytes(ctx.in_dc.get_tid())
 *         buf.write_bytes(ctx.out_dc.get_tid())             # <<<<<<<<<<<<<<
 * 
 *         self.encode_args(ctx.in_dc, buf, ctx.args, ctx.kwargs)
 */
  __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol_9BaseCodec_get_tid(__pyx_cur_scope->__pyx_v_ctx->out_dc); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":383
 *         buf.write_bytes(ctx.out_dc.get_tid())
 * 
 *         self.encode_args(ctx.in_dc, buf, ctx.args, ctx.kwargs)             # <<<<<<<<<<<<<<
 * 
 *         buf.end_message()
 */
  __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_ctx->args;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->kwargs;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->encode_args(__pyx_cur_scope->__pyx_v_self, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1), __pyx_cur_scope->__pyx_v_buf, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":385
 *         self.encode_args(ctx.in_dc, buf, ctx.args, ctx.kwargs)
 * 
 *         buf.end_message()             # <<<<<<<<<<<<<<
 * 
 *         packet = WriteBuffer.new()
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":387
 *         buf.end_message()
 * 
 *         packet = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         packet.write_buffer(buf)
 *         packet.write_bytes(SYNC_MESSAGE)
 */
  __pyx_t_4 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_cur_scope->__pyx_v_packet = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":388
 * 
 *         packet = WriteBuffer.new()
 *         packet.write_buffer(buf)             # <<<<<<<<<<<<<<
 *         packet.write_bytes(SYNC_MESSAGE)
 *         self.write(packet)
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_cur_scope->__pyx_v_packet, __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":389
 *         packet = WriteBuffer.new()
 *         packet.write_buffer(buf)
 *         packet.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *         self.write(packet)
 * 
 */
  __pyx_t_4 = __pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_packet, ((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":390
 *         packet.write_buffer(buf)
 *         packet.write_bytes(SYNC_MESSAGE)
 *         self.write(packet)             # <<<<<<<<<<<<<<
 * 
 *         result = []
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_packet); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":392
 *         self.write(packet)
 * 
 *         result = []             # <<<<<<<<<<<<<<
 *         exc = None
 *         while True:
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":393
 * 
 *         result = []
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol.pyx":394
 *         result = []
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":395
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_5 == ((int32_t)-1))) __PYX_ERR(8, 395, __pyx_L1_error)
    __pyx_t_6 = (!(__pyx_t_5 != 0));
    if (__pyx_t_6) {

      /* "gel/protocol/protocol.pyx":396
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 396, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = NULL;
      __pyx_t_7 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 396, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L7_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 396, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 396, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":395
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":397
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_8 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 397, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_8;

    /* "gel/protocol/protocol.pyx":399
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == STMT_DATA_DESC_MSG:
 *                     # our in/out type spec is out-dated
 */
    /*try:*/ {

      /* "gel/protocol/protocol.pyx":400
 * 
 *             try:
 *                 if mtype == STMT_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                     # our in/out type spec is out-dated
 *                     self.parse_describe_type_message(ctx)
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case 'T':

        /* "gel/protocol/protocol.pyx":402
 *                 if mtype == STMT_DATA_DESC_MSG:
 *                     # our in/out type spec is out-dated
 *                     self.parse_describe_type_message(ctx)             # <<<<<<<<<<<<<<
 *                     ctx.store_to_cache()
 * 
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_describe_type_message(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_ctx); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 402, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":403
 *                     # our in/out type spec is out-dated
 *                     self.parse_describe_type_message(ctx)
 *                     ctx.store_to_cache()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == STATE_DATA_DESC_MSG:
 */
        __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_store_to_cache(__pyx_cur_scope->__pyx_v_ctx); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 403, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":400
 * 
 *             try:
 *                 if mtype == STMT_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                     # our in/out type spec is out-dated
 *                     self.parse_describe_type_message(ctx)
 */
        break;
        case 's':

        /* "gel/protocol/protocol.pyx":406
 * 
 *                 elif mtype == STATE_DATA_DESC_MSG:
 *                     self.parse_describe_state_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == DATA_MSG:
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_describe_state_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 406, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":405
 *                     ctx.store_to_cache()
 * 
 *                 elif mtype == STATE_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_describe_state_message()
 * 
 */
        break;
        case 'D':

        /* "gel/protocol/protocol.pyx":409
 * 
 *                 elif mtype == DATA_MSG:
 *                     if exc is None:             # <<<<<<<<<<<<<<
 *                         try:
 *                             self.parse_data_messages(ctx.out_dc, result)
 */
        __pyx_t_6 = (__pyx_cur_scope->__pyx_v_exc == Py_None);
        if (__pyx_t_6) {

          /* "gel/protocol/protocol.pyx":410
 *                 elif mtype == DATA_MSG:
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(ctx.out_dc, result)
 *                         except Exception as ex:
 */
          {
            __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_11);
            /*try:*/ {

              /* "gel/protocol/protocol.pyx":411
 *                     if exc is None:
 *                         try:
 *                             self.parse_data_messages(ctx.out_dc, result)             # <<<<<<<<<<<<<<
 *                         except Exception as ex:
 *                             # An error during data decoding.  We need to
 */
              __pyx_t_3 = ((PyObject *)__pyx_cur_scope->__pyx_v_ctx->out_dc);
              __Pyx_INCREF(__pyx_t_3);
              __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_data_messages(__pyx_cur_scope->__pyx_v_self, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_3), __pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 411, __pyx_L14_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

              /* "gel/protocol/protocol.pyx":410
 *                 elif mtype == DATA_MSG:
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(ctx.out_dc, result)
 *                         except Exception as ex:
 */
            }
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L21_try_end;
            __pyx_L14_error:;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "gel/protocol/protocol.pyx":412
 *                         try:
 *                             self.parse_data_messages(ctx.out_dc, result)
 *                         except Exception as ex:             # <<<<<<<<<<<<<<
 *                             # An error during data decoding.  We need to
 *                             # handle this as gracefully as possible:
 */
            __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
            if (__pyx_t_12) {
              __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(8, 412, __pyx_L16_except_error)
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_3);
              __Pyx_XGOTREF(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_3);
              __pyx_cur_scope->__pyx_v_ex = __pyx_t_3;
              /*try:*/ {

                /* "gel/protocol/protocol.pyx":418
 *                             #   received;
 *                             # * ignore all 'D' messages for this query.
 *                             exc = errors.ClientError(             # <<<<<<<<<<<<<<
 *                                 'unable to decode data to Python objects')
 *                             exc.__cause__ = ex
 */
                __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(8, 418, __pyx_L27_error)
                __Pyx_GOTREF(__pyx_t_13);
                __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_ClientError); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 418, __pyx_L27_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                __pyx_t_13 = NULL;
                __pyx_t_7 = 0;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_14))) {
                  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
                  if (likely(__pyx_t_13)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                    __Pyx_INCREF(__pyx_t_13);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_14, function);
                    __pyx_t_7 = 1;
                  }
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_kp_u_unable_to_decode_data_to_Python};
                  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 418, __pyx_L27_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                }
                __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
                __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_1);
                __Pyx_GIVEREF(__pyx_t_1);
                __pyx_t_1 = 0;

                /* "gel/protocol/protocol.pyx":420
 *                             exc = errors.ClientError(
 *                                 'unable to decode data to Python objects')
 *                             exc.__cause__ = ex             # <<<<<<<<<<<<<<
 *                             # Take care of a partially consumed 'D' message
 *                             # and the ones yet unparsed.
 */
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_exc, __pyx_n_s_cause, __pyx_cur_scope->__pyx_v_ex) < 0) __PYX_ERR(8, 420, __pyx_L27_error)

                /* "gel/protocol/protocol.pyx":423
 *                             # Take care of a partially consumed 'D' message
 *                             # and the ones yet unparsed.
 *                             while self.buffer.take_message_type(DATA_MSG):             # <<<<<<<<<<<<<<
 *                                 self.buffer.discard_message()
 *                     else:
 */
                while (1) {
                  __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message_type(__pyx_cur_scope->__pyx_v_self->buffer, 'D'); if (unlikely(__pyx_t_5 == ((int32_t)-1))) __PYX_ERR(8, 423, __pyx_L27_error)
                  __pyx_t_6 = (__pyx_t_5 != 0);
                  if (!__pyx_t_6) break;

                  /* "gel/protocol/protocol.pyx":424
 *                             # and the ones yet unparsed.
 *                             while self.buffer.take_message_type(DATA_MSG):
 *                                 self.buffer.discard_message()             # <<<<<<<<<<<<<<
 *                     else:
 *                         self.buffer.discard_message()
 */
                  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 424, __pyx_L27_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                }
              }

              /* "gel/protocol/protocol.pyx":412
 *                         try:
 *                             self.parse_data_messages(ctx.out_dc, result)
 *                         except Exception as ex:             # <<<<<<<<<<<<<<
 *                             # An error during data decoding.  We need to
 *                             # handle this as gracefully as possible:
 */
              /*finally:*/ {
                /*normal exit:*/{
                  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
                  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
                  goto __pyx_L28;
                }
                __pyx_L27_error:;
                /*exception exit:*/{
                  __Pyx_PyThreadState_assign
                  __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
                  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
                  __Pyx_XGOTREF(__pyx_t_17);
                  __Pyx_XGOTREF(__pyx_t_18);
                  __Pyx_XGOTREF(__pyx_t_19);
                  __Pyx_XGOTREF(__pyx_t_20);
                  __Pyx_XGOTREF(__pyx_t_21);
                  __Pyx_XGOTREF(__pyx_t_22);
                  __pyx_t_12 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
                  {
                    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
                    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
                  }
                  if (PY_MAJOR_VERSION >= 3) {
                    __Pyx_XGIVEREF(__pyx_t_20);
                    __Pyx_XGIVEREF(__pyx_t_21);
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
                  }
                  __Pyx_XGIVEREF(__pyx_t_17);
                  __Pyx_XGIVEREF(__pyx_t_18);
                  __Pyx_XGIVEREF(__pyx_t_19);
                  __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
                  __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
                  __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
                  goto __pyx_L16_except_error;
                }
                __pyx_L28:;
              }
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              goto __pyx_L15_exception_handled;
            }
            goto __pyx_L16_except_error;

            /* "gel/protocol/protocol.pyx":410
 *                 elif mtype == DATA_MSG:
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(ctx.out_dc, result)
 *                         except Exception as ex:
 */
            __pyx_L16_except_error:;
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            goto __pyx_L11_error;
            __pyx_L15_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            __pyx_L21_try_end:;
          }

          /* "gel/protocol/protocol.pyx":409
 * 
 *                 elif mtype == DATA_MSG:
 *                     if exc is None:             # <<<<<<<<<<<<<<
 *                         try:
 *                             self.parse_data_messages(ctx.out_dc, result)
 */
          goto __pyx_L13;
        }

        /* "gel/protocol/protocol.pyx":426
 *                                 self.buffer.discard_message()
 *                     else:
 *                         self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:
 */
        /*else*/ {
          __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->discard_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 426, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
        __pyx_L13:;

        /* "gel/protocol/protocol.pyx":408
 *                     self.parse_describe_state_message()
 * 
 *                 elif mtype == DATA_MSG:             # <<<<<<<<<<<<<<
 *                     if exc is None:
 *                         try:
 */
        break;
        case 'C':

        /* "gel/protocol/protocol.pyx":429
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:
 *                     self.parse_command_complete_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
        __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_command_complete_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 429, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "gel/protocol/protocol.pyx":428
 *                         self.buffer.discard_message()
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_command_complete_message()
 * 
 */
        break;
        case 'E':

        /* "gel/protocol/protocol.pyx":432
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                     exc._query = ctx.query
 *                     if exc.get_code() == parameter_type_mismatch_code:
 */
        __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 432, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_2);
        __pyx_t_2 = 0;

        /* "gel/protocol/protocol.pyx":433
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 *                     exc._query = ctx.query             # <<<<<<<<<<<<<<
 *                     if exc.get_code() == parameter_type_mismatch_code:
 *                         if not isinstance(ctx.in_dc, NullCodec):
 */
        __pyx_t_2 = __pyx_cur_scope->__pyx_v_ctx->query;
        __Pyx_INCREF(__pyx_t_2);
        if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_exc, __pyx_n_s_query_2, __pyx_t_2) < 0) __PYX_ERR(8, 433, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "gel/protocol/protocol.pyx":434
 *                     exc = self.parse_error_message()
 *                     exc._query = ctx.query
 *                     if exc.get_code() == parameter_type_mismatch_code:             # <<<<<<<<<<<<<<
 *                         if not isinstance(ctx.in_dc, NullCodec):
 *                             buf = WriteBuffer.new()
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_exc, __pyx_n_s_get_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 434, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = NULL;
        __pyx_t_7 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
            __pyx_t_7 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7);
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 434, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_3gel_8protocol_8protocol_parameter_type_mismatch_code, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 434, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(8, 434, __pyx_L11_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (__pyx_t_6) {

          /* "gel/protocol/protocol.pyx":435
 *                     exc._query = ctx.query
 *                     if exc.get_code() == parameter_type_mismatch_code:
 *                         if not isinstance(ctx.in_dc, NullCodec):             # <<<<<<<<<<<<<<
 *                             buf = WriteBuffer.new()
 *                             try:
 */
          __pyx_t_3 = ((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
          __Pyx_INCREF(__pyx_t_3);
          __pyx_t_6 = __Pyx_TypeCheck(__pyx_t_3, __pyx_ptype_3gel_8protocol_8protocol_NullCodec); 
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_23 = (!__pyx_t_6);
          if (__pyx_t_23) {

            /* "gel/protocol/protocol.pyx":436
 *                     if exc.get_code() == parameter_type_mismatch_code:
 *                         if not isinstance(ctx.in_dc, NullCodec):
 *                             buf = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *                             try:
 *                                 self.encode_args(
 */
            __pyx_t_3 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 436, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_buf);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_buf, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3));
            __Pyx_GIVEREF(__pyx_t_3);
            __pyx_t_3 = 0;

            /* "gel/protocol/protocol.pyx":437
 *                         if not isinstance(ctx.in_dc, NullCodec):
 *                             buf = WriteBuffer.new()
 *                             try:             # <<<<<<<<<<<<<<
 *                                 self.encode_args(
 *                                     ctx.in_dc, buf, ctx.args, ctx.kwargs
 */
            /*try:*/ {
              {
                __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_10);
                __Pyx_XGOTREF(__pyx_t_9);
                /*try:*/ {

                  /* "gel/protocol/protocol.pyx":439
 *                             try:
 *                                 self.encode_args(
 *                                     ctx.in_dc, buf, ctx.args, ctx.kwargs             # <<<<<<<<<<<<<<
 *                                 )
 *                             except errors.QueryArgumentError as ex:
 */
                  __pyx_t_3 = ((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
                  __Pyx_INCREF(__pyx_t_3);
                  __pyx_t_2 = __pyx_cur_scope->__pyx_v_ctx->args;
                  __Pyx_INCREF(__pyx_t_2);
                  __pyx_t_4 = __pyx_cur_scope->__pyx_v_ctx->kwargs;
                  __Pyx_INCREF(__pyx_t_4);

                  /* "gel/protocol/protocol.pyx":438
 *                             buf = WriteBuffer.new()
 *                             try:
 *                                 self.encode_args(             # <<<<<<<<<<<<<<
 *                                     ctx.in_dc, buf, ctx.args, ctx.kwargs
 *                                 )
 */
                  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->encode_args(__pyx_cur_scope->__pyx_v_self, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_3), __pyx_cur_scope->__pyx_v_buf, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 438, __pyx_L42_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

                  /* "gel/protocol/protocol.pyx":437
 *                         if not isinstance(ctx.in_dc, NullCodec):
 *                             buf = WriteBuffer.new()
 *                             try:             # <<<<<<<<<<<<<<
 *                                 self.encode_args(
 *                                     ctx.in_dc, buf, ctx.args, ctx.kwargs
 */
                }
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
                goto __pyx_L49_try_end;
                __pyx_L42_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

                /* "gel/protocol/protocol.pyx":441
 *                                     ctx.in_dc, buf, ctx.args, ctx.kwargs
 *                                 )
 *                             except errors.QueryArgumentError as ex:             # <<<<<<<<<<<<<<
 *                                 exc = ex
 *                             finally:
 */
                __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_4, &__pyx_t_2);
                __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 441, __pyx_L44_except_error)
                __Pyx_GOTREF(__pyx_t_3);
                __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_QueryArgumentError); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 441, __pyx_L44_except_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __pyx_t_15 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_14);
                __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_ErrRestore(__pyx_t_1, __pyx_t_4, __pyx_t_2);
                __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0;
                if (__pyx_t_15) {
                  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(8, 441, __pyx_L44_except_error)
                  __Pyx_XGOTREF(__pyx_t_2);
                  __Pyx_XGOTREF(__pyx_t_4);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __Pyx_INCREF(__pyx_t_4);
                  __Pyx_GIVEREF(__pyx_t_4);
                  __pyx_cur_scope->__pyx_v_ex = __pyx_t_4;
                  /*try:*/ {

                    /* "gel/protocol/protocol.pyx":442
 *                                 )
 *                             except errors.QueryArgumentError as ex:
 *                                 exc = ex             # <<<<<<<<<<<<<<
 *                             finally:
 *                                 buf = None
 */
                    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_ex);
                    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
                    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_cur_scope->__pyx_v_ex);
                    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ex);
                  }

                  /* "gel/protocol/protocol.pyx":441
 *                                     ctx.in_dc, buf, ctx.args, ctx.kwargs
 *                                 )
 *                             except errors.QueryArgumentError as ex:             # <<<<<<<<<<<<<<
 *                                 exc = ex
 *                             finally:
 */
                  /*finally:*/ {
                    /*normal exit:*/{
                      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
                      __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
                      goto __pyx_L56;
                    }
                    __pyx_L56:;
                  }
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  goto __pyx_L43_exception_handled;
                }
                goto __pyx_L44_except_error;

                /* "gel/protocol/protocol.pyx":437
 *                         if not isinstance(ctx.in_dc, NullCodec):
 *                             buf = WriteBuffer.new()
 *                             try:             # <<<<<<<<<<<<<<
 *                                 self.encode_args(
 *                                     ctx.in_dc, buf, ctx.args, ctx.kwargs
 */
                __pyx_L44_except_error:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_9);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
                goto __pyx_L40_error;
                __pyx_L43_exception_handled:;
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_9);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
                __pyx_L49_try_end:;
              }
            }

            /* "gel/protocol/protocol.pyx":444
 *                                 exc = ex
 *                             finally:
 *                                 buf = None             # <<<<<<<<<<<<<<
 *                     else:
 *                         exc = self._amend_parse_error(
 */
            /*finally:*/ {
              /*normal exit:*/{
                __Pyx_INCREF(Py_None);
                __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_buf);
                __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_buf, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)Py_None));
                __Pyx_GIVEREF(Py_None);
                goto __pyx_L41;
              }
              __pyx_L40_error:;
              /*exception exit:*/{
                __Pyx_PyThreadState_assign
                __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
                if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_9);
                __Pyx_XGOTREF(__pyx_t_10);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_22);
                __Pyx_XGOTREF(__pyx_t_21);
                __Pyx_XGOTREF(__pyx_t_20);
                __pyx_t_15 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_24 = __pyx_filename;
                {
                  __Pyx_INCREF(Py_None);
                  __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_buf);
                  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_buf, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)Py_None));
                  __Pyx_GIVEREF(Py_None);
                }
                if (PY_MAJOR_VERSION >= 3) {
                  __Pyx_XGIVEREF(__pyx_t_22);
                  __Pyx_XGIVEREF(__pyx_t_21);
                  __Pyx_XGIVEREF(__pyx_t_20);
                  __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20);
                }
                __Pyx_XGIVEREF(__pyx_t_9);
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
                __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0;
                __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_24;
                goto __pyx_L11_error;
              }
              __pyx_L41:;
            }

            /* "gel/protocol/protocol.pyx":435
 *                     exc._query = ctx.query
 *                     if exc.get_code() == parameter_type_mismatch_code:
 *                         if not isinstance(ctx.in_dc, NullCodec):             # <<<<<<<<<<<<<<
 *                             buf = WriteBuffer.new()
 *                             try:
 */
          }

          /* "gel/protocol/protocol.pyx":434
 *                     exc = self.parse_error_message()
 *                     exc._query = ctx.query
 *                     if exc.get_code() == parameter_type_mismatch_code:             # <<<<<<<<<<<<<<
 *                         if not isinstance(ctx.in_dc, NullCodec):
 *                             buf = WriteBuffer.new()
 */
          goto __pyx_L35;
        }

        /* "gel/protocol/protocol.pyx":446
 *                                 buf = None
 *                     else:
 *                         exc = self._amend_parse_error(             # <<<<<<<<<<<<<<
 *                             exc,
 *                             ctx.output_format,
 */
        /*else*/ {

          /* "gel/protocol/protocol.pyx":450
 *                             ctx.output_format,
 *                             ctx.expect_one,
 *                             ctx.required_one,             # <<<<<<<<<<<<<<
 *                         )
 * 
 */
          __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_amend_parse_error(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_exc, __pyx_cur_scope->__pyx_v_ctx->output_format, __pyx_cur_scope->__pyx_v_ctx->expect_one, __pyx_cur_scope->__pyx_v_ctx->required_one); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 446, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_1);
          __pyx_t_1 = 0;
        }
        __pyx_L35:;

        /* "gel/protocol/protocol.pyx":431
 *                     self.parse_command_complete_message()
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 *                     exc._query = ctx.query
 */
        break;
        case 'Z':

        /* "gel/protocol/protocol.pyx":454
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_sync_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 454, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "gel/protocol/protocol.pyx":455
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
        goto __pyx_L9_break;

        /* "gel/protocol/protocol.pyx":453
 *                         )
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_sync_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol.pyx":458
 * 
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *             finally:
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 458, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol.pyx":461
 * 
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 461, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L12;
      }
      __pyx_L11_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22) < 0)) __Pyx_ErrFetch(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
        __Pyx_XGOTREF(__pyx_t_20);
        __Pyx_XGOTREF(__pyx_t_21);
        __Pyx_XGOTREF(__pyx_t_22);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        __pyx_t_12 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_25 = __pyx_filename;
        {
          __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 461, __pyx_L64_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        }
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_XGIVEREF(__pyx_t_22);
        __Pyx_ErrRestore(__pyx_t_20, __pyx_t_21, __pyx_t_22);
        __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
        __pyx_lineno = __pyx_t_12; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_25;
        goto __pyx_L1_error;
        __pyx_L64_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
        }
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
        __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L9_break: {
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 461, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L5_break;
      }
      __pyx_L12:;
    }
  }
  __pyx_L5_break:;

  /* "gel/protocol/protocol.pyx":463
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 *         else:
 */
  __pyx_t_23 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_23)) {

    /* "gel/protocol/protocol.pyx":464
 * 
 *         if exc is not None:
 *             raise exc             # <<<<<<<<<<<<<<
 *         else:
 *             return result
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(8, 464, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":463
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 *         else:
 */
  }

  /* "gel/protocol/protocol.pyx":466
 *             raise exc
 *         else:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     cdef encode_state(self, state):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_result);
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":365
 *                 f'does not return any data')
 * 
 *     async def _execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":468
 *             return result
 * 
 *     cdef encode_state(self, state):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_state(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_state) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf = 0;
  PyObject *__pyx_v_state_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_state", 1);

  /* "gel/protocol/protocol.pyx":471
 *         cdef WriteBuffer buf
 * 
 *         if state is not None:             # <<<<<<<<<<<<<<
 *             if self.state_cache[0] is state:
 *                 state_data = self.state_cache[1]
 */
  __pyx_t_1 = (__pyx_v_state != Py_None);
  if (__pyx_t_1) {

    /* "gel/protocol/protocol.pyx":472
 * 
 *         if state is not None:
 *             if self.state_cache[0] is state:             # <<<<<<<<<<<<<<
 *                 state_data = self.state_cache[1]
 *             else:
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->state_cache, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = (__pyx_t_2 == __pyx_v_state);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "gel/protocol/protocol.pyx":473
 *         if state is not None:
 *             if self.state_cache[0] is state:
 *                 state_data = self.state_cache[1]             # <<<<<<<<<<<<<<
 *             else:
 *                 assert self.state_codec is not None
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->state_cache, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_state_data = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "gel/protocol/protocol.pyx":472
 * 
 *         if state is not None:
 *             if self.state_cache[0] is state:             # <<<<<<<<<<<<<<
 *                 state_data = self.state_cache[1]
 *             else:
 */
      goto __pyx_L4;
    }

    /* "gel/protocol/protocol.pyx":475
 *                 state_data = self.state_cache[1]
 *             else:
 *                 assert self.state_codec is not None             # <<<<<<<<<<<<<<
 *                 buf = WriteBuffer.new()
 *                 self.state_codec.encode(buf, state)
 */
    /*else*/ {
      #ifndef CYTHON_WITHOUT_ASSERTIONS
      if (unlikely(__pyx_assertions_enabled())) {
        __pyx_t_1 = (((PyObject *)__pyx_v_self->state_codec) != Py_None);
        if (unlikely(!__pyx_t_1)) {
          __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
          __PYX_ERR(8, 475, __pyx_L1_error)
        }
      }
      #else
      if ((1)); else __PYX_ERR(8, 475, __pyx_L1_error)
      #endif

      /* "gel/protocol/protocol.pyx":476
 *             else:
 *                 assert self.state_codec is not None
 *                 buf = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *                 self.state_codec.encode(buf, state)
 *                 state_data = bytes(buf)
 */
      __pyx_t_2 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "gel/protocol/protocol.pyx":477
 *                 assert self.state_codec is not None
 *                 buf = WriteBuffer.new()
 *                 self.state_codec.encode(buf, state)             # <<<<<<<<<<<<<<
 *                 state_data = bytes(buf)
 *                 self.state_cache = (state, state_data)
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_self->state_codec->__pyx_vtab)->encode(__pyx_v_self->state_codec, __pyx_v_buf, __pyx_v_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "gel/protocol/protocol.pyx":478
 *                 buf = WriteBuffer.new()
 *                 self.state_codec.encode(buf, state)
 *                 state_data = bytes(buf)             # <<<<<<<<<<<<<<
 *                 self.state_cache = (state, state_data)
 *             return self.state_type_id, state_data
 */
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), ((PyObject *)__pyx_v_buf)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 478, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_state_data = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "gel/protocol/protocol.pyx":479
 *                 self.state_codec.encode(buf, state)
 *                 state_data = bytes(buf)
 *                 self.state_cache = (state, state_data)             # <<<<<<<<<<<<<<
 *             return self.state_type_id, state_data
 *         else:
 */
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_state);
      __Pyx_GIVEREF(__pyx_v_state);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_state)) __PYX_ERR(8, 479, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_state_data);
      __Pyx_GIVEREF(__pyx_v_state_data);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_state_data)) __PYX_ERR(8, 479, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->state_cache);
      __Pyx_DECREF(__pyx_v_self->state_cache);
      __pyx_v_self->state_cache = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L4:;

    /* "gel/protocol/protocol.pyx":480
 *                 state_data = bytes(buf)
 *                 self.state_cache = (state, state_data)
 *             return self.state_type_id, state_data             # <<<<<<<<<<<<<<
 *         else:
 *             return NULL_CODEC_ID, EMPTY_NULL_DATA
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_self->state_type_id);
    __Pyx_GIVEREF(__pyx_v_self->state_type_id);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->state_type_id)) __PYX_ERR(8, 480, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state_data);
    __Pyx_GIVEREF(__pyx_v_state_data);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_state_data)) __PYX_ERR(8, 480, __pyx_L1_error);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "gel/protocol/protocol.pyx":471
 *         cdef WriteBuffer buf
 * 
 *         if state is not None:             # <<<<<<<<<<<<<<
 *             if self.state_cache[0] is state:
 *                 state_data = self.state_cache[1]
 */
  }

  /* "gel/protocol/protocol.pyx":482
 *             return self.state_type_id, state_data
 *         else:
 *             return NULL_CODEC_ID, EMPTY_NULL_DATA             # <<<<<<<<<<<<<<
 * 
 *     async def execute(self, ctx: ExecuteContext):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_EMPTY_NULL_DATA); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID);
    __Pyx_GIVEREF(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID)) __PYX_ERR(8, 482, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_2);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(8, 482, __pyx_L1_error);
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "gel/protocol/protocol.pyx":468
 *             return result
 * 
 *     cdef encode_state(self, state):             # <<<<<<<<<<<<<<
 *         cdef WriteBuffer buf
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.encode_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_state_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_30generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":484
 *             return NULL_CODEC_ID, EMPTY_NULL_DATA
 * 
 *     async def execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         self.ensure_connected()
 *         self.reset_status()
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_29execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_29execute = {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_29execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_29execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctx)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 484, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "execute") < 0)) __PYX_ERR(8, 484, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_ctx = ((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 484, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, 0, "ctx", 0))) __PYX_ERR(8, 484, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_28execute(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_ctx);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_28execute(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("execute", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_9_execute(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 484, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_ctx = __pyx_v_ctx;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_30generator6, __pyx_codeobj__63, (PyObject *) __pyx_cur_scope, __pyx_n_s_execute_2, __pyx_n_s_SansIOProtocol_execute, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 484, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_30generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  unsigned int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_await;
    case 2: goto __pyx_L9_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 484, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":485
 * 
 *     async def execute(self, ctx: ExecuteContext):
 *         self.ensure_connected()             # <<<<<<<<<<<<<<
 *         self.reset_status()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->ensure_connected(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":486
 *     async def execute(self, ctx: ExecuteContext):
 *         self.ensure_connected()
 *         self.reset_status()             # <<<<<<<<<<<<<<
 * 
 *         if ctx.load_from_cache():
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->reset_status(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":488
 *         self.reset_status()
 * 
 *         if ctx.load_from_cache():             # <<<<<<<<<<<<<<
 *             pass
 *         elif not ctx.args and not ctx.kwargs and not ctx.required_one:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_ExecuteContext *)__pyx_cur_scope->__pyx_v_ctx->__pyx_vtab)->load_from_cache(__pyx_cur_scope->__pyx_v_ctx); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 488, __pyx_L1_error)
  if (__pyx_t_2) {
    goto __pyx_L4;
  }

  /* "gel/protocol/protocol.pyx":490
 *         if ctx.load_from_cache():
 *             pass
 *         elif not ctx.args and not ctx.kwargs and not ctx.required_one:             # <<<<<<<<<<<<<<
 *             # We don't have knowledge about the in/out desc of the command, but
 *             # the caller didn't provide any arguments, so let's try using NULL
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ctx->args); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(8, 490, __pyx_L1_error)
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ctx->kwargs); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 490, __pyx_L1_error)
  __pyx_t_3 = (!__pyx_t_4);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_3 = (!__pyx_cur_scope->__pyx_v_ctx->required_one);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "gel/protocol/protocol.pyx":497
 *             # it'll be too late to find out the cardinality is wrong when the
 *             # command is already executed.
 *             ctx.in_dc = ctx.out_dc = NULL_CODEC             # <<<<<<<<<<<<<<
 *         else:
 *             await self._parse(ctx)
 */
    __Pyx_INCREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_NULL_CODEC);
    __Pyx_GIVEREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_NULL_CODEC);
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
    __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
    __pyx_cur_scope->__pyx_v_ctx->in_dc = __pyx_v_3gel_8protocol_8protocol_NULL_CODEC;
    __Pyx_INCREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_NULL_CODEC);
    __Pyx_GIVEREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_NULL_CODEC);
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->out_dc);
    __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->out_dc);
    __pyx_cur_scope->__pyx_v_ctx->out_dc = __pyx_v_3gel_8protocol_8protocol_NULL_CODEC;

    /* "gel/protocol/protocol.pyx":490
 *         if ctx.load_from_cache():
 *             pass
 *         elif not ctx.args and not ctx.kwargs and not ctx.required_one:             # <<<<<<<<<<<<<<
 *             # We don't have knowledge about the in/out desc of the command, but
 *             # the caller didn't provide any arguments, so let's try using NULL
 */
    goto __pyx_L4;
  }

  /* "gel/protocol/protocol.pyx":499
 *             ctx.in_dc = ctx.out_dc = NULL_CODEC
 *         else:
 *             await self._parse(ctx)             # <<<<<<<<<<<<<<
 *             ctx.store_to_cache()
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_parse); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_cur_scope->__pyx_v_ctx)};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L8_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 499, __pyx_L1_error)
    } else {
      PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (exc_type) {
        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
        else __PYX_ERR(8, 499, __pyx_L1_error)
      }
    }

    /* "gel/protocol/protocol.pyx":500
 *         else:
 *             await self._parse(ctx)
 *             ctx.store_to_cache()             # <<<<<<<<<<<<<<
 * 
 *         return await self._execute(ctx)
 */
    __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_store_to_cache(__pyx_cur_scope->__pyx_v_ctx); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "gel/protocol/protocol.pyx":502
 *             ctx.store_to_cache()
 * 
 *         return await self._execute(ctx)             # <<<<<<<<<<<<<<
 * 
 *     async def query(self, ctx: ExecuteContext):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_execute); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_cur_scope->__pyx_v_ctx)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XGOTREF(__pyx_r);
  if (likely(__pyx_r)) {
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, awaiting value */
    __pyx_generator->resume_label = 2;
    return __pyx_r;
    __pyx_L9_resume_from_await:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 502, __pyx_L1_error)
    __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1);
  } else {
    __pyx_t_1 = NULL;
    if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(8, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":484
 *             return NULL_CODEC_ID, EMPTY_NULL_DATA
 * 
 *     async def execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         self.ensure_connected()
 *         self.reset_status()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_33generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":504
 *         return await self._execute(ctx)
 * 
 *     async def query(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_32query(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_32query = {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_32query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_32query(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("query (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctx)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 504, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "query") < 0)) __PYX_ERR(8, 504, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_ctx = ((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("query", 1, 1, 1, __pyx_nargs); __PYX_ERR(8, 504, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, 0, "ctx", 0))) __PYX_ERR(8, 504, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_31query(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_ctx);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_31query(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("query", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_10_query(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 504, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_ctx = __pyx_v_ctx;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_33generator7, __pyx_codeobj__64, (PyObject *) __pyx_cur_scope, __pyx_n_s_query, __pyx_n_s_SansIOProtocol_query, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 504, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_33generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("query", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 504, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":505
 * 
 *     async def query(self, ctx: ExecuteContext):
 *         ret = await self.execute(ctx)             # <<<<<<<<<<<<<<
 *         if ctx.expect_one:
 *             if ret or not ctx.required_one:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_execute_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_ctx)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XGOTREF(__pyx_r);
  if (likely(__pyx_r)) {
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, awaiting value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L4_resume_from_await:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 505, __pyx_L1_error)
    __pyx_t_1 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_1);
  } else {
    __pyx_t_1 = NULL;
    if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_1) < 0) __PYX_ERR(8, 505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_ret = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":506
 *     async def query(self, ctx: ExecuteContext):
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:             # <<<<<<<<<<<<<<
 *             if ret or not ctx.required_one:
 *                 if ret:
 */
  if (__pyx_cur_scope->__pyx_v_ctx->expect_one) {

    /* "gel/protocol/protocol.pyx":507
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:
 *             if ret or not ctx.required_one:             # <<<<<<<<<<<<<<
 *                 if ret:
 *                     return ret[0]
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ret); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(8, 507, __pyx_L1_error)
    if (!__pyx_t_6) {
    } else {
      __pyx_t_5 = __pyx_t_6;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_6 = (!__pyx_cur_scope->__pyx_v_ctx->required_one);
    __pyx_t_5 = __pyx_t_6;
    __pyx_L7_bool_binop_done:;
    if (likely(__pyx_t_5)) {

      /* "gel/protocol/protocol.pyx":508
 *         if ctx.expect_one:
 *             if ret or not ctx.required_one:
 *                 if ret:             # <<<<<<<<<<<<<<
 *                     return ret[0]
 *                 else:
 */
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ret); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(8, 508, __pyx_L1_error)
      if (__pyx_t_5) {

        /* "gel/protocol/protocol.pyx":509
 *             if ret or not ctx.required_one:
 *                 if ret:
 *                     return ret[0]             # <<<<<<<<<<<<<<
 *                 else:
 *                     if ctx.output_format == OutputFormat.JSON:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 509, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;

        /* "gel/protocol/protocol.pyx":508
 *         if ctx.expect_one:
 *             if ret or not ctx.required_one:
 *                 if ret:             # <<<<<<<<<<<<<<
 *                     return ret[0]
 *                 else:
 */
      }

      /* "gel/protocol/protocol.pyx":511
 *                     return ret[0]
 *                 else:
 *                     if ctx.output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                         return 'null'
 *                     else:
 */
      /*else*/ {
        __pyx_t_5 = (__pyx_cur_scope->__pyx_v_ctx->output_format == __pyx_e_3gel_8protocol_8protocol_JSON);
        if (__pyx_t_5) {

          /* "gel/protocol/protocol.pyx":512
 *                 else:
 *                     if ctx.output_format == OutputFormat.JSON:
 *                         return 'null'             # <<<<<<<<<<<<<<
 *                     else:
 *                         return None
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_n_u_null);
          goto __pyx_L0;

          /* "gel/protocol/protocol.pyx":511
 *                     return ret[0]
 *                 else:
 *                     if ctx.output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                         return 'null'
 *                     else:
 */
        }

        /* "gel/protocol/protocol.pyx":514
 *                         return 'null'
 *                     else:
 *                         return None             # <<<<<<<<<<<<<<
 *             else:
 *                 methname = (
 */
        /*else*/ {
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = NULL;
          goto __pyx_L0;
        }
      }

      /* "gel/protocol/protocol.pyx":507
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:
 *             if ret or not ctx.required_one:             # <<<<<<<<<<<<<<
 *                 if ret:
 *                     return ret[0]
 */
    }

    /* "gel/protocol/protocol.pyx":516
 *                         return None
 *             else:
 *                 methname = (             # <<<<<<<<<<<<<<
 *                     _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]
 *                 )
 */
    /*else*/ {

      /* "gel/protocol/protocol.pyx":517
 *             else:
 *                 methname = (
 *                     _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]             # <<<<<<<<<<<<<<
 *                 )
 *                 raise errors.NoDataError(
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_QUERY_SINGLE_METHOD); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_ctx->required_one, int, 1, __Pyx_PyBool_FromLong, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_cur_scope->__pyx_v_ctx->output_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_v_methname = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "gel/protocol/protocol.pyx":519
 *                     _QUERY_SINGLE_METHOD[ctx.required_one][ctx.output_format]
 *                 )
 *                 raise errors.NoDataError(             # <<<<<<<<<<<<<<
 *                     f'query executed via {methname}() returned no data')
 *         else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_NoDataError); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":520
 *                 )
 *                 raise errors.NoDataError(
 *                     f'query executed via {methname}() returned no data')             # <<<<<<<<<<<<<<
 *         else:
 *             if ret:
 */
      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = 0;
      __pyx_t_8 = 127;
      __Pyx_INCREF(__pyx_kp_u_query_executed_via);
      __pyx_t_7 += 19;
      __Pyx_GIVEREF(__pyx_kp_u_query_executed_via);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_query_executed_via);
      __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_methname, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8;
      __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_INCREF(__pyx_kp_u_returned_no_data);
      __pyx_t_7 += 19;
      __Pyx_GIVEREF(__pyx_kp_u_returned_no_data);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_returned_no_data);
      __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_9};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 519, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(8, 519, __pyx_L1_error)
    }

    /* "gel/protocol/protocol.pyx":506
 *     async def query(self, ctx: ExecuteContext):
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:             # <<<<<<<<<<<<<<
 *             if ret or not ctx.required_one:
 *                 if ret:
 */
  }

  /* "gel/protocol/protocol.pyx":522
 *                     f'query executed via {methname}() returned no data')
 *         else:
 *             if ret:             # <<<<<<<<<<<<<<
 *                 if ctx.output_format == OutputFormat.JSON:
 *                     return ret[0]
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ret); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(8, 522, __pyx_L1_error)
    if (__pyx_t_5) {

      /* "gel/protocol/protocol.pyx":523
 *         else:
 *             if ret:
 *                 if ctx.output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                     return ret[0]
 *                 else:
 */
      __pyx_t_5 = (__pyx_cur_scope->__pyx_v_ctx->output_format == __pyx_e_3gel_8protocol_8protocol_JSON);
      if (__pyx_t_5) {

        /* "gel/protocol/protocol.pyx":524
 *             if ret:
 *                 if ctx.output_format == OutputFormat.JSON:
 *                     return ret[0]             # <<<<<<<<<<<<<<
 *                 else:
 *                     return ret
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 524, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L0;

        /* "gel/protocol/protocol.pyx":523
 *         else:
 *             if ret:
 *                 if ctx.output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                     return ret[0]
 *                 else:
 */
      }

      /* "gel/protocol/protocol.pyx":526
 *                     return ret[0]
 *                 else:
 *                     return ret             # <<<<<<<<<<<<<<
 *             else:
 *                 if ctx.output_format == OutputFormat.JSON:
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_ret);
        goto __pyx_L0;
      }

      /* "gel/protocol/protocol.pyx":522
 *                     f'query executed via {methname}() returned no data')
 *         else:
 *             if ret:             # <<<<<<<<<<<<<<
 *                 if ctx.output_format == OutputFormat.JSON:
 *                     return ret[0]
 */
    }

    /* "gel/protocol/protocol.pyx":528
 *                     return ret
 *             else:
 *                 if ctx.output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                     return '[]'
 *                 else:
 */
    /*else*/ {
      __pyx_t_5 = (__pyx_cur_scope->__pyx_v_ctx->output_format == __pyx_e_3gel_8protocol_8protocol_JSON);
      if (__pyx_t_5) {

        /* "gel/protocol/protocol.pyx":529
 *             else:
 *                 if ctx.output_format == OutputFormat.JSON:
 *                     return '[]'             # <<<<<<<<<<<<<<
 *                 else:
 *                     return ret
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_kp_u__65);
        goto __pyx_L0;

        /* "gel/protocol/protocol.pyx":528
 *                     return ret
 *             else:
 *                 if ctx.output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                     return '[]'
 *                 else:
 */
      }

      /* "gel/protocol/protocol.pyx":531
 *                     return '[]'
 *                 else:
 *                     return ret             # <<<<<<<<<<<<<<
 * 
 *     async def dump(self, header_callback, block_callback):
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_ret);
        goto __pyx_L0;
      }
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":504
 *         return await self._execute(ctx)
 * 
 *     async def query(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_36generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":533
 *                     return ret
 * 
 *     async def dump(self, header_callback, block_callback):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_35dump(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_35dump = {"dump", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_35dump, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_35dump(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_header_callback = 0;
  PyObject *__pyx_v_block_callback = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dump (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_header_callback,&__pyx_n_s_block_callback,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header_callback)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 533, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_block_callback)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 533, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("dump", 1, 2, 2, 1); __PYX_ERR(8, 533, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "dump") < 0)) __PYX_ERR(8, 533, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_header_callback = values[0];
    __pyx_v_block_callback = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dump", 1, 2, 2, __pyx_nargs); __PYX_ERR(8, 533, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_34dump(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_header_callback, __pyx_v_block_callback);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_34dump(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_header_callback, PyObject *__pyx_v_block_callback) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("dump", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_11_dump(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 533, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_header_callback = __pyx_v_header_callback;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_header_callback);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_header_callback);
  __pyx_cur_scope->__pyx_v_block_callback = __pyx_v_block_callback;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_block_callback);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_block_callback);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_36generator8, __pyx_codeobj__66, (PyObject *) __pyx_cur_scope, __pyx_n_s_dump, __pyx_n_s_SansIOProtocol_dump, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 533, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_36generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int32_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  char __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dump", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_await;
    case 2: goto __pyx_L15_resume_from_await;
    case 3: goto __pyx_L18_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 533, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":538
 *             char mtype
 * 
 *         self.ensure_connected()             # <<<<<<<<<<<<<<
 *         self.reset_status()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->ensure_connected(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":539
 * 
 *         self.ensure_connected()
 *         self.reset_status()             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(DUMP_MSG)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->reset_status(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":541
 *         self.reset_status()
 * 
 *         buf = WriteBuffer.new_message(DUMP_MSG)             # <<<<<<<<<<<<<<
 *         if self.protocol_version >= (3, 0):
 *             buf.write_int16(0)  # no annotations
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('>')); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":542
 * 
 *         buf = WriteBuffer.new_message(DUMP_MSG)
 *         if self.protocol_version >= (3, 0):             # <<<<<<<<<<<<<<
 *             buf.write_int16(0)  # no annotations
 *             buf.write_int64(0)  # flags
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_self->protocol_version, __pyx_tuple__54, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 542, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "gel/protocol/protocol.pyx":543
 *         buf = WriteBuffer.new_message(DUMP_MSG)
 *         if self.protocol_version >= (3, 0):
 *             buf.write_int16(0)  # no annotations             # <<<<<<<<<<<<<<
 *             buf.write_int64(0)  # flags
 *             buf.end_message()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":544
 *         if self.protocol_version >= (3, 0):
 *             buf.write_int16(0)  # no annotations
 *             buf.write_int64(0)  # flags             # <<<<<<<<<<<<<<
 *             buf.end_message()
 *         else:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_int64(__pyx_cur_scope->__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":545
 *             buf.write_int16(0)  # no annotations
 *             buf.write_int64(0)  # flags
 *             buf.end_message()             # <<<<<<<<<<<<<<
 *         else:
 *             buf.write_int16(0)  # no headers
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":542
 * 
 *         buf = WriteBuffer.new_message(DUMP_MSG)
 *         if self.protocol_version >= (3, 0):             # <<<<<<<<<<<<<<
 *             buf.write_int16(0)  # no annotations
 *             buf.write_int64(0)  # flags
 */
    goto __pyx_L4;
  }

  /* "gel/protocol/protocol.pyx":547
 *             buf.end_message()
 *         else:
 *             buf.write_int16(0)  # no headers             # <<<<<<<<<<<<<<
 *             buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)
 */
  /*else*/ {
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":548
 *         else:
 *             buf.write_int16(0)  # no headers
 *             buf.end_message()             # <<<<<<<<<<<<<<
 *         buf.write_bytes(SYNC_MESSAGE)
 *         self.write(buf)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "gel/protocol/protocol.pyx":549
 *             buf.write_int16(0)  # no headers
 *             buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *         self.write(buf)
 * 
 */
  __pyx_t_1 = __pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":550
 *             buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)
 *         self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *         header_received = False
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":552
 *         self.write(buf)
 * 
 *         header_received = False             # <<<<<<<<<<<<<<
 *         data_received = False
 *         exc = None
 */
  __pyx_cur_scope->__pyx_v_header_received = 0;

  /* "gel/protocol/protocol.pyx":553
 * 
 *         header_received = False
 *         data_received = False             # <<<<<<<<<<<<<<
 *         exc = None
 *         while True:
 */
  __pyx_cur_scope->__pyx_v_data_received = 0;

  /* "gel/protocol/protocol.pyx":554
 *         header_received = False
 *         data_received = False
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol.pyx":555
 *         data_received = False
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":556
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_4 == ((int32_t)-1))) __PYX_ERR(8, 556, __pyx_L1_error)
    __pyx_t_2 = (!(__pyx_t_4 != 0));
    if (__pyx_t_2) {

      /* "gel/protocol/protocol.pyx":557
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 557, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L8_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 557, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 557, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":556
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":558
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 558, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

    /* "gel/protocol/protocol.pyx":560
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == DUMP_BLOCK_MSG:
 *                     if not header_received:
 */
    /*try:*/ {

      /* "gel/protocol/protocol.pyx":561
 * 
 *             try:
 *                 if mtype == DUMP_BLOCK_MSG:             # <<<<<<<<<<<<<<
 *                     if not header_received:
 *                         raise RuntimeError('data block before header block')
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case '=':

        /* "gel/protocol/protocol.pyx":562
 *             try:
 *                 if mtype == DUMP_BLOCK_MSG:
 *                     if not header_received:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError('data block before header block')
 *                     data_received = True
 */
        __pyx_t_2 = (!__pyx_cur_scope->__pyx_v_header_received);
        if (unlikely(__pyx_t_2)) {

          /* "gel/protocol/protocol.pyx":563
 *                 if mtype == DUMP_BLOCK_MSG:
 *                     if not header_received:
 *                         raise RuntimeError('data block before header block')             # <<<<<<<<<<<<<<
 *                     data_received = True
 * 
 */
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 563, __pyx_L12_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(8, 563, __pyx_L12_error)

          /* "gel/protocol/protocol.pyx":562
 *             try:
 *                 if mtype == DUMP_BLOCK_MSG:
 *                     if not header_received:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError('data block before header block')
 *                     data_received = True
 */
        }

        /* "gel/protocol/protocol.pyx":564
 *                     if not header_received:
 *                         raise RuntimeError('data block before header block')
 *                     data_received = True             # <<<<<<<<<<<<<<
 * 
 *                     await block_callback(
 */
        __pyx_cur_scope->__pyx_v_data_received = 1;

        /* "gel/protocol/protocol.pyx":567
 * 
 *                     await block_callback(
 *                         self.buffer.consume_message()             # <<<<<<<<<<<<<<
 *                     )
 * 
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 567, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_block_callback);
        __pyx_t_5 = __pyx_cur_scope->__pyx_v_block_callback; __pyx_t_8 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_5, function);
            __pyx_t_6 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 566, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XGOTREF(__pyx_r);
        if (likely(__pyx_r)) {
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 2;
          return __pyx_r;
          __pyx_L15_resume_from_await:;
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 566, __pyx_L12_error)
        } else {
          PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
            else __PYX_ERR(8, 566, __pyx_L12_error)
          }
        }

        /* "gel/protocol/protocol.pyx":561
 * 
 *             try:
 *                 if mtype == DUMP_BLOCK_MSG:             # <<<<<<<<<<<<<<
 *                     if not header_received:
 *                         raise RuntimeError('data block before header block')
 */
        break;
        case '@':

        /* "gel/protocol/protocol.pyx":571
 * 
 *                 elif mtype == DUMP_HEADER_BLOCK_MSG:
 *                     if header_received:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError('more than one header block')
 *                     if data_received:
 */
        if (unlikely(__pyx_cur_scope->__pyx_v_header_received)) {

          /* "gel/protocol/protocol.pyx":572
 *                 elif mtype == DUMP_HEADER_BLOCK_MSG:
 *                     if header_received:
 *                         raise RuntimeError('more than one header block')             # <<<<<<<<<<<<<<
 *                     if data_received:
 *                         raise RuntimeError('header block after data block')
 */
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 572, __pyx_L12_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(8, 572, __pyx_L12_error)

          /* "gel/protocol/protocol.pyx":571
 * 
 *                 elif mtype == DUMP_HEADER_BLOCK_MSG:
 *                     if header_received:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError('more than one header block')
 *                     if data_received:
 */
        }

        /* "gel/protocol/protocol.pyx":573
 *                     if header_received:
 *                         raise RuntimeError('more than one header block')
 *                     if data_received:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError('header block after data block')
 * 
 */
        if (unlikely(__pyx_cur_scope->__pyx_v_data_received)) {

          /* "gel/protocol/protocol.pyx":574
 *                         raise RuntimeError('more than one header block')
 *                     if data_received:
 *                         raise RuntimeError('header block after data block')             # <<<<<<<<<<<<<<
 * 
 *                     header_received = True
 */
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 574, __pyx_L12_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(8, 574, __pyx_L12_error)

          /* "gel/protocol/protocol.pyx":573
 *                     if header_received:
 *                         raise RuntimeError('more than one header block')
 *                     if data_received:             # <<<<<<<<<<<<<<
 *                         raise RuntimeError('header block after data block')
 * 
 */
        }

        /* "gel/protocol/protocol.pyx":576
 *                         raise RuntimeError('header block after data block')
 * 
 *                     header_received = True             # <<<<<<<<<<<<<<
 * 
 *                     await header_callback(
 */
        __pyx_cur_scope->__pyx_v_header_received = 1;

        /* "gel/protocol/protocol.pyx":579
 * 
 *                     await header_callback(
 *                         self.buffer.consume_message()             # <<<<<<<<<<<<<<
 *                     )
 * 
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->consume_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 579, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_header_callback);
        __pyx_t_1 = __pyx_cur_scope->__pyx_v_header_callback; __pyx_t_8 = NULL;
        __pyx_t_6 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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_6 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_5};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 578, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XGOTREF(__pyx_r);
        if (likely(__pyx_r)) {
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 3;
          return __pyx_r;
          __pyx_L18_resume_from_await:;
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 578, __pyx_L12_error)
        } else {
          PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
            else __PYX_ERR(8, 578, __pyx_L12_error)
          }
        }

        /* "gel/protocol/protocol.pyx":570
 *                     )
 * 
 *                 elif mtype == DUMP_HEADER_BLOCK_MSG:             # <<<<<<<<<<<<<<
 *                     if header_received:
 *                         raise RuntimeError('more than one header block')
 */
        break;
        case 'E':

        /* "gel/protocol/protocol.pyx":584
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     # ErrorResponse
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 584, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":582
 *                     )
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     # ErrorResponse
 *                     exc = self.parse_error_message()
 */
        break;
        case 'C':

        /* "gel/protocol/protocol.pyx":586
 *                     exc = self.parse_error_message()
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     pass
 * 
 */
        break;
        case 'Z':

        /* "gel/protocol/protocol.pyx":590
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_sync_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 590, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":591
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
        goto __pyx_L10_break;

        /* "gel/protocol/protocol.pyx":589
 *                     pass
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_sync_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol.pyx":594
 * 
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *             finally:
 */
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 594, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol.pyx":597
 * 
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if not header_received:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 597, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L13;
      }
      __pyx_L12_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_17);
        __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
        {
          __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 597, __pyx_L22_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
        }
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
        __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
        goto __pyx_L1_error;
        __pyx_L22_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L10_break: {
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 597, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L6_break;
      }
      __pyx_L13:;
    }
  }
  __pyx_L6_break:;

  /* "gel/protocol/protocol.pyx":599
 *                 self.buffer.finish_message()
 * 
 *         if not header_received:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('header block was not received')
 * 
 */
  __pyx_t_2 = (!__pyx_cur_scope->__pyx_v_header_received);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/protocol.pyx":600
 * 
 *         if not header_received:
 *             raise RuntimeError('header block was not received')             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 600, __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(8, 600, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":599
 *                 self.buffer.finish_message()
 * 
 *         if not header_received:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('header block was not received')
 * 
 */
  }

  /* "gel/protocol/protocol.pyx":602
 *             raise RuntimeError('header block was not received')
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/protocol.pyx":603
 * 
 *         if exc is not None:
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *     async def _sync(self):
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(8, 603, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":602
 *             raise RuntimeError('header block was not received')
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":533
 *                     return ret
 * 
 *     async def dump(self, header_callback, block_callback):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("dump", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_39generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":605
 *             raise exc
 * 
 *     async def _sync(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_38_sync(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_38_sync = {"_sync", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_38_sync, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_38_sync(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_sync (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_sync", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_sync", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_37_sync(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_37_sync(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_sync", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_12__sync(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 605, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_39generator9, __pyx_codeobj__71, (PyObject *) __pyx_cur_scope, __pyx_n_s_sync, __pyx_n_s_SansIOProtocol__sync, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 605, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._sync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_39generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int32_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  char __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_sync", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 605, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":607
 *     async def _sync(self):
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('S')); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)->__pyx_vtab)->end_message(((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(8, 607, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":608
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":609
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_3 == ((int32_t)-1))) __PYX_ERR(8, 609, __pyx_L1_error)
    __pyx_t_4 = (!(__pyx_t_3 != 0));
    if (__pyx_t_4) {

      /* "gel/protocol/protocol.pyx":610
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 610, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L7_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 610, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 610, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":609
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":611
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             if mtype == READY_FOR_COMMAND_MSG:
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 611, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

    /* "gel/protocol/protocol.pyx":613
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                 self.parse_sync_message()
 *                 break
 */
    __pyx_t_4 = (__pyx_cur_scope->__pyx_v_mtype == 'Z');
    if (__pyx_t_4) {

      /* "gel/protocol/protocol.pyx":614
 * 
 *             if mtype == READY_FOR_COMMAND_MSG:
 *                 self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                 break
 *             else:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_sync_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":615
 *             if mtype == READY_FOR_COMMAND_MSG:
 *                 self.parse_sync_message()
 *                 break             # <<<<<<<<<<<<<<
 *             else:
 *                 self.fallthrough()
 */
      goto __pyx_L5_break;

      /* "gel/protocol/protocol.pyx":613
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                 self.parse_sync_message()
 *                 break
 */
    }

    /* "gel/protocol/protocol.pyx":617
 *                 break
 *             else:
 *                 self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *     async def ping(self):
 */
    /*else*/ {
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
  }
  __pyx_L5_break:;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":605
 *             raise exc
 * 
 *     async def _sync(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_sync", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_42generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":619
 *                 self.fallthrough()
 * 
 *     async def ping(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_41ping(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_41ping = {"ping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_41ping, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_41ping(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ping (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("ping", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "ping", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_40ping(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_40ping(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ping", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_13_ping(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 619, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_42generator10, __pyx_codeobj__72, (PyObject *) __pyx_cur_scope, __pyx_n_s_ping, __pyx_n_s_SansIOProtocol_ping, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 619, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_42generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int32_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  char __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ping", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 619, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":621
 *     async def ping(self):
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())             # <<<<<<<<<<<<<<
 *         exc = None
 *         while True:
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('S')); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)->__pyx_vtab)->end_message(((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(8, 621, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":622
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol.pyx":623
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":624
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_3 == ((int32_t)-1))) __PYX_ERR(8, 624, __pyx_L1_error)
    __pyx_t_4 = (!(__pyx_t_3 != 0));
    if (__pyx_t_4) {

      /* "gel/protocol/protocol.pyx":625
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 625, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 625, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L7_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 625, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 625, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":624
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":626
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             if mtype == READY_FOR_COMMAND_MSG:
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 626, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

    /* "gel/protocol/protocol.pyx":628
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                 self.parse_sync_message()
 *                 break
 */
    switch (__pyx_cur_scope->__pyx_v_mtype) {
      case 'Z':

      /* "gel/protocol/protocol.pyx":629
 * 
 *             if mtype == READY_FOR_COMMAND_MSG:
 *                 self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                 break
 *             elif mtype == ERROR_RESPONSE_MSG:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_sync_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":630
 *             if mtype == READY_FOR_COMMAND_MSG:
 *                 self.parse_sync_message()
 *                 break             # <<<<<<<<<<<<<<
 *             elif mtype == ERROR_RESPONSE_MSG:
 *                 exc = self.parse_error_message()
 */
      goto __pyx_L5_break;

      /* "gel/protocol/protocol.pyx":628
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                 self.parse_sync_message()
 *                 break
 */
      break;
      case 'E':

      /* "gel/protocol/protocol.pyx":632
 *                 break
 *             elif mtype == ERROR_RESPONSE_MSG:
 *                 exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                 self.buffer.finish_message()
 *                 break
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":633
 *             elif mtype == ERROR_RESPONSE_MSG:
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 *                 break
 *             else:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 633, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":634
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()
 *                 break             # <<<<<<<<<<<<<<
 *             else:
 *                 self.fallthrough()
 */
      goto __pyx_L5_break;

      /* "gel/protocol/protocol.pyx":631
 *                 self.parse_sync_message()
 *                 break
 *             elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()
 */
      break;
      default:

      /* "gel/protocol/protocol.pyx":636
 *                 break
 *             else:
 *                 self.fallthrough()             # <<<<<<<<<<<<<<
 *         if exc is not None:
 *             raise exc
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 636, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      break;
    }
  }
  __pyx_L5_break:;

  /* "gel/protocol/protocol.pyx":637
 *             else:
 *                 self.fallthrough()
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/protocol.pyx":638
 *                 self.fallthrough()
 *         if exc is not None:
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *     async def restore(self, bytes header, data_gen):
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(8, 638, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":637
 *             else:
 *                 self.fallthrough()
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":619
 *                 self.fallthrough()
 * 
 *     async def ping(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("ping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_45generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":640
 *             raise exc
 * 
 *     async def restore(self, bytes header, data_gen):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_44restore(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_44restore = {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_44restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_44restore(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_header = 0;
  PyObject *__pyx_v_data_gen = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("restore (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_header,&__pyx_n_s_data_gen,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_header)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 640, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data_gen)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 640, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("restore", 1, 2, 2, 1); __PYX_ERR(8, 640, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "restore") < 0)) __PYX_ERR(8, 640, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_header = ((PyObject*)values[0]);
    __pyx_v_data_gen = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("restore", 1, 2, 2, __pyx_nargs); __PYX_ERR(8, 640, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.restore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_header), (&PyBytes_Type), 1, "header", 1))) __PYX_ERR(8, 640, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_43restore(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_header, __pyx_v_data_gen);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_43restore(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_header, PyObject *__pyx_v_data_gen) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("restore", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_14_restore(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 640, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_header = __pyx_v_header;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_header);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_header);
  __pyx_cur_scope->__pyx_v_data_gen = __pyx_v_data_gen;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data_gen);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data_gen);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_45generator11, __pyx_codeobj__73, (PyObject *) __pyx_cur_scope, __pyx_n_s_restore, __pyx_n_s_SansIOProtocol_restore, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 640, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.restore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_45generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int32_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  char __pyx_t_7;
  int16_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  char const *__pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("restore", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_await;
    case 2: goto __pyx_L18_resume_from_await;
    case 3: goto __pyx_L21_resume_from_await;
    case 4: goto __pyx_L23_resume_from_await;
    case 5: goto __pyx_L28_resume_from_await;
    case 6: goto __pyx_L32_resume_from_await;
    case 7: goto __pyx_L43_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 640, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":645
 *             char mtype
 * 
 *         self.ensure_connected()             # <<<<<<<<<<<<<<
 *         self.reset_status()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->ensure_connected(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":646
 * 
 *         self.ensure_connected()
 *         self.reset_status()             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(RESTORE_MSG)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->reset_status(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":648
 *         self.reset_status()
 * 
 *         buf = WriteBuffer.new_message(RESTORE_MSG)             # <<<<<<<<<<<<<<
 *         buf.write_int16(0)  # no attributes
 *         buf.write_int16(1)  # -j level
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('<')); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":649
 * 
 *         buf = WriteBuffer.new_message(RESTORE_MSG)
 *         buf.write_int16(0)  # no attributes             # <<<<<<<<<<<<<<
 *         buf.write_int16(1)  # -j level
 *         buf.write_bytes(header)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":650
 *         buf = WriteBuffer.new_message(RESTORE_MSG)
 *         buf.write_int16(0)  # no attributes
 *         buf.write_int16(1)  # -j level             # <<<<<<<<<<<<<<
 *         buf.write_bytes(header)
 *         buf.end_message()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_buf, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":651
 *         buf.write_int16(0)  # no attributes
 *         buf.write_int16(1)  # -j level
 *         buf.write_bytes(header)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         self.write(buf)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":652
 *         buf.write_int16(1)  # -j level
 *         buf.write_bytes(header)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         self.write(buf)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 652, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":653
 *         buf.write_bytes(header)
 *         buf.end_message()
 *         self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *         exc = None
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":655
 *         self.write(buf)
 * 
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol.pyx":656
 * 
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":657
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(8, 657, __pyx_L1_error)
    __pyx_t_3 = (!(__pyx_t_2 != 0));
    if (__pyx_t_3) {

      /* "gel/protocol/protocol.pyx":658
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 658, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 658, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L7_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 658, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 658, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":657
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":659
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 659, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

    /* "gel/protocol/protocol.pyx":661
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == RESTORE_READY_MSG:
 *                     self.ignore_headers()
 */
    /*try:*/ {

      /* "gel/protocol/protocol.pyx":662
 * 
 *             try:
 *                 if mtype == RESTORE_READY_MSG:             # <<<<<<<<<<<<<<
 *                     self.ignore_headers()
 *                     self.buffer.read_int16()  # discard -j level
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case '+':

        /* "gel/protocol/protocol.pyx":663
 *             try:
 *                 if mtype == RESTORE_READY_MSG:
 *                     self.ignore_headers()             # <<<<<<<<<<<<<<
 *                     self.buffer.read_int16()  # discard -j level
 *                     break
 */
        __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 663, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "gel/protocol/protocol.pyx":664
 *                 if mtype == RESTORE_READY_MSG:
 *                     self.ignore_headers()
 *                     self.buffer.read_int16()  # discard -j level             # <<<<<<<<<<<<<<
 *                     break
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
        __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_8 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 664, __pyx_L11_error)

        /* "gel/protocol/protocol.pyx":665
 *                     self.ignore_headers()
 *                     self.buffer.read_int16()  # discard -j level
 *                     break             # <<<<<<<<<<<<<<
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 */
        goto __pyx_L9_break;

        /* "gel/protocol/protocol.pyx":662
 * 
 *             try:
 *                 if mtype == RESTORE_READY_MSG:             # <<<<<<<<<<<<<<
 *                     self.ignore_headers()
 *                     self.buffer.read_int16()  # discard -j level
 */
        break;
        case 'E':

        /* "gel/protocol/protocol.pyx":667
 *                     break
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                     break
 *                 else:
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 667, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;

        /* "gel/protocol/protocol.pyx":668
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 *                     break             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.fallthrough()
 */
        goto __pyx_L9_break;

        /* "gel/protocol/protocol.pyx":666
 *                     self.buffer.read_int16()  # discard -j level
 *                     break
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol.pyx":670
 *                     break
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 *             finally:
 *                 self.buffer.finish_message()
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 670, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol.pyx":672
 *                     self.fallthrough()
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 672, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L12;
      }
      __pyx_L11_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_17);
        __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
        {
          __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 672, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
        }
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
        __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
        goto __pyx_L1_error;
        __pyx_L16_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L9_break: {
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 672, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L5_break;
      }
      __pyx_L12:;
    }
  }
  __pyx_L5_break:;

  /* "gel/protocol/protocol.pyx":674
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             await self._sync()
 *             raise exc
 */
  __pyx_t_3 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/protocol.pyx":675
 * 
 *         if exc is not None:
 *             await self._sync()             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_sync); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 675, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L18_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 675, __pyx_L1_error)
    } else {
      PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (exc_type) {
        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
        else __PYX_ERR(8, 675, __pyx_L1_error)
      }
    }

    /* "gel/protocol/protocol.pyx":676
 *         if exc is not None:
 *             await self._sync()
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *         # TODO: flow-control is missing here. For now this is fine
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(8, 676, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":674
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             await self._sync()
 *             raise exc
 */
  }

  /* "gel/protocol/protocol.pyx":681
 *         # since this method is only called on a blocking connection.
 * 
 *         async for data in data_gen:             # <<<<<<<<<<<<<<
 *             buf = WriteBuffer.new_message(DUMP_BLOCK_MSG)
 *             buf.write_bytes(data)
 */
  __pyx_t_1 = __Pyx_Coroutine_GetAsyncIter(__pyx_cur_scope->__pyx_v_data_gen); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 681, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  for (;;) {
    __pyx_t_4 = __Pyx_Coroutine_AsyncIterNext(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 3;
      return __pyx_r;
      __pyx_L21_resume_from_await:;
      __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
      __pyx_cur_scope->__pyx_t_0 = 0;
      __Pyx_XGOTREF(__pyx_t_1);
      if (unlikely(!__pyx_sent_value)) {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (unlikely(exc_type && (exc_type == __Pyx_PyExc_StopAsyncIteration || ( exc_type != PyExc_StopIteration && exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, __Pyx_PyExc_StopAsyncIteration))))) {
          PyErr_Clear();
          break;
        }
        __PYX_ERR(8, 681, __pyx_L1_error)
      }
      __pyx_t_4 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_4);
    } else {
      PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (unlikely(exc_type && (exc_type == __Pyx_PyExc_StopAsyncIteration || ( exc_type != PyExc_StopIteration && exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, __Pyx_PyExc_StopAsyncIteration))))) {
        PyErr_Clear();
        break;
      }
      __pyx_t_4 = NULL;
      if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_4) < 0) __PYX_ERR(8, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_data);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_data, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "gel/protocol/protocol.pyx":682
 * 
 *         async for data in data_gen:
 *             buf = WriteBuffer.new_message(DUMP_BLOCK_MSG)             # <<<<<<<<<<<<<<
 *             buf.write_bytes(data)
 *             self.write(buf.end_message())
 */
    __pyx_t_4 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('=')); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_buf);
    __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_buf, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4));
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;

    /* "gel/protocol/protocol.pyx":683
 *         async for data in data_gen:
 *             buf = WriteBuffer.new_message(DUMP_BLOCK_MSG)
 *             buf.write_bytes(data)             # <<<<<<<<<<<<<<
 *             self.write(buf.end_message())
 * 
 */
    if (!(likely(PyBytes_CheckExact(__pyx_cur_scope->__pyx_v_data))||((__pyx_cur_scope->__pyx_v_data) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_cur_scope->__pyx_v_data))) __PYX_ERR(8, 683, __pyx_L1_error)
    __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_cur_scope->__pyx_v_data)); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 683, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "gel/protocol/protocol.pyx":684
 *             buf = WriteBuffer.new_message(DUMP_BLOCK_MSG)
 *             buf.write_bytes(data)
 *             self.write(buf.end_message())             # <<<<<<<<<<<<<<
 * 
 *             if not self.buffer.take_message():
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(8, 684, __pyx_L1_error)
    __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "gel/protocol/protocol.pyx":686
 *             self.write(buf.end_message())
 * 
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.try_recv_eagerly()
 *             if self.buffer.take_message():
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(8, 686, __pyx_L1_error)
    __pyx_t_3 = (!(__pyx_t_2 != 0));
    if (__pyx_t_3) {

      /* "gel/protocol/protocol.pyx":687
 * 
 *             if not self.buffer.take_message():
 *                 await self.try_recv_eagerly()             # <<<<<<<<<<<<<<
 *             if self.buffer.take_message():
 *                 # Check if we received an error.
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_try_recv_eagerly); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_18 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_18)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_18);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_18, NULL};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 687, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_t_1);
        __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 4;
        return __pyx_r;
        __pyx_L23_resume_from_await:;
        __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
        __pyx_cur_scope->__pyx_t_0 = 0;
        __Pyx_XGOTREF(__pyx_t_1);
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 687, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 687, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":686
 *             self.write(buf.end_message())
 * 
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.try_recv_eagerly()
 *             if self.buffer.take_message():
 */
    }

    /* "gel/protocol/protocol.pyx":688
 *             if not self.buffer.take_message():
 *                 await self.try_recv_eagerly()
 *             if self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 # Check if we received an error.
 *                 mtype = self.buffer.get_message_type()
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(8, 688, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "gel/protocol/protocol.pyx":690
 *             if self.buffer.take_message():
 *                 # Check if we received an error.
 *                 mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 *                 if mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 */
      __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 690, __pyx_L1_error)
      __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

      /* "gel/protocol/protocol.pyx":691
 *                 # Check if we received an error.
 *                 mtype = self.buffer.get_message_type()
 *                 if mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 *                     self.buffer.finish_message()
 */
      __pyx_t_3 = (__pyx_cur_scope->__pyx_v_mtype == 'E');
      if (__pyx_t_3) {

        /* "gel/protocol/protocol.pyx":692
 *                 mtype = self.buffer.get_message_type()
 *                 if mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                     self.buffer.finish_message()
 *                     break
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;

        /* "gel/protocol/protocol.pyx":693
 *                 if mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 *                     self.buffer.finish_message()             # <<<<<<<<<<<<<<
 *                     break
 *                 else:
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 693, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "gel/protocol/protocol.pyx":694
 *                     exc = self.parse_error_message()
 *                     self.buffer.finish_message()
 *                     break             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.fallthrough()
 */
        goto __pyx_L20_break;

        /* "gel/protocol/protocol.pyx":691
 *                 # Check if we received an error.
 *                 mtype = self.buffer.get_message_type()
 *                 if mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 *                     self.buffer.finish_message()
 */
      }

      /* "gel/protocol/protocol.pyx":696
 *                     break
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
      /*else*/ {
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 696, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }

      /* "gel/protocol/protocol.pyx":688
 *             if not self.buffer.take_message():
 *                 await self.try_recv_eagerly()
 *             if self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 # Check if we received an error.
 *                 mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":681
 *         # since this method is only called on a blocking connection.
 * 
 *         async for data in data_gen:             # <<<<<<<<<<<<<<
 *             buf = WriteBuffer.new_message(DUMP_BLOCK_MSG)
 *             buf.write_bytes(data)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L26_for_end;
  __pyx_L20_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  goto __pyx_L26_for_end;
  __pyx_L26_for_end:;

  /* "gel/protocol/protocol.pyx":698
 *                     self.fallthrough()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             await self._sync()
 *             raise exc
 */
  __pyx_t_3 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/protocol.pyx":699
 * 
 *         if exc is not None:
 *             await self._sync()             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_sync); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 5;
      return __pyx_r;
      __pyx_L28_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 699, __pyx_L1_error)
    } else {
      PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (exc_type) {
        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
        else __PYX_ERR(8, 699, __pyx_L1_error)
      }
    }

    /* "gel/protocol/protocol.pyx":700
 *         if exc is not None:
 *             await self._sync()
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *         self.write(WriteBuffer.new_message(RESTORE_EOF_MSG).end_message())
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(8, 700, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":698
 *                     self.fallthrough()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             await self._sync()
 *             raise exc
 */
  }

  /* "gel/protocol/protocol.pyx":702
 *             raise exc
 * 
 *         self.write(WriteBuffer.new_message(RESTORE_EOF_MSG).end_message())             # <<<<<<<<<<<<<<
 * 
 *         exc = None
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('.')); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)->__pyx_vtab)->end_message(((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(8, 702, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 702, __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;

  /* "gel/protocol/protocol.pyx":704
 *         self.write(WriteBuffer.new_message(RESTORE_EOF_MSG).end_message())
 * 
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, Py_None);
  __Pyx_GIVEREF(Py_None);

  /* "gel/protocol/protocol.pyx":705
 * 
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":706
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_2 == ((int32_t)-1))) __PYX_ERR(8, 706, __pyx_L1_error)
    __pyx_t_3 = (!(__pyx_t_2 != 0));
    if (__pyx_t_3) {

      /* "gel/protocol/protocol.pyx":707
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 6;
        return __pyx_r;
        __pyx_L32_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 707, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 707, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":706
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":708
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 708, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

    /* "gel/protocol/protocol.pyx":710
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == COMMAND_COMPLETE_MSG:
 *                     break
 */
    /*try:*/ {

      /* "gel/protocol/protocol.pyx":711
 * 
 *             try:
 *                 if mtype == COMMAND_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     break
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case 'C':

        /* "gel/protocol/protocol.pyx":712
 *             try:
 *                 if mtype == COMMAND_COMPLETE_MSG:
 *                     break             # <<<<<<<<<<<<<<
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 */
        goto __pyx_L34_break;

        /* "gel/protocol/protocol.pyx":711
 * 
 *             try:
 *                 if mtype == COMMAND_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     break
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
        break;
        case 'E':

        /* "gel/protocol/protocol.pyx":714
 *                     break
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                     break
 *                 else:
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 714, __pyx_L36_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;

        /* "gel/protocol/protocol.pyx":715
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 *                     break             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.fallthrough()
 */
        goto __pyx_L34_break;

        /* "gel/protocol/protocol.pyx":713
 *                 if mtype == COMMAND_COMPLETE_MSG:
 *                     break
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol.pyx":717
 *                     break
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 *             finally:
 *                 self.buffer.finish_message()
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 717, __pyx_L36_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol.pyx":719
 *                     self.fallthrough()
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 719, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L37;
      }
      __pyx_L36_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_16, &__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_17);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_12);
        __pyx_t_10 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_19 = __pyx_filename;
        {
          __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 719, __pyx_L41_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
        }
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ErrRestore(__pyx_t_17, __pyx_t_16, __pyx_t_15);
        __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_15 = 0; __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0;
        __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_19;
        goto __pyx_L1_error;
        __pyx_L41_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
        }
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L34_break: {
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 719, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L30_break;
      }
      __pyx_L37:;
    }
  }
  __pyx_L30_break:;

  /* "gel/protocol/protocol.pyx":721
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             await self._sync()
 *             raise exc
 */
  __pyx_t_3 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/protocol.pyx":722
 * 
 *         if exc is not None:
 *             await self._sync()             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_sync); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 722, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 7;
      return __pyx_r;
      __pyx_L43_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 722, __pyx_L1_error)
    } else {
      PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
      if (exc_type) {
        if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
        else __PYX_ERR(8, 722, __pyx_L1_error)
      }
    }

    /* "gel/protocol/protocol.pyx":723
 *         if exc is not None:
 *             await self._sync()
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *     def terminate(self):
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(8, 723, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":721
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             await self._sync()
 *             raise exc
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":640
 *             raise exc
 * 
 *     async def restore(self, bytes header, data_gen):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("restore", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":725
 *             raise exc
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         try:
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_47terminate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_47terminate = {"terminate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_47terminate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_47terminate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("terminate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("terminate", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "terminate", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_46terminate(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_46terminate(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("terminate", 1);

  /* "gel/protocol/protocol.pyx":726
 * 
 *     def terminate(self):
 *         try:             # <<<<<<<<<<<<<<
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())
 *         except errors.ClientConnectionError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "gel/protocol/protocol.pyx":727
 *     def terminate(self):
 *         try:
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())             # <<<<<<<<<<<<<<
 *         except errors.ClientConnectionError:
 *             pass
 */
      __pyx_t_4 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('X')); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 727, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4)->__pyx_vtab)->end_message(((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 727, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(8, 727, __pyx_L3_error)
      __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self->__pyx_vtab)->write(__pyx_v_self, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 727, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "gel/protocol/protocol.pyx":726
 * 
 *     def terminate(self):
 *         try:             # <<<<<<<<<<<<<<
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())
 *         except errors.ClientConnectionError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "gel/protocol/protocol.pyx":728
 *         try:
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())
 *         except errors.ClientConnectionError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_errors); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 728, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ClientConnectionError); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 728, __pyx_L5_except_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_ErrRestore(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
    if (__pyx_t_9) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;

    /* "gel/protocol/protocol.pyx":726
 * 
 *     def terminate(self):
 *         try:             # <<<<<<<<<<<<<<
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())
 *         except errors.ClientConnectionError:
 */
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "gel/protocol/protocol.pyx":725
 *             raise exc
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         try:
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.terminate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_50generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":731
 *             pass
 * 
 *     async def connect(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer ver_buf
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_49connect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_49connect = {"connect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_49connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_49connect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("connect", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "connect", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_48connect(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_48connect(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_15_connect(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 731, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_50generator12, __pyx_codeobj__74, (PyObject *) __pyx_cur_scope, __pyx_n_s_connect, __pyx_n_s_SansIOProtocol_connect, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_50generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int32_t __pyx_t_10;
  char __pyx_t_11;
  int16_t __pyx_t_12;
  Py_UCS4 __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L4_resume_from_await;
    case 2: goto __pyx_L12_resume_from_await;
    case 3: goto __pyx_L15_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 731, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":739
 *             int32_t status
 * 
 *         await self.wait_for_connect()             # <<<<<<<<<<<<<<
 * 
 *         if self.connected:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_XGOTREF(__pyx_r);
  if (likely(__pyx_r)) {
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, awaiting value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L4_resume_from_await:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 739, __pyx_L1_error)
  } else {
    PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (exc_type) {
      if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
      else __PYX_ERR(8, 739, __pyx_L1_error)
    }
  }

  /* "gel/protocol/protocol.pyx":741
 *         await self.wait_for_connect()
 * 
 *         if self.connected:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('already connected')
 * 
 */
  if (unlikely(__pyx_cur_scope->__pyx_v_self->connected)) {

    /* "gel/protocol/protocol.pyx":742
 * 
 *         if self.connected:
 *             raise RuntimeError('already connected')             # <<<<<<<<<<<<<<
 * 
 *         # protocol version
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 742, __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(8, 742, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":741
 *         await self.wait_for_connect()
 * 
 *         if self.connected:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('already connected')
 * 
 */
  }

  /* "gel/protocol/protocol.pyx":745
 * 
 *         # protocol version
 *         handshake_buf = WriteBuffer.new_message(CLIENT_HANDSHAKE_MSG)             # <<<<<<<<<<<<<<
 *         handshake_buf.write_int16(PROTO_VER_MAJOR)
 *         handshake_buf.write_int16(PROTO_VER_MINOR)
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('V')); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_handshake_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":746
 *         # protocol version
 *         handshake_buf = WriteBuffer.new_message(CLIENT_HANDSHAKE_MSG)
 *         handshake_buf.write_int16(PROTO_VER_MAJOR)             # <<<<<<<<<<<<<<
 *         handshake_buf.write_int16(PROTO_VER_MINOR)
 *         self.protocol_version = (PROTO_VER_MAJOR, PROTO_VER_MINOR)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_handshake_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_handshake_buf, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":747
 *         handshake_buf = WriteBuffer.new_message(CLIENT_HANDSHAKE_MSG)
 *         handshake_buf.write_int16(PROTO_VER_MAJOR)
 *         handshake_buf.write_int16(PROTO_VER_MINOR)             # <<<<<<<<<<<<<<
 *         self.protocol_version = (PROTO_VER_MAJOR, PROTO_VER_MINOR)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_handshake_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_handshake_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":748
 *         handshake_buf.write_int16(PROTO_VER_MAJOR)
 *         handshake_buf.write_int16(PROTO_VER_MINOR)
 *         self.protocol_version = (PROTO_VER_MAJOR, PROTO_VER_MINOR)             # <<<<<<<<<<<<<<
 * 
 *         # params
 */
  __Pyx_INCREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->protocol_version);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->protocol_version);
  __pyx_cur_scope->__pyx_v_self->protocol_version = __pyx_tuple__54;

  /* "gel/protocol/protocol.pyx":752
 *         # params
 *         params = {
 *             'user': self.con_params.user,             # <<<<<<<<<<<<<<
 *             'database': self.con_params.database,
 *         }
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->con_params, __pyx_n_s_user); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_user, __pyx_t_2) < 0) __PYX_ERR(8, 752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol.pyx":753
 *         params = {
 *             'user': self.con_params.user,
 *             'database': self.con_params.database,             # <<<<<<<<<<<<<<
 *         }
 *         if self.con_params.secret_key:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->con_params, __pyx_n_s_database); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_database, __pyx_t_2) < 0) __PYX_ERR(8, 752, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_params = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":755
 *             'database': self.con_params.database,
 *         }
 *         if self.con_params.secret_key:             # <<<<<<<<<<<<<<
 *             params['secret_key'] = self.con_params.secret_key
 *         handshake_buf.write_int16(len(params))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->con_params, __pyx_n_s_secret_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(8, 755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "gel/protocol/protocol.pyx":756
 *         }
 *         if self.con_params.secret_key:
 *             params['secret_key'] = self.con_params.secret_key             # <<<<<<<<<<<<<<
 *         handshake_buf.write_int16(len(params))
 *         for k, v in params.items():
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->con_params, __pyx_n_s_secret_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely((PyDict_SetItem(__pyx_cur_scope->__pyx_v_params, __pyx_n_u_secret_key, __pyx_t_1) < 0))) __PYX_ERR(8, 756, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":755
 *             'database': self.con_params.database,
 *         }
 *         if self.con_params.secret_key:             # <<<<<<<<<<<<<<
 *             params['secret_key'] = self.con_params.secret_key
 *         handshake_buf.write_int16(len(params))
 */
  }

  /* "gel/protocol/protocol.pyx":757
 *         if self.con_params.secret_key:
 *             params['secret_key'] = self.con_params.secret_key
 *         handshake_buf.write_int16(len(params))             # <<<<<<<<<<<<<<
 *         for k, v in params.items():
 *             handshake_buf.write_len_prefixed_utf8(k)
 */
  __pyx_t_6 = PyDict_Size(__pyx_cur_scope->__pyx_v_params); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(8, 757, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_handshake_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_handshake_buf, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 757, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":758
 *             params['secret_key'] = self.con_params.secret_key
 *         handshake_buf.write_int16(len(params))
 *         for k, v in params.items():             # <<<<<<<<<<<<<<
 *             handshake_buf.write_len_prefixed_utf8(k)
 *             handshake_buf.write_len_prefixed_utf8(v)
 */
  __pyx_t_6 = 0;
  __pyx_t_2 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_params, 1, __pyx_n_s_items, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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(8, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":759
 *         handshake_buf.write_int16(len(params))
 *         for k, v in params.items():
 *             handshake_buf.write_len_prefixed_utf8(k)             # <<<<<<<<<<<<<<
 *             handshake_buf.write_len_prefixed_utf8(v)
 * 
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_k))||((__pyx_cur_scope->__pyx_v_k) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_k))) __PYX_ERR(8, 759, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_cur_scope->__pyx_v_handshake_buf, ((PyObject*)__pyx_cur_scope->__pyx_v_k)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":760
 *         for k, v in params.items():
 *             handshake_buf.write_len_prefixed_utf8(k)
 *             handshake_buf.write_len_prefixed_utf8(v)             # <<<<<<<<<<<<<<
 * 
 *         handshake_buf.write_int16(0)  # reserved
 */
    if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_v))||((__pyx_cur_scope->__pyx_v_v) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_v))) __PYX_ERR(8, 760, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_cur_scope->__pyx_v_handshake_buf, ((PyObject*)__pyx_cur_scope->__pyx_v_v)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":762
 *             handshake_buf.write_len_prefixed_utf8(v)
 * 
 *         handshake_buf.write_int16(0)  # reserved             # <<<<<<<<<<<<<<
 *         handshake_buf.end_message()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_handshake_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_handshake_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":763
 * 
 *         handshake_buf.write_int16(0)  # reserved
 *         handshake_buf.end_message()             # <<<<<<<<<<<<<<
 * 
 *         self.write(handshake_buf)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_handshake_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_handshake_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":765
 *         handshake_buf.end_message()
 * 
 *         self.write(handshake_buf)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_handshake_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":767
 *         self.write(handshake_buf)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":768
 * 
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_10 == ((int32_t)-1))) __PYX_ERR(8, 768, __pyx_L1_error)
    __pyx_t_5 = (!(__pyx_t_10 != 0));
    if (__pyx_t_5) {

      /* "gel/protocol/protocol.pyx":769
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 769, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      __pyx_t_4 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 769, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 2;
        return __pyx_r;
        __pyx_L12_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 769, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 769, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":768
 * 
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":770
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             if mtype == SERVER_HANDSHAKE_MSG:
 */
    __pyx_t_11 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 770, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_11;

    /* "gel/protocol/protocol.pyx":772
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == SERVER_HANDSHAKE_MSG:             # <<<<<<<<<<<<<<
 *                 # Server responded with ServerHandshake, this
 *                 # means protocol negotiation.
 */
    switch (__pyx_cur_scope->__pyx_v_mtype) {
      case 'v':

      /* "gel/protocol/protocol.pyx":775
 *                 # Server responded with ServerHandshake, this
 *                 # means protocol negotiation.
 *                 major = self.buffer.read_int16()             # <<<<<<<<<<<<<<
 *                 minor = self.buffer.read_int16()
 * 
 */
      __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_12 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 775, __pyx_L1_error)
      __pyx_cur_scope->__pyx_v_major = __pyx_t_12;

      /* "gel/protocol/protocol.pyx":776
 *                 # means protocol negotiation.
 *                 major = self.buffer.read_int16()
 *                 minor = self.buffer.read_int16()             # <<<<<<<<<<<<<<
 * 
 *                 # TODO: drop this branch when dropping protocol_v0
 */
      __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_12 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 776, __pyx_L1_error)
      __pyx_cur_scope->__pyx_v_minor = __pyx_t_12;

      /* "gel/protocol/protocol.pyx":779
 * 
 *                 # TODO: drop this branch when dropping protocol_v0
 *                 if major == 0:             # <<<<<<<<<<<<<<
 *                     self.is_legacy = True
 *                     self.ignore_headers()
 */
      __pyx_t_5 = (__pyx_cur_scope->__pyx_v_major == 0);
      if (__pyx_t_5) {

        /* "gel/protocol/protocol.pyx":780
 *                 # TODO: drop this branch when dropping protocol_v0
 *                 if major == 0:
 *                     self.is_legacy = True             # <<<<<<<<<<<<<<
 *                     self.ignore_headers()
 * 
 */
        __pyx_cur_scope->__pyx_v_self->is_legacy = 1;

        /* "gel/protocol/protocol.pyx":781
 *                 if major == 0:
 *                     self.is_legacy = True
 *                     self.ignore_headers()             # <<<<<<<<<<<<<<
 * 
 *                 self.buffer.finish_message()
 */
        __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 781, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "gel/protocol/protocol.pyx":779
 * 
 *                 # TODO: drop this branch when dropping protocol_v0
 *                 if major == 0:             # <<<<<<<<<<<<<<
 *                     self.is_legacy = True
 *                     self.ignore_headers()
 */
      }

      /* "gel/protocol/protocol.pyx":783
 *                     self.ignore_headers()
 * 
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *                 if (major, minor) < (MIN_PROTO_VER_MAJOR, MIN_PROTO_VER_MINOR):
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":785
 *                 self.buffer.finish_message()
 * 
 *                 if (major, minor) < (MIN_PROTO_VER_MAJOR, MIN_PROTO_VER_MINOR):             # <<<<<<<<<<<<<<
 *                     raise errors.ClientConnectionError(
 *                         f'the server requested an unsupported version of '
 */
      __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_cur_scope->__pyx_v_major); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyInt_From_int16_t(__pyx_cur_scope->__pyx_v_minor); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(8, 785, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_3);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(8, 785, __pyx_L1_error);
      __pyx_t_1 = 0;
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__76, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 785, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(8, 785, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(__pyx_t_5)) {

        /* "gel/protocol/protocol.pyx":786
 * 
 *                 if (major, minor) < (MIN_PROTO_VER_MAJOR, MIN_PROTO_VER_MINOR):
 *                     raise errors.ClientConnectionError(             # <<<<<<<<<<<<<<
 *                         f'the server requested an unsupported version of '
 *                         f'the protocol: {major}.{minor}'
 */
        __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ClientConnectionError); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 786, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "gel/protocol/protocol.pyx":787
 *                 if (major, minor) < (MIN_PROTO_VER_MAJOR, MIN_PROTO_VER_MINOR):
 *                     raise errors.ClientConnectionError(
 *                         f'the server requested an unsupported version of '             # <<<<<<<<<<<<<<
 *                         f'the protocol: {major}.{minor}'
 *                     )
 */
        __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 787, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_7 = 0;
        __pyx_t_13 = 127;
        __Pyx_INCREF(__pyx_kp_u_the_server_requested_an_unsuppor);
        __pyx_t_7 += 61;
        __Pyx_GIVEREF(__pyx_kp_u_the_server_requested_an_unsuppor);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_the_server_requested_an_unsuppor);

        /* "gel/protocol/protocol.pyx":788
 *                     raise errors.ClientConnectionError(
 *                         f'the server requested an unsupported version of '
 *                         f'the protocol: {major}.{minor}'             # <<<<<<<<<<<<<<
 *                     )
 *                 else:
 */
        __pyx_t_14 = __Pyx_PyInt_From_int16_t(__pyx_cur_scope->__pyx_v_major); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = __Pyx_PyObject_FormatSimple(__pyx_t_14, __pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(8, 788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) : __pyx_t_13;
        __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15);
        __Pyx_GIVEREF(__pyx_t_15);
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_15);
        __pyx_t_15 = 0;
        __Pyx_INCREF(__pyx_kp_u__3);
        __pyx_t_7 += 1;
        __Pyx_GIVEREF(__pyx_kp_u__3);
        PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__3);
        __pyx_t_15 = __Pyx_PyInt_From_int16_t(__pyx_cur_scope->__pyx_v_minor); if (unlikely(!__pyx_t_15)) __PYX_ERR(8, 788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_14 = __Pyx_PyObject_FormatSimple(__pyx_t_15, __pyx_empty_unicode); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 788, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_14) : __pyx_t_13;
        __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_14);
        __pyx_t_14 = 0;

        /* "gel/protocol/protocol.pyx":787
 *                 if (major, minor) < (MIN_PROTO_VER_MAJOR, MIN_PROTO_VER_MINOR):
 *                     raise errors.ClientConnectionError(
 *                         f'the server requested an unsupported version of '             # <<<<<<<<<<<<<<
 *                         f'the protocol: {major}.{minor}'
 *                     )
 */
        __pyx_t_14 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_7, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 787, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_2)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_14};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 786, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __PYX_ERR(8, 786, __pyx_L1_error)

        /* "gel/protocol/protocol.pyx":785
 *                 self.buffer.finish_message()
 * 
 *                 if (major, minor) < (MIN_PROTO_VER_MAJOR, MIN_PROTO_VER_MINOR):             # <<<<<<<<<<<<<<
 *                     raise errors.ClientConnectionError(
 *                         f'the server requested an unsupported version of '
 */
      }

      /* "gel/protocol/protocol.pyx":791
 *                     )
 *                 else:
 *                     self.protocol_version = (major, minor)             # <<<<<<<<<<<<<<
 * 
 *             elif mtype == AUTH_REQUEST_MSG:
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyInt_From_int16_t(__pyx_cur_scope->__pyx_v_major); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_cur_scope->__pyx_v_minor); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 791, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_3);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3)) __PYX_ERR(8, 791, __pyx_L1_error);
        __Pyx_GIVEREF(__pyx_t_1);
        if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1)) __PYX_ERR(8, 791, __pyx_L1_error);
        __pyx_t_3 = 0;
        __pyx_t_1 = 0;
        __Pyx_GIVEREF(__pyx_t_14);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->protocol_version);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->protocol_version);
        __pyx_cur_scope->__pyx_v_self->protocol_version = ((PyObject*)__pyx_t_14);
        __pyx_t_14 = 0;
      }

      /* "gel/protocol/protocol.pyx":772
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == SERVER_HANDSHAKE_MSG:             # <<<<<<<<<<<<<<
 *                 # Server responded with ServerHandshake, this
 *                 # means protocol negotiation.
 */
      break;
      case 'R':

      /* "gel/protocol/protocol.pyx":795
 *             elif mtype == AUTH_REQUEST_MSG:
 *                 # Authentication...
 *                 status = self.buffer.read_int32()             # <<<<<<<<<<<<<<
 *                 if status == AuthenticationStatuses.AUTH_OK:
 *                     pass
 */
      __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_10 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 795, __pyx_L1_error)
      __pyx_cur_scope->__pyx_v_status = __pyx_t_10;

      /* "gel/protocol/protocol.pyx":796
 *                 # Authentication...
 *                 status = self.buffer.read_int32()
 *                 if status == AuthenticationStatuses.AUTH_OK:             # <<<<<<<<<<<<<<
 *                     pass
 *                 elif status == AuthenticationStatuses.AUTH_SASL:
 */
      switch (__pyx_cur_scope->__pyx_v_status) {
        case __pyx_e_3gel_8protocol_8protocol_AUTH_OK:
        break;
        case __pyx_e_3gel_8protocol_8protocol_AUTH_SASL:

        /* "gel/protocol/protocol.pyx":799
 *                     pass
 *                 elif status == AuthenticationStatuses.AUTH_SASL:
 *                     await self._auth_sasl()             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.abort()
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_auth_sasl); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 799, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_3 = NULL;
        __pyx_t_4 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
            __pyx_t_4 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 799, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_14);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XGOTREF(__pyx_r);
        if (likely(__pyx_r)) {
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
          /* return from generator, awaiting value */
          __pyx_generator->resume_label = 3;
          return __pyx_r;
          __pyx_L15_resume_from_await:;
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 799, __pyx_L1_error)
        } else {
          PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
            else __PYX_ERR(8, 799, __pyx_L1_error)
          }
        }

        /* "gel/protocol/protocol.pyx":798
 *                 if status == AuthenticationStatuses.AUTH_OK:
 *                     pass
 *                 elif status == AuthenticationStatuses.AUTH_SASL:             # <<<<<<<<<<<<<<
 *                     await self._auth_sasl()
 *                 else:
 */
        break;
        default:

        /* "gel/protocol/protocol.pyx":801
 *                     await self._auth_sasl()
 *                 else:
 *                     self.abort()             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'unsupported authentication method requested by the '
 */
        __pyx_t_14 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->abort(__pyx_cur_scope->__pyx_v_self, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 801, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "gel/protocol/protocol.pyx":804
 *                     raise RuntimeError(
 *                         f'unsupported authentication method requested by the '
 *                         f'server: {status}')             # <<<<<<<<<<<<<<
 * 
 *             elif mtype == SERVER_KEY_DATA_MSG:
 */
        __pyx_t_14 = __Pyx_PyInt_From_int32_t(__pyx_cur_scope->__pyx_v_status); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_t_14, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

        /* "gel/protocol/protocol.pyx":803
 *                     self.abort()
 *                     raise RuntimeError(
 *                         f'unsupported authentication method requested by the '             # <<<<<<<<<<<<<<
 *                         f'server: {status}')
 * 
 */
        __pyx_t_14 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unsupported_authentication_metho, __pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 803, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "gel/protocol/protocol.pyx":802
 *                 else:
 *                     self.abort()
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unsupported authentication method requested by the '
 *                         f'server: {status}')
 */
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 802, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(8, 802, __pyx_L1_error)
        break;
      }

      /* "gel/protocol/protocol.pyx":793
 *                     self.protocol_version = (major, minor)
 * 
 *             elif mtype == AUTH_REQUEST_MSG:             # <<<<<<<<<<<<<<
 *                 # Authentication...
 *                 status = self.buffer.read_int32()
 */
      break;
      case 'K':

      /* "gel/protocol/protocol.pyx":807
 * 
 *             elif mtype == SERVER_KEY_DATA_MSG:
 *                 self.backend_secret = self.buffer.read_bytes(32)             # <<<<<<<<<<<<<<
 * 
 *             elif mtype == STATE_DATA_DESC_MSG:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_bytes(__pyx_cur_scope->__pyx_v_self->buffer, 32); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 807, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->backend_secret);
      __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->backend_secret);
      __pyx_cur_scope->__pyx_v_self->backend_secret = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":806
 *                         f'server: {status}')
 * 
 *             elif mtype == SERVER_KEY_DATA_MSG:             # <<<<<<<<<<<<<<
 *                 self.backend_secret = self.buffer.read_bytes(32)
 * 
 */
      break;
      case 's':

      /* "gel/protocol/protocol.pyx":810
 * 
 *             elif mtype == STATE_DATA_DESC_MSG:
 *                 self.parse_describe_state_message()             # <<<<<<<<<<<<<<
 * 
 *             elif mtype == ERROR_RESPONSE_MSG:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_describe_state_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 810, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":809
 *                 self.backend_secret = self.buffer.read_bytes(32)
 * 
 *             elif mtype == STATE_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                 self.parse_describe_state_message()
 * 
 */
      break;
      case 'E':

      /* "gel/protocol/protocol.pyx":813
 * 
 *             elif mtype == ERROR_RESPONSE_MSG:
 *                 raise self.parse_error_message()             # <<<<<<<<<<<<<<
 * 
 *             elif mtype == READY_FOR_COMMAND_MSG:
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 813, __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(8, 813, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":812
 *                 self.parse_describe_state_message()
 * 
 *             elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                 raise self.parse_error_message()
 * 
 */
      break;
      case 'Z':

      /* "gel/protocol/protocol.pyx":817
 *             elif mtype == READY_FOR_COMMAND_MSG:
 *                 # ReadyForQuery
 *                 self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                 if self.xact_status == TRANS_IDLE:
 *                     self.connected = True
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_sync_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":818
 *                 # ReadyForQuery
 *                 self.parse_sync_message()
 *                 if self.xact_status == TRANS_IDLE:             # <<<<<<<<<<<<<<
 *                     self.connected = True
 *                     break
 */
      __pyx_t_5 = (__pyx_cur_scope->__pyx_v_self->xact_status == __pyx_e_3gel_8protocol_8protocol_TRANS_IDLE);
      if (likely(__pyx_t_5)) {

        /* "gel/protocol/protocol.pyx":819
 *                 self.parse_sync_message()
 *                 if self.xact_status == TRANS_IDLE:
 *                     self.connected = True             # <<<<<<<<<<<<<<
 *                     break
 *                 else:
 */
        __pyx_cur_scope->__pyx_v_self->connected = 1;

        /* "gel/protocol/protocol.pyx":820
 *                 if self.xact_status == TRANS_IDLE:
 *                     self.connected = True
 *                     break             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise RuntimeError('non-idle status after connect')
 */
        goto __pyx_L10_break;

        /* "gel/protocol/protocol.pyx":818
 *                 # ReadyForQuery
 *                 self.parse_sync_message()
 *                 if self.xact_status == TRANS_IDLE:             # <<<<<<<<<<<<<<
 *                     self.connected = True
 *                     break
 */
      }

      /* "gel/protocol/protocol.pyx":822
 *                     break
 *                 else:
 *                     raise RuntimeError('non-idle status after connect')             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 822, __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(8, 822, __pyx_L1_error)
      }

      /* "gel/protocol/protocol.pyx":815
 *                 raise self.parse_error_message()
 * 
 *             elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                 # ReadyForQuery
 *                 self.parse_sync_message()
 */
      break;
      default:

      /* "gel/protocol/protocol.pyx":825
 * 
 *             else:
 *                 self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *             self.buffer.finish_message()
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 825, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      break;
    }

    /* "gel/protocol/protocol.pyx":827
 *                 self.fallthrough()
 * 
 *             self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *     async def _auth_sasl(self):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L10_break:;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":731
 *             pass
 * 
 *     async def connect(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer ver_buf
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_53generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol.pyx":829
 *             self.buffer.finish_message()
 * 
 *     async def _auth_sasl(self):             # <<<<<<<<<<<<<<
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_52_auth_sasl(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_52_auth_sasl = {"_auth_sasl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_52_auth_sasl, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_52_auth_sasl(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_auth_sasl (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_auth_sasl", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_auth_sasl", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_51_auth_sasl(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_51_auth_sasl(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_auth_sasl", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(8, 829, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_53generator13, __pyx_codeobj__78, (PyObject *) __pyx_cur_scope, __pyx_n_s_auth_sasl, __pyx_n_s_SansIOProtocol__auth_sasl, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(8, 829, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._auth_sasl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_14SansIOProtocol_53generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int32_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int32_t __pyx_t_4;
  int32_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  char __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_auth_sasl", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L17_resume_from_await;
    case 2: goto __pyx_L28_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 829, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":830
 * 
 *     async def _auth_sasl(self):
 *         num_methods = self.buffer.read_int32()             # <<<<<<<<<<<<<<
 *         if num_methods <= 0:
 *             raise RuntimeError(
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 830, __pyx_L1_error)
  __pyx_cur_scope->__pyx_v_num_methods = __pyx_t_1;

  /* "gel/protocol/protocol.pyx":831
 *     async def _auth_sasl(self):
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 'the server requested SASL authentication but did not '
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_num_methods <= 0);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/protocol.pyx":832
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 'the server requested SASL authentication but did not '
 *                 'offer any methods')
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 832, __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(8, 832, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":831
 *     async def _auth_sasl(self):
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 'the server requested SASL authentication but did not '
 */
  }

  /* "gel/protocol/protocol.pyx":836
 *                 'offer any methods')
 * 
 *         methods = []             # <<<<<<<<<<<<<<
 *         for i in range(num_methods):
 *             method = self.buffer.read_len_prefixed_bytes()
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_methods = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":837
 * 
 *         methods = []
 *         for i in range(num_methods):             # <<<<<<<<<<<<<<
 *             method = self.buffer.read_len_prefixed_bytes()
 *             methods.append(method)
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_num_methods;
  __pyx_t_4 = __pyx_t_1;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_cur_scope->__pyx_v_i = __pyx_t_5;

    /* "gel/protocol/protocol.pyx":838
 *         methods = []
 *         for i in range(num_methods):
 *             method = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *             methods.append(method)
 * 
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_method);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_method, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":839
 *         for i in range(num_methods):
 *             method = self.buffer.read_len_prefixed_bytes()
 *             methods.append(method)             # <<<<<<<<<<<<<<
 * 
 *         self.buffer.finish_message()
 */
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_methods, __pyx_cur_scope->__pyx_v_method); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(8, 839, __pyx_L1_error)
  }

  /* "gel/protocol/protocol.pyx":841
 *             methods.append(method)
 * 
 *         self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         for method in methods:
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":843
 *         self.buffer.finish_message()
 * 
 *         for method in methods:             # <<<<<<<<<<<<<<
 *             if method == b'SCRAM-SHA-256':
 *                 break
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_methods; __Pyx_INCREF(__pyx_t_3);
  __pyx_t_7 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
      #if !CYTHON_ASSUME_SAFE_MACROS
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 843, __pyx_L1_error)
      #endif
      if (__pyx_t_7 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(8, 843, __pyx_L1_error)
    #else
    __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    #endif
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_method);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_method, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/protocol.pyx":844
 * 
 *         for method in methods:
 *             if method == b'SCRAM-SHA-256':             # <<<<<<<<<<<<<<
 *                 break
 *         else:
 */
    __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_cur_scope->__pyx_v_method, __pyx_kp_b_SCRAM_SHA_256, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 844, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "gel/protocol/protocol.pyx":845
 *         for method in methods:
 *             if method == b'SCRAM-SHA-256':
 *                 break             # <<<<<<<<<<<<<<
 *         else:
 *             raise RuntimeError(
 */
      goto __pyx_L8_break;

      /* "gel/protocol/protocol.pyx":844
 * 
 *         for method in methods:
 *             if method == b'SCRAM-SHA-256':             # <<<<<<<<<<<<<<
 *                 break
 *         else:
 */
    }

    /* "gel/protocol/protocol.pyx":843
 *         self.buffer.finish_message()
 * 
 *         for method in methods:             # <<<<<<<<<<<<<<
 *             if method == b'SCRAM-SHA-256':
 *                 break
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L10_for_else;
  __pyx_L8_break:;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  goto __pyx_L11_for_end;
  /*else*/ {
    __pyx_L10_for_else:;

    /* "gel/protocol/protocol.pyx":848
 *         else:
 *             raise RuntimeError(
 *                 f'the server offered the following SASL authentication '             # <<<<<<<<<<<<<<
 *                 f'methods: {", ".join(methods)}, neither are supported.')
 * 
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_9 = 127;
    __Pyx_INCREF(__pyx_kp_u_the_server_offered_the_following);
    __pyx_t_7 += 62;
    __Pyx_GIVEREF(__pyx_kp_u_the_server_offered_the_following);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_the_server_offered_the_following);

    /* "gel/protocol/protocol.pyx":849
 *             raise RuntimeError(
 *                 f'the server offered the following SASL authentication '
 *                 f'methods: {", ".join(methods)}, neither are supported.')             # <<<<<<<<<<<<<<
 * 
 *         client_nonce = scram.generate_nonce()
 */
    __pyx_t_8 = PyUnicode_Join(__pyx_kp_u__80, __pyx_cur_scope->__pyx_v_methods); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_9;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_INCREF(__pyx_kp_u_neither_are_supported);
    __pyx_t_7 += 24;
    __Pyx_GIVEREF(__pyx_kp_u_neither_are_supported);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_neither_are_supported);

    /* "gel/protocol/protocol.pyx":848
 *         else:
 *             raise RuntimeError(
 *                 f'the server offered the following SASL authentication '             # <<<<<<<<<<<<<<
 *                 f'methods: {", ".join(methods)}, neither are supported.')
 * 
 */
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":847
 *                 break
 *         else:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'the server offered the following SASL authentication '
 *                 f'methods: {", ".join(methods)}, neither are supported.')
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(8, 847, __pyx_L1_error)
  }
  __pyx_L11_for_end:;

  /* "gel/protocol/protocol.pyx":851
 *                 f'methods: {", ".join(methods)}, neither are supported.')
 * 
 *         client_nonce = scram.generate_nonce()             # <<<<<<<<<<<<<<
 *         client_first, client_first_bare = scram.build_client_first_message(
 *             client_nonce, self.con_params.user)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_scram); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_generate_nonce); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_10))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_10, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_client_nonce = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":852
 * 
 *         client_nonce = scram.generate_nonce()
 *         client_first, client_first_bare = scram.build_client_first_message(             # <<<<<<<<<<<<<<
 *             client_nonce, self.con_params.user)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_scram); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_build_client_first_message); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":853
 *         client_nonce = scram.generate_nonce()
 *         client_first, client_first_bare = scram.build_client_first_message(
 *             client_nonce, self.con_params.user)             # <<<<<<<<<<<<<<
 * 
 *         msg_buf = WriteBuffer.new_message(AUTH_INITIAL_RESPONSE_MSG)
 */
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->con_params, __pyx_n_s_user); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_12 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_client_nonce, __pyx_t_10};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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(8, 852, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_10);
    #else
    __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 852, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
    index = 0; __pyx_t_8 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_10);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(8, 852, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L13_unpacking_done;
    __pyx_L12_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(8, 852, __pyx_L1_error)
    __pyx_L13_unpacking_done:;
  }

  /* "gel/protocol/protocol.pyx":852
 * 
 *         client_nonce = scram.generate_nonce()
 *         client_first, client_first_bare = scram.build_client_first_message(             # <<<<<<<<<<<<<<
 *             client_nonce, self.con_params.user)
 * 
 */
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_client_first = __pyx_t_8;
  __pyx_t_8 = 0;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_client_first_bare = __pyx_t_10;
  __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":855
 *             client_nonce, self.con_params.user)
 * 
 *         msg_buf = WriteBuffer.new_message(AUTH_INITIAL_RESPONSE_MSG)             # <<<<<<<<<<<<<<
 *         msg_buf.write_len_prefixed_bytes(b'SCRAM-SHA-256')
 *         msg_buf.write_len_prefixed_utf8(client_first)
 */
  __pyx_t_3 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('p')); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_msg_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":856
 * 
 *         msg_buf = WriteBuffer.new_message(AUTH_INITIAL_RESPONSE_MSG)
 *         msg_buf.write_len_prefixed_bytes(b'SCRAM-SHA-256')             # <<<<<<<<<<<<<<
 *         msg_buf.write_len_prefixed_utf8(client_first)
 *         msg_buf.end_message()
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_msg_buf->__pyx_vtab)->write_len_prefixed_bytes(__pyx_cur_scope->__pyx_v_msg_buf, __pyx_kp_b_SCRAM_SHA_256); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":857
 *         msg_buf = WriteBuffer.new_message(AUTH_INITIAL_RESPONSE_MSG)
 *         msg_buf.write_len_prefixed_bytes(b'SCRAM-SHA-256')
 *         msg_buf.write_len_prefixed_utf8(client_first)             # <<<<<<<<<<<<<<
 *         msg_buf.end_message()
 *         self.write(msg_buf)
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_client_first))||((__pyx_cur_scope->__pyx_v_client_first) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_client_first))) __PYX_ERR(8, 857, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_cur_scope->__pyx_v_msg_buf, ((PyObject*)__pyx_cur_scope->__pyx_v_client_first)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":858
 *         msg_buf.write_len_prefixed_bytes(b'SCRAM-SHA-256')
 *         msg_buf.write_len_prefixed_utf8(client_first)
 *         msg_buf.end_message()             # <<<<<<<<<<<<<<
 *         self.write(msg_buf)
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_msg_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_msg_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 858, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":859
 *         msg_buf.write_len_prefixed_utf8(client_first)
 *         msg_buf.end_message()
 *         self.write(msg_buf)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_msg_buf); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 859, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":861
 *         self.write(msg_buf)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":862
 * 
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1))) __PYX_ERR(8, 862, __pyx_L1_error)
    __pyx_t_2 = (!(__pyx_t_1 != 0));
    if (__pyx_t_2) {

      /* "gel/protocol/protocol.pyx":863
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 863, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_8 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 863, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L17_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 863, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 863, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":862
 * 
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":864
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             if mtype == ERROR_RESPONSE_MSG:
 */
    __pyx_t_14 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 864, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_14;

    /* "gel/protocol/protocol.pyx":866
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                 # ErrorResponse
 *                 exc = self.parse_error_message()
 */
    switch (__pyx_cur_scope->__pyx_v_mtype) {
      case 'E':

      /* "gel/protocol/protocol.pyx":868
 *             if mtype == ERROR_RESPONSE_MSG:
 *                 # ErrorResponse
 *                 exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                 self.buffer.finish_message()
 *                 raise exc
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 868, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_cur_scope->__pyx_v_exc = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "gel/protocol/protocol.pyx":869
 *                 # ErrorResponse
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 *                 raise exc
 * 
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "gel/protocol/protocol.pyx":870
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()
 *                 raise exc             # <<<<<<<<<<<<<<
 * 
 *             elif mtype == AUTH_REQUEST_MSG:
 */
      __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
      __PYX_ERR(8, 870, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":866
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                 # ErrorResponse
 *                 exc = self.parse_error_message()
 */
      break;
      case 'R':

      /* "gel/protocol/protocol.pyx":873
 * 
 *             elif mtype == AUTH_REQUEST_MSG:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      goto __pyx_L15_break;

      /* "gel/protocol/protocol.pyx":872
 *                 raise exc
 * 
 *             elif mtype == AUTH_REQUEST_MSG:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      break;
      default:

      /* "gel/protocol/protocol.pyx":876
 * 
 *             else:
 *                 self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *         status = self.buffer.read_int32()
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 876, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      break;
    }
  }
  __pyx_L15_break:;

  /* "gel/protocol/protocol.pyx":878
 *                 self.fallthrough()
 * 
 *         status = self.buffer.read_int32()             # <<<<<<<<<<<<<<
 *         if status != AuthenticationStatuses.AUTH_SASL_CONTINUE:
 *             raise RuntimeError(
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 878, __pyx_L1_error)
  __pyx_cur_scope->__pyx_v_status = __pyx_t_1;

  /* "gel/protocol/protocol.pyx":879
 * 
 *         status = self.buffer.read_int32()
 *         if status != AuthenticationStatuses.AUTH_SASL_CONTINUE:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'expected SASLContinue from the server, received {status}')
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_status != __pyx_e_3gel_8protocol_8protocol_AUTH_SASL_CONTINUE);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/protocol.pyx":881
 *         if status != AuthenticationStatuses.AUTH_SASL_CONTINUE:
 *             raise RuntimeError(
 *                 f'expected SASLContinue from the server, received {status}')             # <<<<<<<<<<<<<<
 * 
 *         server_first = self.buffer.read_len_prefixed_bytes()
 */
    __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_cur_scope->__pyx_v_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_t_3, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_expected_SASLContinue_from_the_s, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "gel/protocol/protocol.pyx":880
 *         status = self.buffer.read_int32()
 *         if status != AuthenticationStatuses.AUTH_SASL_CONTINUE:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'expected SASLContinue from the server, received {status}')
 * 
 */
    __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_10, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __PYX_ERR(8, 880, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":879
 * 
 *         status = self.buffer.read_int32()
 *         if status != AuthenticationStatuses.AUTH_SASL_CONTINUE:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'expected SASLContinue from the server, received {status}')
 */
  }

  /* "gel/protocol/protocol.pyx":883
 *                 f'expected SASLContinue from the server, received {status}')
 * 
 *         server_first = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *         self.buffer.finish_message()
 * 
 */
  __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_cur_scope->__pyx_v_server_first = ((PyObject*)__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":884
 * 
 *         server_first = self.buffer.read_len_prefixed_bytes()
 *         self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         server_nonce, salt, itercount = (
 */
  __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":887
 * 
 *         server_nonce, salt, itercount = (
 *             scram.parse_server_first_message(server_first))             # <<<<<<<<<<<<<<
 * 
 *         client_final, expected_server_sig = scram.build_client_final_message(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_scram); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_parse_server_first_message); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_server_first};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
    PyObject* sequence = __pyx_t_10;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(8, 886, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_12 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_12);
    #else
    __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    #endif
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_15 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_15)) __PYX_ERR(8, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_15);
    index = 0; __pyx_t_8 = __pyx_t_13(__pyx_t_15); if (unlikely(!__pyx_t_8)) goto __pyx_L19_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    index = 1; __pyx_t_3 = __pyx_t_13(__pyx_t_15); if (unlikely(!__pyx_t_3)) goto __pyx_L19_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_12 = __pyx_t_13(__pyx_t_15); if (unlikely(!__pyx_t_12)) goto __pyx_L19_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_12);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_15), 3) < 0) __PYX_ERR(8, 886, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    goto __pyx_L20_unpacking_done;
    __pyx_L19_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(8, 886, __pyx_L1_error)
    __pyx_L20_unpacking_done:;
  }

  /* "gel/protocol/protocol.pyx":886
 *         self.buffer.finish_message()
 * 
 *         server_nonce, salt, itercount = (             # <<<<<<<<<<<<<<
 *             scram.parse_server_first_message(server_first))
 * 
 */
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_server_nonce = __pyx_t_8;
  __pyx_t_8 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_salt = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_cur_scope->__pyx_v_itercount = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "gel/protocol/protocol.pyx":889
 *             scram.parse_server_first_message(server_first))
 * 
 *         client_final, expected_server_sig = scram.build_client_final_message(             # <<<<<<<<<<<<<<
 *             self.con_params.password or '',
 *             salt,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_scram); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_build_client_final_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

  /* "gel/protocol/protocol.pyx":890
 * 
 *         client_final, expected_server_sig = scram.build_client_final_message(
 *             self.con_params.password or '',             # <<<<<<<<<<<<<<
 *             salt,
 *             itercount,
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->con_params, __pyx_n_s_password); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 890, __pyx_L1_error)
  if (!__pyx_t_2) {
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_12 = __pyx_t_8;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L21_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_kp_u_);
  __pyx_t_12 = __pyx_kp_u_;
  __pyx_L21_bool_binop_done:;

  /* "gel/protocol/protocol.pyx":893
 *             salt,
 *             itercount,
 *             client_first_bare.encode('utf-8'),             # <<<<<<<<<<<<<<
 *             server_first,
 *             server_nonce)
 */
  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_client_first_bare, __pyx_n_s_encode); if (unlikely(!__pyx_t_15)) __PYX_ERR(8, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_16 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(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_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_16, __pyx_kp_u_utf_8};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  }

  /* "gel/protocol/protocol.pyx":895
 *             client_first_bare.encode('utf-8'),
 *             server_first,
 *             server_nonce)             # <<<<<<<<<<<<<<
 * 
 *         msg_buf = WriteBuffer.new_message(AUTH_RESPONSE_MSG)
 */
  __pyx_t_15 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (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_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[7] = {__pyx_t_15, __pyx_t_12, __pyx_cur_scope->__pyx_v_salt, __pyx_cur_scope->__pyx_v_itercount, __pyx_t_8, __pyx_cur_scope->__pyx_v_server_first, __pyx_cur_scope->__pyx_v_server_nonce};
    __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 6+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
    PyObject* sequence = __pyx_t_10;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(8, 889, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_8);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    #endif
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_12 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12);
    index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L23_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __pyx_t_8 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_8)) goto __pyx_L23_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_8);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(8, 889, __pyx_L1_error)
    __pyx_t_13 = NULL;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L24_unpacking_done;
    __pyx_L23_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_13 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(8, 889, __pyx_L1_error)
    __pyx_L24_unpacking_done:;
  }

  /* "gel/protocol/protocol.pyx":889
 *             scram.parse_server_first_message(server_first))
 * 
 *         client_final, expected_server_sig = scram.build_client_final_message(             # <<<<<<<<<<<<<<
 *             self.con_params.password or '',
 *             salt,
 */
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_client_final = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_expected_server_sig = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "gel/protocol/protocol.pyx":897
 *             server_nonce)
 * 
 *         msg_buf = WriteBuffer.new_message(AUTH_RESPONSE_MSG)             # <<<<<<<<<<<<<<
 *         msg_buf.write_len_prefixed_utf8(client_final)
 *         msg_buf.end_message()
 */
  __pyx_t_10 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('r')); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 897, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_msg_buf);
  __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_msg_buf, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":898
 * 
 *         msg_buf = WriteBuffer.new_message(AUTH_RESPONSE_MSG)
 *         msg_buf.write_len_prefixed_utf8(client_final)             # <<<<<<<<<<<<<<
 *         msg_buf.end_message()
 *         self.write(msg_buf)
 */
  if (!(likely(PyUnicode_CheckExact(__pyx_cur_scope->__pyx_v_client_final))||((__pyx_cur_scope->__pyx_v_client_final) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_cur_scope->__pyx_v_client_final))) __PYX_ERR(8, 898, __pyx_L1_error)
  __pyx_t_10 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_cur_scope->__pyx_v_msg_buf, ((PyObject*)__pyx_cur_scope->__pyx_v_client_final)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":899
 *         msg_buf = WriteBuffer.new_message(AUTH_RESPONSE_MSG)
 *         msg_buf.write_len_prefixed_utf8(client_final)
 *         msg_buf.end_message()             # <<<<<<<<<<<<<<
 *         self.write(msg_buf)
 * 
 */
  __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_msg_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_msg_buf); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":900
 *         msg_buf.write_len_prefixed_utf8(client_final)
 *         msg_buf.end_message()
 *         self.write(msg_buf)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->write(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_msg_buf); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":902
 *         self.write(msg_buf)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol.pyx":903
 * 
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1))) __PYX_ERR(8, 903, __pyx_L1_error)
    __pyx_t_2 = (!(__pyx_t_1 != 0));
    if (__pyx_t_2) {

      /* "gel/protocol/protocol.pyx":904
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 904, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_3 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 904, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_10);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 2;
        return __pyx_r;
        __pyx_L28_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(8, 904, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(8, 904, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol.pyx":903
 * 
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol.pyx":905
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             if mtype == ERROR_RESPONSE_MSG:
 */
    __pyx_t_14 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 905, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_14;

    /* "gel/protocol/protocol.pyx":907
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()
 */
    switch (__pyx_cur_scope->__pyx_v_mtype) {
      case 'E':

      /* "gel/protocol/protocol.pyx":908
 * 
 *             if mtype == ERROR_RESPONSE_MSG:
 *                 exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                 self.buffer.finish_message()
 *                 raise exc
 */
      __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->parse_error_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 908, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      __pyx_cur_scope->__pyx_v_exc = __pyx_t_10;
      __pyx_t_10 = 0;

      /* "gel/protocol/protocol.pyx":909
 *             if mtype == ERROR_RESPONSE_MSG:
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 *                 raise exc
 * 
 */
      __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "gel/protocol/protocol.pyx":910
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()
 *                 raise exc             # <<<<<<<<<<<<<<
 * 
 *             elif mtype == AUTH_REQUEST_MSG:
 */
      __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
      __PYX_ERR(8, 910, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":907
 *             mtype = self.buffer.get_message_type()
 * 
 *             if mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                 exc = self.parse_error_message()
 *                 self.buffer.finish_message()
 */
      break;
      case 'R':

      /* "gel/protocol/protocol.pyx":913
 * 
 *             elif mtype == AUTH_REQUEST_MSG:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      goto __pyx_L26_break;

      /* "gel/protocol/protocol.pyx":912
 *                 raise exc
 * 
 *             elif mtype == AUTH_REQUEST_MSG:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      break;
      default:

      /* "gel/protocol/protocol.pyx":916
 * 
 *             else:
 *                 self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *         status = self.buffer.read_int32()
 */
      __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->fallthrough(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      break;
    }
  }
  __pyx_L26_break:;

  /* "gel/protocol/protocol.pyx":918
 *                 self.fallthrough()
 * 
 *         status = self.buffer.read_int32()             # <<<<<<<<<<<<<<
 *         if status != AuthenticationStatuses.AUTH_SASL_FINAL:
 *             raise RuntimeError(
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 918, __pyx_L1_error)
  __pyx_cur_scope->__pyx_v_status = __pyx_t_1;

  /* "gel/protocol/protocol.pyx":919
 * 
 *         status = self.buffer.read_int32()
 *         if status != AuthenticationStatuses.AUTH_SASL_FINAL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'expected SASLFinal from the server, received {status}')
 */
  __pyx_t_2 = (__pyx_cur_scope->__pyx_v_status != __pyx_e_3gel_8protocol_8protocol_AUTH_SASL_FINAL);
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/protocol.pyx":921
 *         if status != AuthenticationStatuses.AUTH_SASL_FINAL:
 *             raise RuntimeError(
 *                 f'expected SASLFinal from the server, received {status}')             # <<<<<<<<<<<<<<
 * 
 *         server_final = self.buffer.read_len_prefixed_bytes()
 */
    __pyx_t_10 = __Pyx_PyInt_From_int32_t(__pyx_cur_scope->__pyx_v_status); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_kp_u_expected_SASLFinal_from_the_serv, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 921, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "gel/protocol/protocol.pyx":920
 *         status = self.buffer.read_int32()
 *         if status != AuthenticationStatuses.AUTH_SASL_FINAL:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'expected SASLFinal from the server, received {status}')
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 920, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(8, 920, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":919
 * 
 *         status = self.buffer.read_int32()
 *         if status != AuthenticationStatuses.AUTH_SASL_FINAL:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'expected SASLFinal from the server, received {status}')
 */
  }

  /* "gel/protocol/protocol.pyx":923
 *                 f'expected SASLFinal from the server, received {status}')
 * 
 *         server_final = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *         self.buffer.finish_message()
 *         server_sig = scram.parse_server_final_message(server_final)
 */
  __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_server_final = ((PyObject*)__pyx_t_8);
  __pyx_t_8 = 0;

  /* "gel/protocol/protocol.pyx":924
 * 
 *         server_final = self.buffer.read_len_prefixed_bytes()
 *         self.buffer.finish_message()             # <<<<<<<<<<<<<<
 *         server_sig = scram.parse_server_final_message(server_final)
 * 
 */
  __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->buffer); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 924, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "gel/protocol/protocol.pyx":925
 *         server_final = self.buffer.read_len_prefixed_bytes()
 *         self.buffer.finish_message()
 *         server_sig = scram.parse_server_final_message(server_final)             # <<<<<<<<<<<<<<
 * 
 *         if server_sig != expected_server_sig:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_scram); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_parse_server_final_message); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  __pyx_t_11 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_11 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_cur_scope->__pyx_v_server_final};
    __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_server_sig = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "gel/protocol/protocol.pyx":927
 *         server_sig = scram.parse_server_final_message(server_final)
 * 
 *         if server_sig != expected_server_sig:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'server SCRAM proof does not match')
 */
  __pyx_t_8 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_server_sig, __pyx_cur_scope->__pyx_v_expected_server_sig, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 927, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 927, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "gel/protocol/protocol.pyx":928
 * 
 *         if server_sig != expected_server_sig:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'server SCRAM proof does not match')
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 928, __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(8, 928, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":927
 *         server_sig = scram.parse_server_final_message(server_final)
 * 
 *         if server_sig != expected_server_sig:             # <<<<<<<<<<<<<<
 *             raise RuntimeError(
 *                 f'server SCRAM proof does not match')
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol.pyx":829
 *             self.buffer.finish_message()
 * 
 *     async def _auth_sasl(self):             # <<<<<<<<<<<<<<
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("_auth_sasl", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":931
 *                 f'server SCRAM proof does not match')
 * 
 *     cdef parse_system_config(self, BaseCodec codec, bytes data):             # <<<<<<<<<<<<<<
 *         cdef:
 *             decode_row_method decoder = <decode_row_method>codec.decode
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_system_config(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_codec, PyObject *__pyx_v_data) {
  __pyx_t_3gel_8protocol_8protocol_decode_row_method __pyx_v_decoder;
  char const *__pyx_v_buf;
  Py_ssize_t __pyx_v_buf_len;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v__rbuf;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_rbuf;
  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("parse_system_config", 1);

  /* "gel/protocol/protocol.pyx":933
 *     cdef parse_system_config(self, BaseCodec codec, bytes data):
 *         cdef:
 *             decode_row_method decoder = <decode_row_method>codec.decode             # <<<<<<<<<<<<<<
 * 
 *             const char* buf
 */
  __pyx_v_decoder = ((__pyx_t_3gel_8protocol_8protocol_decode_row_method)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_codec->__pyx_vtab)->decode);

  /* "gel/protocol/protocol.pyx":939
 * 
 *             FRBuffer _rbuf
 *             FRBuffer *rbuf = &_rbuf             # <<<<<<<<<<<<<<
 * 
 *         buf = cpython.PyBytes_AS_STRING(data)
 */
  __pyx_v_rbuf = (&__pyx_v__rbuf);

  /* "gel/protocol/protocol.pyx":941
 *             FRBuffer *rbuf = &_rbuf
 * 
 *         buf = cpython.PyBytes_AS_STRING(data)             # <<<<<<<<<<<<<<
 *         buf_len = cpython.PyBytes_GET_SIZE(data)
 * 
 */
  __pyx_v_buf = PyBytes_AS_STRING(__pyx_v_data);

  /* "gel/protocol/protocol.pyx":942
 * 
 *         buf = cpython.PyBytes_AS_STRING(data)
 *         buf_len = cpython.PyBytes_GET_SIZE(data)             # <<<<<<<<<<<<<<
 * 
 *         frb_init(rbuf, buf, buf_len)
 */
  __pyx_v_buf_len = PyBytes_GET_SIZE(__pyx_v_data);

  /* "gel/protocol/protocol.pyx":944
 *         buf_len = cpython.PyBytes_GET_SIZE(data)
 * 
 *         frb_init(rbuf, buf, buf_len)             # <<<<<<<<<<<<<<
 * 
 *         return decoder(codec, rbuf)
 */
  __pyx_f_3gel_7pgproto_7pgproto_frb_init(__pyx_v_rbuf, __pyx_v_buf, __pyx_v_buf_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 944, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":946
 *         frb_init(rbuf, buf, buf_len)
 * 
 *         return decoder(codec, rbuf)             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_server_settings(self, str name, bytes val):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_decoder(__pyx_v_codec, __pyx_v_rbuf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":931
 *                 f'server SCRAM proof does not match')
 * 
 *     cdef parse_system_config(self, BaseCodec codec, bytes data):             # <<<<<<<<<<<<<<
 *         cdef:
 *             decode_row_method decoder = <decode_row_method>codec.decode
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_system_config", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":948
 *         return decoder(codec, rbuf)
 * 
 *     cdef parse_server_settings(self, str name, bytes val):             # <<<<<<<<<<<<<<
 *         if name == 'suggested_pool_concurrency':
 *             self.server_settings[name] = int(val.decode('utf-8'))
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_server_settings(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_val) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_v_buf = NULL;
  long __pyx_v_typedesc_len;
  PyObject *__pyx_v_typedesc_id = NULL;
  PyObject *__pyx_v_typedesc = NULL;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_codec = NULL;
  PyObject *__pyx_v_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int32_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_server_settings", 1);

  /* "gel/protocol/protocol.pyx":949
 * 
 *     cdef parse_server_settings(self, str name, bytes val):
 *         if name == 'suggested_pool_concurrency':             # <<<<<<<<<<<<<<
 *             self.server_settings[name] = int(val.decode('utf-8'))
 *         elif name == 'system_config':
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_suggested_pool_concurrency, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 949, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "gel/protocol/protocol.pyx":950
 *     cdef parse_server_settings(self, str name, bytes val):
 *         if name == 'suggested_pool_concurrency':
 *             self.server_settings[name] = int(val.decode('utf-8'))             # <<<<<<<<<<<<<<
 *         elif name == 'system_config':
 *             buf = ReadBuffer()
 */
    if (unlikely(__pyx_v_val == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
      __PYX_ERR(8, 950, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_decode_bytes(__pyx_v_val, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_v_self->server_settings == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(8, 950, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->server_settings, __pyx_v_name, __pyx_t_3) < 0))) __PYX_ERR(8, 950, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":949
 * 
 *     cdef parse_server_settings(self, str name, bytes val):
 *         if name == 'suggested_pool_concurrency':             # <<<<<<<<<<<<<<
 *             self.server_settings[name] = int(val.decode('utf-8'))
 *         elif name == 'system_config':
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/protocol.pyx":951
 *         if name == 'suggested_pool_concurrency':
 *             self.server_settings[name] = int(val.decode('utf-8'))
 *         elif name == 'system_config':             # <<<<<<<<<<<<<<
 *             buf = ReadBuffer()
 *             buf.feed_data(val)
 */
  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_name, __pyx_n_u_system_config, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 951, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "gel/protocol/protocol.pyx":952
 *             self.server_settings[name] = int(val.decode('utf-8'))
 *         elif name == 'system_config':
 *             buf = ReadBuffer()             # <<<<<<<<<<<<<<
 *             buf.feed_data(val)
 *             typedesc_len = buf.read_int32() - 16
 */
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 952, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":953
 *         elif name == 'system_config':
 *             buf = ReadBuffer()
 *             buf.feed_data(val)             # <<<<<<<<<<<<<<
 *             typedesc_len = buf.read_int32() - 16
 *             typedesc_id = buf.read_bytes(16)
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->feed_data(__pyx_v_buf, __pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":954
 *             buf = ReadBuffer()
 *             buf.feed_data(val)
 *             typedesc_len = buf.read_int32() - 16             # <<<<<<<<<<<<<<
 *             typedesc_id = buf.read_bytes(16)
 *             typedesc = buf.read_bytes(typedesc_len)
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->read_int32(__pyx_v_buf); if (unlikely(__pyx_t_4 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 954, __pyx_L1_error)
    __pyx_v_typedesc_len = (__pyx_t_4 - 16);

    /* "gel/protocol/protocol.pyx":955
 *             buf.feed_data(val)
 *             typedesc_len = buf.read_int32() - 16
 *             typedesc_id = buf.read_bytes(16)             # <<<<<<<<<<<<<<
 *             typedesc = buf.read_bytes(typedesc_len)
 * 
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->read_bytes(__pyx_v_buf, 16); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_typedesc_id = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":956
 *             typedesc_len = buf.read_int32() - 16
 *             typedesc_id = buf.read_bytes(16)
 *             typedesc = buf.read_bytes(typedesc_len)             # <<<<<<<<<<<<<<
 * 
 *             if self.internal_reg.has_codec(typedesc_id):
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->read_bytes(__pyx_v_buf, __pyx_v_typedesc_len); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_typedesc = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":958
 *             typedesc = buf.read_bytes(typedesc_len)
 * 
 *             if self.internal_reg.has_codec(typedesc_id):             # <<<<<<<<<<<<<<
 *                 codec = self.internal_reg.get_codec(typedesc_id)
 *             else:
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self->internal_reg->__pyx_vtab)->has_codec(__pyx_v_self->internal_reg, __pyx_v_typedesc_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 958, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "gel/protocol/protocol.pyx":959
 * 
 *             if self.internal_reg.has_codec(typedesc_id):
 *                 codec = self.internal_reg.get_codec(typedesc_id)             # <<<<<<<<<<<<<<
 *             else:
 *                 codec = self.internal_reg.build_codec(
 */
      __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self->internal_reg->__pyx_vtab)->get_codec(__pyx_v_self->internal_reg, __pyx_v_typedesc_id)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "gel/protocol/protocol.pyx":958
 *             typedesc = buf.read_bytes(typedesc_len)
 * 
 *             if self.internal_reg.has_codec(typedesc_id):             # <<<<<<<<<<<<<<
 *                 codec = self.internal_reg.get_codec(typedesc_id)
 *             else:
 */
      goto __pyx_L4;
    }

    /* "gel/protocol/protocol.pyx":961
 *                 codec = self.internal_reg.get_codec(typedesc_id)
 *             else:
 *                 codec = self.internal_reg.build_codec(             # <<<<<<<<<<<<<<
 *                     typedesc, self.protocol_version)
 * 
 */
    /*else*/ {

      /* "gel/protocol/protocol.pyx":962
 *             else:
 *                 codec = self.internal_reg.build_codec(
 *                     typedesc, self.protocol_version)             # <<<<<<<<<<<<<<
 * 
 *             data = buf.read_len_prefixed_bytes()
 */
      __pyx_t_3 = __pyx_v_self->protocol_version;
      __Pyx_INCREF(__pyx_t_3);

      /* "gel/protocol/protocol.pyx":961
 *                 codec = self.internal_reg.get_codec(typedesc_id)
 *             else:
 *                 codec = self.internal_reg.build_codec(             # <<<<<<<<<<<<<<
 *                     typedesc, self.protocol_version)
 * 
 */
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self->internal_reg->__pyx_vtab)->build_codec(__pyx_v_self->internal_reg, __pyx_v_typedesc, __pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 961, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2);
      __pyx_t_2 = 0;
    }
    __pyx_L4:;

    /* "gel/protocol/protocol.pyx":964
 *                     typedesc, self.protocol_version)
 * 
 *             data = buf.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *             self.server_settings[name] = self.parse_system_config(codec, data)
 *         else:
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_data = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":965
 * 
 *             data = buf.read_len_prefixed_bytes()
 *             self.server_settings[name] = self.parse_system_config(codec, data)             # <<<<<<<<<<<<<<
 *         else:
 *             self.server_settings[name] = val
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self->__pyx_vtab)->parse_system_config(__pyx_v_self, __pyx_v_codec, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_v_self->server_settings == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(8, 965, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->server_settings, __pyx_v_name, __pyx_t_2) < 0))) __PYX_ERR(8, 965, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":951
 *         if name == 'suggested_pool_concurrency':
 *             self.server_settings[name] = int(val.decode('utf-8'))
 *         elif name == 'system_config':             # <<<<<<<<<<<<<<
 *             buf = ReadBuffer()
 *             buf.feed_data(val)
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/protocol.pyx":967
 *             self.server_settings[name] = self.parse_system_config(codec, data)
 *         else:
 *             self.server_settings[name] = val             # <<<<<<<<<<<<<<
 * 
 *     cdef fallthrough(self):
 */
  /*else*/ {
    if (unlikely(__pyx_v_self->server_settings == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(8, 967, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__pyx_v_self->server_settings, __pyx_v_name, __pyx_v_val) < 0))) __PYX_ERR(8, 967, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "gel/protocol/protocol.pyx":948
 *         return decoder(codec, rbuf)
 * 
 *     cdef parse_server_settings(self, str name, bytes val):             # <<<<<<<<<<<<<<
 *         if name == 'suggested_pool_concurrency':
 *             self.server_settings[name] = int(val.decode('utf-8'))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_server_settings", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_typedesc_id);
  __Pyx_XDECREF(__pyx_v_typedesc);
  __Pyx_XDECREF((PyObject *)__pyx_v_codec);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":969
 *             self.server_settings[name] = val
 * 
 *     cdef fallthrough(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char mtype = self.buffer.get_message_type()
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_fallthrough(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  char __pyx_v_mtype;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_val = NULL;
  uint8_t __pyx_v_severity;
  uint32_t __pyx_v_code;
  PyObject *__pyx_v_message = NULL;
  PyObject *__pyx_v_msg = NULL;
  PyObject *__pyx_v_con = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int32_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fallthrough", 1);

  /* "gel/protocol/protocol.pyx":971
 *     cdef fallthrough(self):
 *         cdef:
 *             char mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *         if mtype == PARAMETER_STATUS_MSG:
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 971, __pyx_L1_error)
  __pyx_v_mtype = __pyx_t_1;

  /* "gel/protocol/protocol.pyx":973
 *             char mtype = self.buffer.get_message_type()
 * 
 *         if mtype == PARAMETER_STATUS_MSG:             # <<<<<<<<<<<<<<
 *             name = self.buffer.read_len_prefixed_utf8()
 *             val = self.buffer.read_len_prefixed_bytes()
 */
  switch (__pyx_v_mtype) {
    case 'S':

    /* "gel/protocol/protocol.pyx":974
 * 
 *         if mtype == PARAMETER_STATUS_MSG:
 *             name = self.buffer.read_len_prefixed_utf8()             # <<<<<<<<<<<<<<
 *             val = self.buffer.read_len_prefixed_bytes()
 *             self.buffer.finish_message()
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_utf8(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 974, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_name = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":975
 *         if mtype == PARAMETER_STATUS_MSG:
 *             name = self.buffer.read_len_prefixed_utf8()
 *             val = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *             self.buffer.finish_message()
 *             self.parse_server_settings(name, val)
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 975, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_val = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":976
 *             name = self.buffer.read_len_prefixed_utf8()
 *             val = self.buffer.read_len_prefixed_bytes()
 *             self.buffer.finish_message()             # <<<<<<<<<<<<<<
 *             self.parse_server_settings(name, val)
 * 
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":977
 *             val = self.buffer.read_len_prefixed_bytes()
 *             self.buffer.finish_message()
 *             self.parse_server_settings(name, val)             # <<<<<<<<<<<<<<
 * 
 *         elif mtype == LOG_MSG:
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self->__pyx_vtab)->parse_server_settings(__pyx_v_self, __pyx_v_name, __pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":973
 *             char mtype = self.buffer.get_message_type()
 * 
 *         if mtype == PARAMETER_STATUS_MSG:             # <<<<<<<<<<<<<<
 *             name = self.buffer.read_len_prefixed_utf8()
 *             val = self.buffer.read_len_prefixed_bytes()
 */
    break;
    case 'L':

    /* "gel/protocol/protocol.pyx":980
 * 
 *         elif mtype == LOG_MSG:
 *             severity = <uint8_t>self.buffer.read_byte()             # <<<<<<<<<<<<<<
 *             code = <uint32_t>self.buffer.read_int32()
 *             message = self.buffer.read_len_prefixed_utf8()
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_byte(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(8, 980, __pyx_L1_error)
    __pyx_v_severity = ((uint8_t)__pyx_t_1);

    /* "gel/protocol/protocol.pyx":981
 *         elif mtype == LOG_MSG:
 *             severity = <uint8_t>self.buffer.read_byte()
 *             code = <uint32_t>self.buffer.read_int32()             # <<<<<<<<<<<<<<
 *             message = self.buffer.read_len_prefixed_utf8()
 *             # Ignore any headers: not yet specified for log messages.
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 981, __pyx_L1_error)
    __pyx_v_code = ((uint32_t)__pyx_t_3);

    /* "gel/protocol/protocol.pyx":982
 *             severity = <uint8_t>self.buffer.read_byte()
 *             code = <uint32_t>self.buffer.read_int32()
 *             message = self.buffer.read_len_prefixed_utf8()             # <<<<<<<<<<<<<<
 *             # Ignore any headers: not yet specified for log messages.
 *             self.ignore_headers()
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_utf8(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 982, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_message = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":984
 *             message = self.buffer.read_len_prefixed_utf8()
 *             # Ignore any headers: not yet specified for log messages.
 *             self.ignore_headers()             # <<<<<<<<<<<<<<
 *             self.buffer.finish_message()
 * 
 */
    __pyx_t_2 = __pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":985
 *             # Ignore any headers: not yet specified for log messages.
 *             self.ignore_headers()
 *             self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *             msg = errors.EdgeDBMessage._from_code(code, severity, message)
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":987
 *             self.buffer.finish_message()
 * 
 *             msg = errors.EdgeDBMessage._from_code(code, severity, message)             # <<<<<<<<<<<<<<
 *             if self.con is not None:
 *                 con = self.con()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_EdgeDBMessage); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_from_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_code); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_From_uint8_t(__pyx_v_severity); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_5, __pyx_t_6, __pyx_v_message};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 987, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __pyx_v_msg = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":988
 * 
 *             msg = errors.EdgeDBMessage._from_code(code, severity, message)
 *             if self.con is not None:             # <<<<<<<<<<<<<<
 *                 con = self.con()
 *                 if con is not None:
 */
    __pyx_t_9 = (__pyx_v_self->con != Py_None);
    if (__pyx_t_9) {

      /* "gel/protocol/protocol.pyx":989
 *             msg = errors.EdgeDBMessage._from_code(code, severity, message)
 *             if self.con is not None:
 *                 con = self.con()             # <<<<<<<<<<<<<<
 *                 if con is not None:
 *                     con._on_log_message(msg)
 */
      __Pyx_INCREF(__pyx_v_self->con);
      __pyx_t_4 = __pyx_v_self->con; __pyx_t_6 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 989, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_v_con = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "gel/protocol/protocol.pyx":990
 *             if self.con is not None:
 *                 con = self.con()
 *                 if con is not None:             # <<<<<<<<<<<<<<
 *                     con._on_log_message(msg)
 * 
 */
      __pyx_t_9 = (__pyx_v_con != Py_None);
      if (__pyx_t_9) {

        /* "gel/protocol/protocol.pyx":991
 *                 con = self.con()
 *                 if con is not None:
 *                     con._on_log_message(msg)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_con, __pyx_n_s_on_log_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = NULL;
        __pyx_t_8 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_6)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
            __pyx_t_8 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_msg};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "gel/protocol/protocol.pyx":990
 *             if self.con is not None:
 *                 con = self.con()
 *                 if con is not None:             # <<<<<<<<<<<<<<
 *                     con._on_log_message(msg)
 * 
 */
      }

      /* "gel/protocol/protocol.pyx":988
 * 
 *             msg = errors.EdgeDBMessage._from_code(code, severity, message)
 *             if self.con is not None:             # <<<<<<<<<<<<<<
 *                 con = self.con()
 *                 if con is not None:
 */
    }

    /* "gel/protocol/protocol.pyx":979
 *             self.parse_server_settings(name, val)
 * 
 *         elif mtype == LOG_MSG:             # <<<<<<<<<<<<<<
 *             severity = <uint8_t>self.buffer.read_byte()
 *             code = <uint32_t>self.buffer.read_int32()
 */
    break;
    default:

    /* "gel/protocol/protocol.pyx":994
 * 
 *         else:
 *             self.abort()             # <<<<<<<<<<<<<<
 * 
 *             raise errors.ProtocolError(
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self->__pyx_vtab)->abort(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "gel/protocol/protocol.pyx":996
 *             self.abort()
 * 
 *             raise errors.ProtocolError(             # <<<<<<<<<<<<<<
 *                 f'unexpected message type {chr(mtype)!r}')
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProtocolError); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "gel/protocol/protocol.pyx":997
 * 
 *             raise errors.ProtocolError(
 *                 f'unexpected message type {chr(mtype)!r}')             # <<<<<<<<<<<<<<
 * 
 *     cdef encode_args(self, BaseCodec in_dc, WriteBuffer buf, args, kwargs):
 */
    __pyx_t_4 = __Pyx_PyInt_From_char(__pyx_v_mtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_chr, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_message_type, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 996, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(8, 996, __pyx_L1_error)
    break;
  }

  /* "gel/protocol/protocol.pyx":969
 *             self.server_settings[name] = val
 * 
 *     cdef fallthrough(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             char mtype = self.buffer.get_message_type()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.fallthrough", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_con);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":999
 *                 f'unexpected message type {chr(mtype)!r}')
 * 
 *     cdef encode_args(self, BaseCodec in_dc, WriteBuffer buf, args, kwargs):             # <<<<<<<<<<<<<<
 *         if args and kwargs:
 *             raise errors.QueryArgumentError(
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_args(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyTypeObject *__pyx_v_in_dc_type = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_i = NULL;
  PyObject *__pyx_8genexpr3__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode_args", 0);
  __Pyx_INCREF(__pyx_v_kwargs);

  /* "gel/protocol/protocol.pyx":1000
 * 
 *     cdef encode_args(self, BaseCodec in_dc, WriteBuffer buf, args, kwargs):
 *         if args and kwargs:             # <<<<<<<<<<<<<<
 *             raise errors.QueryArgumentError(
 *                 'either positional or named arguments are supported; '
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 1000, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 1000, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/protocol.pyx":1001
 *     cdef encode_args(self, BaseCodec in_dc, WriteBuffer buf, args, kwargs):
 *         if args and kwargs:
 *             raise errors.QueryArgumentError(             # <<<<<<<<<<<<<<
 *                 'either positional or named arguments are supported; '
 *                 'not both')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_QueryArgumentError); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_either_positional_or_named_argum};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1001, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(8, 1001, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":1000
 * 
 *     cdef encode_args(self, BaseCodec in_dc, WriteBuffer buf, args, kwargs):
 *         if args and kwargs:             # <<<<<<<<<<<<<<
 *             raise errors.QueryArgumentError(
 *                 'either positional or named arguments are supported; '
 */
  }

  /* "gel/protocol/protocol.pyx":1005
 *                 'not both')
 * 
 *         in_dc_type = type(in_dc)             # <<<<<<<<<<<<<<
 * 
 *         if in_dc_type is NullCodec:
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_in_dc))));
  __pyx_v_in_dc_type = ((PyTypeObject*)((PyObject *)Py_TYPE(((PyObject *)__pyx_v_in_dc))));

  /* "gel/protocol/protocol.pyx":1007
 *         in_dc_type = type(in_dc)
 * 
 *         if in_dc_type is NullCodec:             # <<<<<<<<<<<<<<
 *             if args:
 *                 raise errors.QueryArgumentError(
 */
  __pyx_t_1 = (__pyx_v_in_dc_type == __pyx_ptype_3gel_8protocol_8protocol_NullCodec);
  if (__pyx_t_1) {

    /* "gel/protocol/protocol.pyx":1008
 * 
 *         if in_dc_type is NullCodec:
 *             if args:             # <<<<<<<<<<<<<<
 *                 raise errors.QueryArgumentError(
 *                     'expected no positional arguments')
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1008, __pyx_L1_error)
    if (unlikely(__pyx_t_1)) {

      /* "gel/protocol/protocol.pyx":1009
 *         if in_dc_type is NullCodec:
 *             if args:
 *                 raise errors.QueryArgumentError(             # <<<<<<<<<<<<<<
 *                     'expected no positional arguments')
 *             if kwargs:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_QueryArgumentError); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1009, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_kp_u_expected_no_positional_arguments};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1009, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(8, 1009, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":1008
 * 
 *         if in_dc_type is NullCodec:
 *             if args:             # <<<<<<<<<<<<<<
 *                 raise errors.QueryArgumentError(
 *                     'expected no positional arguments')
 */
    }

    /* "gel/protocol/protocol.pyx":1011
 *                 raise errors.QueryArgumentError(
 *                     'expected no positional arguments')
 *             if kwargs:             # <<<<<<<<<<<<<<
 *                 raise errors.QueryArgumentError(
 *                     'expected no named arguments')
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1011, __pyx_L1_error)
    if (unlikely(__pyx_t_1)) {

      /* "gel/protocol/protocol.pyx":1012
 *                     'expected no positional arguments')
 *             if kwargs:
 *                 raise errors.QueryArgumentError(             # <<<<<<<<<<<<<<
 *                     'expected no named arguments')
 * 
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_errors); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_QueryArgumentError); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1012, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_kp_u_expected_no_named_arguments};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1012, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(8, 1012, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":1011
 *                 raise errors.QueryArgumentError(
 *                     'expected no positional arguments')
 *             if kwargs:             # <<<<<<<<<<<<<<
 *                 raise errors.QueryArgumentError(
 *                     'expected no named arguments')
 */
    }

    /* "gel/protocol/protocol.pyx":1015
 *                     'expected no named arguments')
 * 
 *             buf.write_bytes(EMPTY_NULL_DATA)             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_EMPTY_NULL_DATA); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(8, 1015, __pyx_L1_error)
    __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_v_buf, ((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "gel/protocol/protocol.pyx":1016
 * 
 *             buf.write_bytes(EMPTY_NULL_DATA)
 *             return             # <<<<<<<<<<<<<<
 * 
 *         if in_dc_type is not ObjectCodec:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "gel/protocol/protocol.pyx":1007
 *         in_dc_type = type(in_dc)
 * 
 *         if in_dc_type is NullCodec:             # <<<<<<<<<<<<<<
 *             if args:
 *                 raise errors.QueryArgumentError(
 */
  }

  /* "gel/protocol/protocol.pyx":1018
 *             return
 * 
 *         if in_dc_type is not ObjectCodec:             # <<<<<<<<<<<<<<
 *             raise errors.QueryArgumentError(
 *                 'unexpected query argument codec')
 */
  __pyx_t_1 = (__pyx_v_in_dc_type != __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec);
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/protocol.pyx":1019
 * 
 *         if in_dc_type is not ObjectCodec:
 *             raise errors.QueryArgumentError(             # <<<<<<<<<<<<<<
 *                 'unexpected query argument codec')
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_QueryArgumentError); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_unexpected_query_argument_codec};
      __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1019, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __PYX_ERR(8, 1019, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":1018
 *             return
 * 
 *         if in_dc_type is not ObjectCodec:             # <<<<<<<<<<<<<<
 *             raise errors.QueryArgumentError(
 *                 'unexpected query argument codec')
 */
  }

  /* "gel/protocol/protocol.pyx":1022
 *                 'unexpected query argument codec')
 * 
 *         if args:             # <<<<<<<<<<<<<<
 *             kwargs = {str(i): v for i, v in enumerate(args)}
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(8, 1022, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "gel/protocol/protocol.pyx":1023
 * 
 *         if args:
 *             kwargs = {str(i): v for i, v in enumerate(args)}             # <<<<<<<<<<<<<<
 * 
 *         (<ObjectCodec>in_dc).encode_args(buf, kwargs)
 */
    { /* enter inner scope */
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1023, __pyx_L13_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_int_0);
      __pyx_t_4 = __pyx_int_0;
      if (likely(PyList_CheckExact(__pyx_v_args)) || PyTuple_CheckExact(__pyx_v_args)) {
        __pyx_t_3 = __pyx_v_args; __Pyx_INCREF(__pyx_t_3);
        __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1023, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1023, __pyx_L13_error)
      }
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 1023, __pyx_L13_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(8, 1023, __pyx_L13_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1023, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          } else {
            {
              Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
              #if !CYTHON_ASSUME_SAFE_MACROS
              if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 1023, __pyx_L13_error)
              #endif
              if (__pyx_t_7 >= __pyx_temp) break;
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(8, 1023, __pyx_L13_error)
            #else
            __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1023, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_9);
            #endif
          }
        } else {
          __pyx_t_9 = __pyx_t_8(__pyx_t_3);
          if (unlikely(!__pyx_t_9)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(8, 1023, __pyx_L13_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_v, __pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_i, __pyx_t_4);
        __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1023, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4);
        __pyx_t_4 = __pyx_t_9;
        __pyx_t_9 = 0;
        __pyx_t_9 = __Pyx_PyObject_Unicode(__pyx_8genexpr3__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1023, __pyx_L13_error)
        __Pyx_GOTREF(__pyx_t_9);
        if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_9, (PyObject*)__pyx_8genexpr3__pyx_v_v))) __PYX_ERR(8, 1023, __pyx_L13_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i); __pyx_8genexpr3__pyx_v_i = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v); __pyx_8genexpr3__pyx_v_v = 0;
      goto __pyx_L17_exit_scope;
      __pyx_L13_error:;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i); __pyx_8genexpr3__pyx_v_i = 0;
      __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v); __pyx_8genexpr3__pyx_v_v = 0;
      goto __pyx_L1_error;
      __pyx_L17_exit_scope:;
    } /* exit inner scope */
    __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "gel/protocol/protocol.pyx":1022
 *                 'unexpected query argument codec')
 * 
 *         if args:             # <<<<<<<<<<<<<<
 *             kwargs = {str(i): v for i, v in enumerate(args)}
 * 
 */
  }

  /* "gel/protocol/protocol.pyx":1025
 *             kwargs = {str(i): v for i, v in enumerate(args)}
 * 
 *         (<ObjectCodec>in_dc).encode_args(buf, kwargs)             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_describe_type_message(self, ExecuteContext ctx):
 */
  if (!(likely(PyDict_CheckExact(__pyx_v_kwargs))||((__pyx_v_kwargs) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_v_kwargs))) __PYX_ERR(8, 1025, __pyx_L1_error)
  __pyx_t_5 = __pyx_f_3gel_8protocol_8protocol_11ObjectCodec_encode_args(((struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)__pyx_v_in_dc), __pyx_v_buf, ((PyObject*)__pyx_v_kwargs)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "gel/protocol/protocol.pyx":999
 *                 f'unexpected message type {chr(mtype)!r}')
 * 
 *     cdef encode_args(self, BaseCodec in_dc, WriteBuffer buf, args, kwargs):             # <<<<<<<<<<<<<<
 *         if args and kwargs:
 *             raise errors.QueryArgumentError(
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.encode_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_in_dc_type);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_i);
  __Pyx_XDECREF(__pyx_8genexpr3__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1027
 *         (<ObjectCodec>in_dc).encode_args(buf, kwargs)
 * 
 *     cdef parse_describe_type_message(self, ExecuteContext ctx):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == COMMAND_DATA_DESC_MSG
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_describe_type_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx) {
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_warnings = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_8genexpr4__pyx_v_w = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int64_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_describe_type_message", 1);

  /* "gel/protocol/protocol.pyx":1028
 * 
 *     cdef parse_describe_type_message(self, ExecuteContext ctx):
 *         assert self.buffer.get_message_type() == COMMAND_DATA_DESC_MSG             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1028, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 == 'T');
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(8, 1028, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(8, 1028, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol.pyx":1030
 *         assert self.buffer.get_message_type() == COMMAND_DATA_DESC_MSG
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             headers = self.read_headers()
 *             if headers and 'warnings' in headers:
 */
  /*try:*/ {

    /* "gel/protocol/protocol.pyx":1031
 * 
 *         try:
 *             headers = self.read_headers()             # <<<<<<<<<<<<<<
 *             if headers and 'warnings' in headers:
 *                 warnings = tuple([
 */
    __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_read_headers(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1031, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_headers = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":1032
 *         try:
 *             headers = self.read_headers()
 *             if headers and 'warnings' in headers:             # <<<<<<<<<<<<<<
 *                 warnings = tuple([
 *                     errors.EdgeDBError._from_json(w)
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_headers); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 1032, __pyx_L4_error)
    if (__pyx_t_4) {
    } else {
      __pyx_t_2 = __pyx_t_4;
      goto __pyx_L7_bool_binop_done;
    }
    if (unlikely(__pyx_v_headers == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(8, 1032, __pyx_L4_error)
    }
    __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_warnings, __pyx_v_headers, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(8, 1032, __pyx_L4_error)
    __pyx_t_2 = __pyx_t_4;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "gel/protocol/protocol.pyx":1033
 *             headers = self.read_headers()
 *             if headers and 'warnings' in headers:
 *                 warnings = tuple([             # <<<<<<<<<<<<<<
 *                     errors.EdgeDBError._from_json(w)
 *                     for w in json.loads(headers['warnings'])
 */
      { /* enter inner scope */
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1033, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_3);

        /* "gel/protocol/protocol.pyx":1035
 *                 warnings = tuple([
 *                     errors.EdgeDBError._from_json(w)
 *                     for w in json.loads(headers['warnings'])             # <<<<<<<<<<<<<<
 *                 ])
 *                 for w in warnings:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_json); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1035, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_loads); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1035, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(__pyx_v_headers == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(8, 1035, __pyx_L11_error)
        }
        __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_headers, __pyx_n_u_warnings); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1035, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_8 = NULL;
        __pyx_t_9 = 0;
        #if CYTHON_UNPACK_METHODS
        if (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_9 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
          __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1035, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_7 = __pyx_t_5; __Pyx_INCREF(__pyx_t_7);
          __pyx_t_10 = 0;
          __pyx_t_11 = NULL;
        } else {
          __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1035, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 1035, __pyx_L11_error)
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(!__pyx_t_11)) {
            if (likely(PyList_CheckExact(__pyx_t_7))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 1035, __pyx_L11_error)
                #endif
                if (__pyx_t_10 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(8, 1035, __pyx_L11_error)
              #else
              __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1035, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
                #if !CYTHON_ASSUME_SAFE_MACROS
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 1035, __pyx_L11_error)
                #endif
                if (__pyx_t_10 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(8, 1035, __pyx_L11_error)
              #else
              __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1035, __pyx_L11_error)
              __Pyx_GOTREF(__pyx_t_5);
              #endif
            }
          } else {
            __pyx_t_5 = __pyx_t_11(__pyx_t_7);
            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(8, 1035, __pyx_L11_error)
              }
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_w, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "gel/protocol/protocol.pyx":1034
 *             if headers and 'warnings' in headers:
 *                 warnings = tuple([
 *                     errors.EdgeDBError._from_json(w)             # <<<<<<<<<<<<<<
 *                     for w in json.loads(headers['warnings'])
 *                 ])
 */
          __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_errors); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1034, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_EdgeDBError); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 1034, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_from_json); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1034, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = NULL;
          __pyx_t_9 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_6))) {
            __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
            if (likely(__pyx_t_8)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
              __Pyx_INCREF(__pyx_t_8);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_6, function);
              __pyx_t_9 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_8genexpr4__pyx_v_w};
            __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1034, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          }
          if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(8, 1033, __pyx_L11_error)
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "gel/protocol/protocol.pyx":1035
 *                 warnings = tuple([
 *                     errors.EdgeDBError._from_json(w)
 *                     for w in json.loads(headers['warnings'])             # <<<<<<<<<<<<<<
 *                 ])
 *                 for w in warnings:
 */
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_w); __pyx_8genexpr4__pyx_v_w = 0;
        goto __pyx_L15_exit_scope;
        __pyx_L11_error:;
        __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_w); __pyx_8genexpr4__pyx_v_w = 0;
        goto __pyx_L4_error;
        __pyx_L15_exit_scope:;
      } /* exit inner scope */

      /* "gel/protocol/protocol.pyx":1033
 *             headers = self.read_headers()
 *             if headers and 'warnings' in headers:
 *                 warnings = tuple([             # <<<<<<<<<<<<<<
 *                     errors.EdgeDBError._from_json(w)
 *                     for w in json.loads(headers['warnings'])
 */
      __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1033, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_warnings = ((PyObject*)__pyx_t_7);
      __pyx_t_7 = 0;

      /* "gel/protocol/protocol.pyx":1037
 *                     for w in json.loads(headers['warnings'])
 *                 ])
 *                 for w in warnings:             # <<<<<<<<<<<<<<
 *                     w._query = ctx.query
 *                 ctx.warnings = warnings
 */
      __pyx_t_7 = __pyx_v_warnings; __Pyx_INCREF(__pyx_t_7);
      __pyx_t_10 = 0;
      for (;;) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
          #if !CYTHON_ASSUME_SAFE_MACROS
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(8, 1037, __pyx_L4_error)
          #endif
          if (__pyx_t_10 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(8, 1037, __pyx_L4_error)
        #else
        __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1037, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":1038
 *                 ])
 *                 for w in warnings:
 *                     w._query = ctx.query             # <<<<<<<<<<<<<<
 *                 ctx.warnings = warnings
 * 
 */
        __pyx_t_3 = __pyx_v_ctx->query;
        __Pyx_INCREF(__pyx_t_3);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_w, __pyx_n_s_query_2, __pyx_t_3) < 0) __PYX_ERR(8, 1038, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":1037
 *                     for w in json.loads(headers['warnings'])
 *                 ])
 *                 for w in warnings:             # <<<<<<<<<<<<<<
 *                     w._query = ctx.query
 *                 ctx.warnings = warnings
 */
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "gel/protocol/protocol.pyx":1039
 *                 for w in warnings:
 *                     w._query = ctx.query
 *                 ctx.warnings = warnings             # <<<<<<<<<<<<<<
 * 
 *             ctx.capabilities = self.buffer.read_int64()
 */
      __Pyx_INCREF(__pyx_v_warnings);
      __Pyx_GIVEREF(__pyx_v_warnings);
      __Pyx_GOTREF(__pyx_v_ctx->warnings);
      __Pyx_DECREF(__pyx_v_ctx->warnings);
      __pyx_v_ctx->warnings = __pyx_v_warnings;

      /* "gel/protocol/protocol.pyx":1032
 *         try:
 *             headers = self.read_headers()
 *             if headers and 'warnings' in headers:             # <<<<<<<<<<<<<<
 *                 warnings = tuple([
 *                     errors.EdgeDBError._from_json(w)
 */
    }

    /* "gel/protocol/protocol.pyx":1041
 *                 ctx.warnings = warnings
 * 
 *             ctx.capabilities = self.buffer.read_int64()             # <<<<<<<<<<<<<<
 *             ctx.cardinality = self.buffer.read_byte()
 *             ctx.in_dc, ctx.out_dc = self.parse_type_data(ctx.reg)
 */
    __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int64(__pyx_v_self->buffer); if (unlikely(__pyx_t_12 == ((int64_t)-1L) && PyErr_Occurred())) __PYX_ERR(8, 1041, __pyx_L4_error)
    __pyx_v_ctx->capabilities = __pyx_t_12;

    /* "gel/protocol/protocol.pyx":1042
 * 
 *             ctx.capabilities = self.buffer.read_int64()
 *             ctx.cardinality = self.buffer.read_byte()             # <<<<<<<<<<<<<<
 *             ctx.in_dc, ctx.out_dc = self.parse_type_data(ctx.reg)
 *         finally:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_byte(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(8, 1042, __pyx_L4_error)
    __pyx_t_7 = PyBytes_FromStringAndSize(&__pyx_t_1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1042, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_v_ctx->cardinality);
    __Pyx_DECREF(__pyx_v_ctx->cardinality);
    __pyx_v_ctx->cardinality = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "gel/protocol/protocol.pyx":1043
 *             ctx.capabilities = self.buffer.read_int64()
 *             ctx.cardinality = self.buffer.read_byte()
 *             ctx.in_dc, ctx.out_dc = self.parse_type_data(ctx.reg)             # <<<<<<<<<<<<<<
 *         finally:
 *             self.buffer.finish_message()
 */
    __pyx_t_7 = ((PyObject *)__pyx_v_ctx->reg);
    __Pyx_INCREF(__pyx_t_7);
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self->__pyx_vtab)->parse_type_data(__pyx_v_self, ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_t_7)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1043, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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(8, 1043, __pyx_L4_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 1043, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1043, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1043, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
      index = 0; __pyx_t_7 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 1; __pyx_t_5 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) __PYX_ERR(8, 1043, __pyx_L4_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L20_unpacking_done;
      __pyx_L19_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(8, 1043, __pyx_L4_error)
      __pyx_L20_unpacking_done:;
    }
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(8, 1043, __pyx_L4_error)
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(8, 1043, __pyx_L4_error)
    __Pyx_GIVEREF(__pyx_t_7);
    __Pyx_GOTREF((PyObject *)__pyx_v_ctx->in_dc);
    __Pyx_DECREF((PyObject *)__pyx_v_ctx->in_dc);
    __pyx_v_ctx->in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF((PyObject *)__pyx_v_ctx->out_dc);
    __Pyx_DECREF((PyObject *)__pyx_v_ctx->out_dc);
    __pyx_v_ctx->out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_5);
    __pyx_t_5 = 0;
  }

  /* "gel/protocol/protocol.pyx":1045
 *             ctx.in_dc, ctx.out_dc = self.parse_type_data(ctx.reg)
 *         finally:
 *             self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_describe_state_message(self):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1045, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 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;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_20);
      __Pyx_XGOTREF(__pyx_t_21);
      __Pyx_XGOTREF(__pyx_t_22);
      __pyx_t_14 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
      {
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1045, __pyx_L22_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_XGIVEREF(__pyx_t_22);
        __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
      }
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
      __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
      __pyx_lineno = __pyx_t_14; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
      goto __pyx_L1_error;
      __pyx_L22_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_20);
        __Pyx_XGIVEREF(__pyx_t_21);
        __Pyx_XGIVEREF(__pyx_t_22);
        __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
      }
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "gel/protocol/protocol.pyx":1027
 *         (<ObjectCodec>in_dc).encode_args(buf, kwargs)
 * 
 *     cdef parse_describe_type_message(self, ExecuteContext ctx):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == COMMAND_DATA_DESC_MSG
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_describe_type_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_warnings);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_8genexpr4__pyx_v_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1047
 *             self.buffer.finish_message()
 * 
 *     cdef parse_describe_state_message(self):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == STATE_DATA_DESC_MSG
 *         try:
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_describe_state_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_v_state_type_id = NULL;
  PyObject *__pyx_v_state_typedesc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  char const *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_describe_state_message", 1);

  /* "gel/protocol/protocol.pyx":1048
 * 
 *     cdef parse_describe_state_message(self):
 *         assert self.buffer.get_message_type() == STATE_DATA_DESC_MSG             # <<<<<<<<<<<<<<
 *         try:
 *             state_type_id = self.buffer.read_bytes(16)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1048, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 == 's');
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(8, 1048, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(8, 1048, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol.pyx":1049
 *     cdef parse_describe_state_message(self):
 *         assert self.buffer.get_message_type() == STATE_DATA_DESC_MSG
 *         try:             # <<<<<<<<<<<<<<
 *             state_type_id = self.buffer.read_bytes(16)
 *             state_typedesc = self.buffer.read_len_prefixed_bytes()
 */
  /*try:*/ {

    /* "gel/protocol/protocol.pyx":1050
 *         assert self.buffer.get_message_type() == STATE_DATA_DESC_MSG
 *         try:
 *             state_type_id = self.buffer.read_bytes(16)             # <<<<<<<<<<<<<<
 *             state_typedesc = self.buffer.read_len_prefixed_bytes()
 * 
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_bytes(__pyx_v_self->buffer, 16); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1050, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_state_type_id = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":1051
 *         try:
 *             state_type_id = self.buffer.read_bytes(16)
 *             state_typedesc = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 * 
 *             if state_type_id != self.state_type_id:
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1051, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_state_typedesc = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":1053
 *             state_typedesc = self.buffer.read_len_prefixed_bytes()
 * 
 *             if state_type_id != self.state_type_id:             # <<<<<<<<<<<<<<
 *                 self.state_type_id = state_type_id
 *                 self.state_cache = (None, None)
 */
    __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_state_type_id, __pyx_v_self->state_type_id, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 1053, __pyx_L4_error)
    if (__pyx_t_2) {

      /* "gel/protocol/protocol.pyx":1054
 * 
 *             if state_type_id != self.state_type_id:
 *                 self.state_type_id = state_type_id             # <<<<<<<<<<<<<<
 *                 self.state_cache = (None, None)
 *                 if self.internal_reg.has_codec(state_type_id):
 */
      __Pyx_INCREF(__pyx_v_state_type_id);
      __Pyx_GIVEREF(__pyx_v_state_type_id);
      __Pyx_GOTREF(__pyx_v_self->state_type_id);
      __Pyx_DECREF(__pyx_v_self->state_type_id);
      __pyx_v_self->state_type_id = __pyx_v_state_type_id;

      /* "gel/protocol/protocol.pyx":1055
 *             if state_type_id != self.state_type_id:
 *                 self.state_type_id = state_type_id
 *                 self.state_cache = (None, None)             # <<<<<<<<<<<<<<
 *                 if self.internal_reg.has_codec(state_type_id):
 *                     self.state_codec = self.internal_reg.get_codec(
 */
      __Pyx_INCREF(__pyx_tuple__55);
      __Pyx_GIVEREF(__pyx_tuple__55);
      __Pyx_GOTREF(__pyx_v_self->state_cache);
      __Pyx_DECREF(__pyx_v_self->state_cache);
      __pyx_v_self->state_cache = __pyx_tuple__55;

      /* "gel/protocol/protocol.pyx":1056
 *                 self.state_type_id = state_type_id
 *                 self.state_cache = (None, None)
 *                 if self.internal_reg.has_codec(state_type_id):             # <<<<<<<<<<<<<<
 *                     self.state_codec = self.internal_reg.get_codec(
 *                         state_type_id
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self->internal_reg->__pyx_vtab)->has_codec(__pyx_v_self->internal_reg, __pyx_v_state_type_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1056, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 1056, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_2) {

        /* "gel/protocol/protocol.pyx":1057
 *                 self.state_cache = (None, None)
 *                 if self.internal_reg.has_codec(state_type_id):
 *                     self.state_codec = self.internal_reg.get_codec(             # <<<<<<<<<<<<<<
 *                         state_type_id
 *                     )
 */
        __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self->internal_reg->__pyx_vtab)->get_codec(__pyx_v_self->internal_reg, __pyx_v_state_type_id)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1057, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GOTREF((PyObject *)__pyx_v_self->state_codec);
        __Pyx_DECREF((PyObject *)__pyx_v_self->state_codec);
        __pyx_v_self->state_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_3);
        __pyx_t_3 = 0;

        /* "gel/protocol/protocol.pyx":1056
 *                 self.state_type_id = state_type_id
 *                 self.state_cache = (None, None)
 *                 if self.internal_reg.has_codec(state_type_id):             # <<<<<<<<<<<<<<
 *                     self.state_codec = self.internal_reg.get_codec(
 *                         state_type_id
 */
        goto __pyx_L7;
      }

      /* "gel/protocol/protocol.pyx":1061
 *                     )
 *                 else:
 *                     self.state_codec = self.internal_reg.build_codec(             # <<<<<<<<<<<<<<
 *                         state_typedesc, self.protocol_version
 *                     )
 */
      /*else*/ {

        /* "gel/protocol/protocol.pyx":1062
 *                 else:
 *                     self.state_codec = self.internal_reg.build_codec(
 *                         state_typedesc, self.protocol_version             # <<<<<<<<<<<<<<
 *                     )
 *         finally:
 */
        __pyx_t_3 = __pyx_v_self->protocol_version;
        __Pyx_INCREF(__pyx_t_3);

        /* "gel/protocol/protocol.pyx":1061
 *                     )
 *                 else:
 *                     self.state_codec = self.internal_reg.build_codec(             # <<<<<<<<<<<<<<
 *                         state_typedesc, self.protocol_version
 *                     )
 */
        __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_self->internal_reg->__pyx_vtab)->build_codec(__pyx_v_self->internal_reg, __pyx_v_state_typedesc, __pyx_t_3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1061, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_GOTREF((PyObject *)__pyx_v_self->state_codec);
        __Pyx_DECREF((PyObject *)__pyx_v_self->state_codec);
        __pyx_v_self->state_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_4);
        __pyx_t_4 = 0;
      }
      __pyx_L7:;

      /* "gel/protocol/protocol.pyx":1053
 *             state_typedesc = self.buffer.read_len_prefixed_bytes()
 * 
 *             if state_type_id != self.state_type_id:             # <<<<<<<<<<<<<<
 *                 self.state_type_id = state_type_id
 *                 self.state_cache = (None, None)
 */
    }
  }

  /* "gel/protocol/protocol.pyx":1065
 *                     )
 *         finally:
 *             self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_type_data(self, CodecsRegistry reg):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1065, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename;
      {
        __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1065, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
      __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
      goto __pyx_L1_error;
      __pyx_L9_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "gel/protocol/protocol.pyx":1047
 *             self.buffer.finish_message()
 * 
 *     cdef parse_describe_state_message(self):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == STATE_DATA_DESC_MSG
 *         try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_describe_state_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state_type_id);
  __Pyx_XDECREF(__pyx_v_state_typedesc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1067
 *             self.buffer.finish_message()
 * 
 *     cdef parse_type_data(self, CodecsRegistry reg):             # <<<<<<<<<<<<<<
 *         cdef:
 *             bytes type_id
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_type_data(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg) {
  PyObject *__pyx_v_type_id = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc = 0;
  PyObject *__pyx_v_type_data = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_type_data", 1);

  /* "gel/protocol/protocol.pyx":1072
 *             BaseCodec in_dc, out_dc
 * 
 *         type_id = self.buffer.read_bytes(16)             # <<<<<<<<<<<<<<
 *         type_data = self.buffer.read_len_prefixed_bytes()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_bytes(__pyx_v_self->buffer, 16); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type_id = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":1073
 * 
 *         type_id = self.buffer.read_bytes(16)
 *         type_data = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 * 
 *         if reg.has_codec(type_id):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1073, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type_data = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":1075
 *         type_data = self.buffer.read_len_prefixed_bytes()
 * 
 *         if reg.has_codec(type_id):             # <<<<<<<<<<<<<<
 *             in_dc = reg.get_codec(type_id)
 *         else:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_reg->__pyx_vtab)->has_codec(__pyx_v_reg, __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(8, 1075, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "gel/protocol/protocol.pyx":1076
 * 
 *         if reg.has_codec(type_id):
 *             in_dc = reg.get_codec(type_id)             # <<<<<<<<<<<<<<
 *         else:
 *             in_dc = reg.build_codec(type_data, self.protocol_version)
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_reg->__pyx_vtab)->get_codec(__pyx_v_reg, __pyx_v_type_id)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":1075
 *         type_data = self.buffer.read_len_prefixed_bytes()
 * 
 *         if reg.has_codec(type_id):             # <<<<<<<<<<<<<<
 *             in_dc = reg.get_codec(type_id)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/protocol.pyx":1078
 *             in_dc = reg.get_codec(type_id)
 *         else:
 *             in_dc = reg.build_codec(type_data, self.protocol_version)             # <<<<<<<<<<<<<<
 * 
 *         type_id = self.buffer.read_bytes(16)
 */
  /*else*/ {
    __pyx_t_1 = __pyx_v_self->protocol_version;
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_reg->__pyx_vtab)->build_codec(__pyx_v_reg, __pyx_v_type_data, __pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1078, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "gel/protocol/protocol.pyx":1080
 *             in_dc = reg.build_codec(type_data, self.protocol_version)
 * 
 *         type_id = self.buffer.read_bytes(16)             # <<<<<<<<<<<<<<
 *         type_data = self.buffer.read_len_prefixed_bytes()
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_bytes(__pyx_v_self->buffer, 16); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_type_id, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1081
 * 
 *         type_id = self.buffer.read_bytes(16)
 *         type_data = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 * 
 *         if reg.has_codec(type_id):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_type_data, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1083
 *         type_data = self.buffer.read_len_prefixed_bytes()
 * 
 *         if reg.has_codec(type_id):             # <<<<<<<<<<<<<<
 *             out_dc = reg.get_codec(type_id)
 *         else:
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_reg->__pyx_vtab)->has_codec(__pyx_v_reg, __pyx_v_type_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1083, __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(8, 1083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "gel/protocol/protocol.pyx":1084
 * 
 *         if reg.has_codec(type_id):
 *             out_dc = reg.get_codec(type_id)             # <<<<<<<<<<<<<<
 *         else:
 *             out_dc = reg.build_codec(type_data, self.protocol_version)
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_reg->__pyx_vtab)->get_codec(__pyx_v_reg, __pyx_v_type_id)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":1083
 *         type_data = self.buffer.read_len_prefixed_bytes()
 * 
 *         if reg.has_codec(type_id):             # <<<<<<<<<<<<<<
 *             out_dc = reg.get_codec(type_id)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "gel/protocol/protocol.pyx":1086
 *             out_dc = reg.get_codec(type_id)
 *         else:
 *             out_dc = reg.build_codec(type_data, self.protocol_version)             # <<<<<<<<<<<<<<
 * 
 *         return in_dc, out_dc
 */
  /*else*/ {
    __pyx_t_3 = __pyx_v_self->protocol_version;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v_reg->__pyx_vtab)->build_codec(__pyx_v_reg, __pyx_v_type_data, __pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "gel/protocol/protocol.pyx":1088
 *             out_dc = reg.build_codec(type_data, self.protocol_version)
 * 
 *         return in_dc, out_dc             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_data_messages(self, BaseCodec out_dc, result):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF((PyObject *)__pyx_v_in_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_in_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_in_dc))) __PYX_ERR(8, 1088, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_out_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_v_out_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_out_dc))) __PYX_ERR(8, 1088, __pyx_L1_error);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":1067
 *             self.buffer.finish_message()
 * 
 *     cdef parse_type_data(self, CodecsRegistry reg):             # <<<<<<<<<<<<<<
 *         cdef:
 *             bytes type_id
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_type_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_type_id);
  __Pyx_XDECREF((PyObject *)__pyx_v_in_dc);
  __Pyx_XDECREF((PyObject *)__pyx_v_out_dc);
  __Pyx_XDECREF(__pyx_v_type_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1090
 *         return in_dc, out_dc
 * 
 *     cdef parse_data_messages(self, BaseCodec out_dc, result):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ReadBuffer buf = self.buffer
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_data_messages(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc, PyObject *__pyx_v_result) {
  struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *__pyx_v_buf = 0;
  __pyx_t_3gel_8protocol_8protocol_decode_row_method __pyx_v_decoder;
  __pyx_t_3gel_7pgproto_7pgproto_try_consume_message_method __pyx_v_try_consume_message;
  __pyx_t_3gel_7pgproto_7pgproto_take_message_type_method __pyx_v_take_message_type;
  char const *__pyx_v_cbuf;
  Py_ssize_t __pyx_v_cbuf_len;
  PyObject *__pyx_v_row = 0;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer __pyx_v__rbuf;
  struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *__pyx_v_rbuf;
  PyObject *__pyx_v_mem = NULL;
  int16_t __pyx_v_flen;
  int32_t __pyx_v_buflen;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  char __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int32_t __pyx_t_6;
  char const *__pyx_t_7;
  char const *__pyx_t_8;
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_data_messages", 1);

  /* "gel/protocol/protocol.pyx":1092
 *     cdef parse_data_messages(self, BaseCodec out_dc, result):
 *         cdef:
 *             ReadBuffer buf = self.buffer             # <<<<<<<<<<<<<<
 * 
 *             decode_row_method decoder = <decode_row_method>out_dc.decode
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->buffer);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":1094
 *             ReadBuffer buf = self.buffer
 * 
 *             decode_row_method decoder = <decode_row_method>out_dc.decode             # <<<<<<<<<<<<<<
 *             pgproto.try_consume_message_method try_consume_message = \
 *                 <pgproto.try_consume_message_method>buf.try_consume_message
 */
  __pyx_v_decoder = ((__pyx_t_3gel_8protocol_8protocol_decode_row_method)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec *)__pyx_v_out_dc->__pyx_vtab)->decode);

  /* "gel/protocol/protocol.pyx":1096
 *             decode_row_method decoder = <decode_row_method>out_dc.decode
 *             pgproto.try_consume_message_method try_consume_message = \
 *                 <pgproto.try_consume_message_method>buf.try_consume_message             # <<<<<<<<<<<<<<
 *             pgproto.take_message_type_method take_message_type = \
 *                 <pgproto.take_message_type_method>buf.take_message_type
 */
  __pyx_v_try_consume_message = ((__pyx_t_3gel_7pgproto_7pgproto_try_consume_message_method)((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->try_consume_message);

  /* "gel/protocol/protocol.pyx":1098
 *                 <pgproto.try_consume_message_method>buf.try_consume_message
 *             pgproto.take_message_type_method take_message_type = \
 *                 <pgproto.take_message_type_method>buf.take_message_type             # <<<<<<<<<<<<<<
 * 
 *             const char* cbuf
 */
  __pyx_v_take_message_type = ((__pyx_t_3gel_7pgproto_7pgproto_take_message_type_method)((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->take_message_type);

  /* "gel/protocol/protocol.pyx":1105
 * 
 *             FRBuffer _rbuf
 *             FRBuffer *rbuf = &_rbuf             # <<<<<<<<<<<<<<
 * 
 *         if PG_DEBUG:
 */
  __pyx_v_rbuf = (&__pyx_v__rbuf);

  /* "gel/protocol/protocol.pyx":1107
 *             FRBuffer *rbuf = &_rbuf
 * 
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if buf.get_message_type() != DATA_MSG:
 *                 raise RuntimeError('first message is not "DataMsg"')
 */
  __pyx_t_2 = (PG_DEBUG != 0);
  if (__pyx_t_2) {

    /* "gel/protocol/protocol.pyx":1108
 * 
 *         if PG_DEBUG:
 *             if buf.get_message_type() != DATA_MSG:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('first message is not "DataMsg"')
 * 
 */
    __pyx_t_3 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_buf); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1108, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 'D');
    if (unlikely(__pyx_t_2)) {

      /* "gel/protocol/protocol.pyx":1109
 *         if PG_DEBUG:
 *             if buf.get_message_type() != DATA_MSG:
 *                 raise RuntimeError('first message is not "DataMsg"')             # <<<<<<<<<<<<<<
 * 
 *             if not isinstance(result, list):
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1109, __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(8, 1109, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":1108
 * 
 *         if PG_DEBUG:
 *             if buf.get_message_type() != DATA_MSG:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError('first message is not "DataMsg"')
 * 
 */
    }

    /* "gel/protocol/protocol.pyx":1111
 *                 raise RuntimeError('first message is not "DataMsg"')
 * 
 *             if not isinstance(result, list):             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     f'result is not a list, but {result!r}')
 */
    __pyx_t_2 = PyList_Check(__pyx_v_result); 
    __pyx_t_4 = (!__pyx_t_2);
    if (unlikely(__pyx_t_4)) {

      /* "gel/protocol/protocol.pyx":1113
 *             if not isinstance(result, list):
 *                 raise RuntimeError(
 *                     f'result is not a list, but {result!r}')             # <<<<<<<<<<<<<<
 * 
 *         while take_message_type(buf, DATA_MSG):
 */
      __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_result), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_result_is_not_a_list_but, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":1112
 * 
 *             if not isinstance(result, list):
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     f'result is not a list, but {result!r}')
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(8, 1112, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":1111
 *                 raise RuntimeError('first message is not "DataMsg"')
 * 
 *             if not isinstance(result, list):             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     f'result is not a list, but {result!r}')
 */
    }

    /* "gel/protocol/protocol.pyx":1107
 *             FRBuffer *rbuf = &_rbuf
 * 
 *         if PG_DEBUG:             # <<<<<<<<<<<<<<
 *             if buf.get_message_type() != DATA_MSG:
 *                 raise RuntimeError('first message is not "DataMsg"')
 */
  }

  /* "gel/protocol/protocol.pyx":1115
 *                     f'result is not a list, but {result!r}')
 * 
 *         while take_message_type(buf, DATA_MSG):             # <<<<<<<<<<<<<<
 *             cbuf = try_consume_message(buf, &cbuf_len)
 *             if cbuf == NULL:
 */
  while (1) {
    __pyx_t_6 = __pyx_v_take_message_type(((PyObject *)__pyx_v_buf), 'D'); if (unlikely(__pyx_t_6 == ((int32_t)-1))) __PYX_ERR(8, 1115, __pyx_L1_error)
    __pyx_t_4 = (__pyx_t_6 != 0);
    if (!__pyx_t_4) break;

    /* "gel/protocol/protocol.pyx":1116
 * 
 *         while take_message_type(buf, DATA_MSG):
 *             cbuf = try_consume_message(buf, &cbuf_len)             # <<<<<<<<<<<<<<
 *             if cbuf == NULL:
 *                 mem = buf.consume_message()
 */
    __pyx_t_7 = __pyx_v_try_consume_message(((PyObject *)__pyx_v_buf), (&__pyx_v_cbuf_len)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1116, __pyx_L1_error)
    __pyx_v_cbuf = __pyx_t_7;

    /* "gel/protocol/protocol.pyx":1117
 *         while take_message_type(buf, DATA_MSG):
 *             cbuf = try_consume_message(buf, &cbuf_len)
 *             if cbuf == NULL:             # <<<<<<<<<<<<<<
 *                 mem = buf.consume_message()
 *                 cbuf = cpython.PyBytes_AS_STRING(mem)
 */
    __pyx_t_4 = (__pyx_v_cbuf == NULL);
    if (__pyx_t_4) {

      /* "gel/protocol/protocol.pyx":1118
 *             cbuf = try_consume_message(buf, &cbuf_len)
 *             if cbuf == NULL:
 *                 mem = buf.consume_message()             # <<<<<<<<<<<<<<
 *                 cbuf = cpython.PyBytes_AS_STRING(mem)
 *                 cbuf_len = cpython.PyBytes_GET_SIZE(mem)
 */
      __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_buf->__pyx_vtab)->consume_message(__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_mem, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "gel/protocol/protocol.pyx":1119
 *             if cbuf == NULL:
 *                 mem = buf.consume_message()
 *                 cbuf = cpython.PyBytes_AS_STRING(mem)             # <<<<<<<<<<<<<<
 *                 cbuf_len = cpython.PyBytes_GET_SIZE(mem)
 * 
 */
      __pyx_v_cbuf = PyBytes_AS_STRING(__pyx_v_mem);

      /* "gel/protocol/protocol.pyx":1120
 *                 mem = buf.consume_message()
 *                 cbuf = cpython.PyBytes_AS_STRING(mem)
 *                 cbuf_len = cpython.PyBytes_GET_SIZE(mem)             # <<<<<<<<<<<<<<
 * 
 *             if PG_DEBUG:
 */
      __pyx_v_cbuf_len = PyBytes_GET_SIZE(__pyx_v_mem);

      /* "gel/protocol/protocol.pyx":1117
 *         while take_message_type(buf, DATA_MSG):
 *             cbuf = try_consume_message(buf, &cbuf_len)
 *             if cbuf == NULL:             # <<<<<<<<<<<<<<
 *                 mem = buf.consume_message()
 *                 cbuf = cpython.PyBytes_AS_STRING(mem)
 */
    }

    /* "gel/protocol/protocol.pyx":1122
 *                 cbuf_len = cpython.PyBytes_GET_SIZE(mem)
 * 
 *             if PG_DEBUG:             # <<<<<<<<<<<<<<
 *                 frb_init(rbuf, cbuf, cbuf_len)
 * 
 */
    __pyx_t_4 = (PG_DEBUG != 0);
    if (__pyx_t_4) {

      /* "gel/protocol/protocol.pyx":1123
 * 
 *             if PG_DEBUG:
 *                 frb_init(rbuf, cbuf, cbuf_len)             # <<<<<<<<<<<<<<
 * 
 *                 flen = hton.unpack_int16(frb_read(rbuf, 2))
 */
      __pyx_f_3gel_7pgproto_7pgproto_frb_init(__pyx_v_rbuf, __pyx_v_cbuf, __pyx_v_cbuf_len); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1123, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":1125
 *                 frb_init(rbuf, cbuf, cbuf_len)
 * 
 *                 flen = hton.unpack_int16(frb_read(rbuf, 2))             # <<<<<<<<<<<<<<
 *                 if flen != 1:
 *                     raise RuntimeError(
 */
      __pyx_t_8 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_rbuf, 2); if (unlikely(__pyx_t_8 == ((char const *)NULL))) __PYX_ERR(8, 1125, __pyx_L1_error)
      __pyx_v_flen = unpack_int16(__pyx_t_8);

      /* "gel/protocol/protocol.pyx":1126
 * 
 *                 flen = hton.unpack_int16(frb_read(rbuf, 2))
 *                 if flen != 1:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'invalid number of columns: expected 1 got {flen}')
 */
      __pyx_t_4 = (__pyx_v_flen != 1);
      if (unlikely(__pyx_t_4)) {

        /* "gel/protocol/protocol.pyx":1128
 *                 if flen != 1:
 *                     raise RuntimeError(
 *                         f'invalid number of columns: expected 1 got {flen}')             # <<<<<<<<<<<<<<
 * 
 *                 buflen = hton.unpack_int32(frb_read(rbuf, 4))
 */
        __pyx_t_1 = __Pyx_PyInt_From_int16_t(__pyx_v_flen); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1128, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1128, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_invalid_number_of_columns_expect, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1128, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "gel/protocol/protocol.pyx":1127
 *                 flen = hton.unpack_int16(frb_read(rbuf, 2))
 *                 if flen != 1:
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'invalid number of columns: expected 1 got {flen}')
 * 
 */
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1127, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(8, 1127, __pyx_L1_error)

        /* "gel/protocol/protocol.pyx":1126
 * 
 *                 flen = hton.unpack_int16(frb_read(rbuf, 2))
 *                 if flen != 1:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError(
 *                         f'invalid number of columns: expected 1 got {flen}')
 */
      }

      /* "gel/protocol/protocol.pyx":1130
 *                         f'invalid number of columns: expected 1 got {flen}')
 * 
 *                 buflen = hton.unpack_int32(frb_read(rbuf, 4))             # <<<<<<<<<<<<<<
 *                 if frb_get_len(rbuf) != buflen:
 *                     raise RuntimeError('invalid buffer length')
 */
      __pyx_t_8 = __pyx_f_3gel_7pgproto_7pgproto_frb_read(__pyx_v_rbuf, 4); if (unlikely(__pyx_t_8 == ((char const *)NULL))) __PYX_ERR(8, 1130, __pyx_L1_error)
      __pyx_v_buflen = unpack_int32(__pyx_t_8);

      /* "gel/protocol/protocol.pyx":1131
 * 
 *                 buflen = hton.unpack_int32(frb_read(rbuf, 4))
 *                 if frb_get_len(rbuf) != buflen:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError('invalid buffer length')
 *             else:
 */
      __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len(__pyx_v_rbuf); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 1131, __pyx_L1_error)
      __pyx_t_4 = (__pyx_t_9 != __pyx_v_buflen);
      if (unlikely(__pyx_t_4)) {

        /* "gel/protocol/protocol.pyx":1132
 *                 buflen = hton.unpack_int32(frb_read(rbuf, 4))
 *                 if frb_get_len(rbuf) != buflen:
 *                     raise RuntimeError('invalid buffer length')             # <<<<<<<<<<<<<<
 *             else:
 *                 # EdgeDB returns rows with one column; Postgres' rows
 */
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_Raise(__pyx_t_5, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __PYX_ERR(8, 1132, __pyx_L1_error)

        /* "gel/protocol/protocol.pyx":1131
 * 
 *                 buflen = hton.unpack_int32(frb_read(rbuf, 4))
 *                 if frb_get_len(rbuf) != buflen:             # <<<<<<<<<<<<<<
 *                     raise RuntimeError('invalid buffer length')
 *             else:
 */
      }

      /* "gel/protocol/protocol.pyx":1122
 *                 cbuf_len = cpython.PyBytes_GET_SIZE(mem)
 * 
 *             if PG_DEBUG:             # <<<<<<<<<<<<<<
 *                 frb_init(rbuf, cbuf, cbuf_len)
 * 
 */
      goto __pyx_L9;
    }

    /* "gel/protocol/protocol.pyx":1139
 *                 #   4 bytes - int32 - every column is prefixed with its length
 *                 # so we want to skip first 6 bytes:
 *                 frb_init(rbuf, cbuf + 6, cbuf_len - 6)             # <<<<<<<<<<<<<<
 * 
 *             row = decoder(out_dc, rbuf)
 */
    /*else*/ {
      __pyx_f_3gel_7pgproto_7pgproto_frb_init(__pyx_v_rbuf, (__pyx_v_cbuf + 6), (__pyx_v_cbuf_len - 6)); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1139, __pyx_L1_error)
    }
    __pyx_L9:;

    /* "gel/protocol/protocol.pyx":1141
 *                 frb_init(rbuf, cbuf + 6, cbuf_len - 6)
 * 
 *             row = decoder(out_dc, rbuf)             # <<<<<<<<<<<<<<
 *             result.append(row)
 * 
 */
    __pyx_t_5 = __pyx_v_decoder(__pyx_v_out_dc, __pyx_v_rbuf); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1141, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "gel/protocol/protocol.pyx":1142
 * 
 *             row = decoder(out_dc, rbuf)
 *             result.append(row)             # <<<<<<<<<<<<<<
 * 
 *             if frb_get_len(rbuf):
 */
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_v_row); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(8, 1142, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":1144
 *             result.append(row)
 * 
 *             if frb_get_len(rbuf):             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     f'unexpected trailing data in buffer after '
 */
    __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len(__pyx_v_rbuf); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 1144, __pyx_L1_error)
    __pyx_t_4 = (__pyx_t_9 != 0);
    if (unlikely(__pyx_t_4)) {

      /* "gel/protocol/protocol.pyx":1147
 *                 raise RuntimeError(
 *                     f'unexpected trailing data in buffer after '
 *                     f'data message decoding: {frb_get_len(rbuf)}')             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_command_complete_message(self):
 */
      __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_frb_get_len(__pyx_v_rbuf); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 1147, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_9, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "gel/protocol/protocol.pyx":1146
 *             if frb_get_len(rbuf):
 *                 raise RuntimeError(
 *                     f'unexpected trailing data in buffer after '             # <<<<<<<<<<<<<<
 *                     f'data message decoding: {frb_get_len(rbuf)}')
 * 
 */
      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unexpected_trailing_data_in_buff_9, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "gel/protocol/protocol.pyx":1145
 * 
 *             if frb_get_len(rbuf):
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     f'unexpected trailing data in buffer after '
 *                     f'data message decoding: {frb_get_len(rbuf)}')
 */
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __PYX_ERR(8, 1145, __pyx_L1_error)

      /* "gel/protocol/protocol.pyx":1144
 *             result.append(row)
 * 
 *             if frb_get_len(rbuf):             # <<<<<<<<<<<<<<
 *                 raise RuntimeError(
 *                     f'unexpected trailing data in buffer after '
 */
    }
  }

  /* "gel/protocol/protocol.pyx":1090
 *         return in_dc, out_dc
 * 
 *     cdef parse_data_messages(self, BaseCodec out_dc, result):             # <<<<<<<<<<<<<<
 *         cdef:
 *             ReadBuffer buf = self.buffer
 */

  /* 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_5);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_data_messages", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_buf);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_mem);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1149
 *                     f'data message decoding: {frb_get_len(rbuf)}')
 * 
 *     cdef parse_command_complete_message(self):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG
 *         self.ignore_headers()
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_command_complete_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int64_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_command_complete_message", 1);

  /* "gel/protocol/protocol.pyx":1150
 * 
 *     cdef parse_command_complete_message(self):
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG             # <<<<<<<<<<<<<<
 *         self.ignore_headers()
 *         self.last_capabilities = enums.Capability(self.buffer.read_int64())
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1150, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 == 'C');
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(8, 1150, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(8, 1150, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol.pyx":1151
 *     cdef parse_command_complete_message(self):
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG
 *         self.ignore_headers()             # <<<<<<<<<<<<<<
 *         self.last_capabilities = enums.Capability(self.buffer.read_int64())
 *         self.last_status = self.buffer.read_len_prefixed_bytes()
 */
  __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1152
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG
 *         self.ignore_headers()
 *         self.last_capabilities = enums.Capability(self.buffer.read_int64())             # <<<<<<<<<<<<<<
 *         self.last_status = self.buffer.read_len_prefixed_bytes()
 *         self.buffer.read_bytes(16)  # state type id
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_enums); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Capability); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int64(__pyx_v_self->buffer); if (unlikely(__pyx_t_6 == ((int64_t)-1L) && PyErr_Occurred())) __PYX_ERR(8, 1152, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->last_capabilities);
  __Pyx_DECREF(__pyx_v_self->last_capabilities);
  __pyx_v_self->last_capabilities = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1153
 *         self.ignore_headers()
 *         self.last_capabilities = enums.Capability(self.buffer.read_int64())
 *         self.last_status = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *         self.buffer.read_bytes(16)  # state type id
 *         self.buffer.read_len_prefixed_bytes()  # state
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->last_status);
  __Pyx_DECREF(__pyx_v_self->last_status);
  __pyx_v_self->last_status = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1154
 *         self.last_capabilities = enums.Capability(self.buffer.read_int64())
 *         self.last_status = self.buffer.read_len_prefixed_bytes()
 *         self.buffer.read_bytes(16)  # state type id             # <<<<<<<<<<<<<<
 *         self.buffer.read_len_prefixed_bytes()  # state
 *         self.buffer.finish_message()
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_bytes(__pyx_v_self->buffer, 16); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1155
 *         self.last_status = self.buffer.read_len_prefixed_bytes()
 *         self.buffer.read_bytes(16)  # state type id
 *         self.buffer.read_len_prefixed_bytes()  # state             # <<<<<<<<<<<<<<
 *         self.buffer.finish_message()
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1156
 *         self.buffer.read_bytes(16)  # state type id
 *         self.buffer.read_len_prefixed_bytes()  # state
 *         self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_sync_message(self):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1149
 *                     f'data message decoding: {frb_get_len(rbuf)}')
 * 
 *     cdef parse_command_complete_message(self):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG
 *         self.ignore_headers()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_command_complete_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1158
 *         self.buffer.finish_message()
 * 
 *     cdef parse_sync_message(self):             # <<<<<<<<<<<<<<
 *         cdef char status
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_sync_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  char __pyx_v_status;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_sync_message", 1);

  /* "gel/protocol/protocol.pyx":1161
 *         cdef char status
 * 
 *         assert self.buffer.get_message_type() == READY_FOR_COMMAND_MSG             # <<<<<<<<<<<<<<
 * 
 *         self.ignore_headers()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1161, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 == 'Z');
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(8, 1161, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(8, 1161, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol.pyx":1163
 *         assert self.buffer.get_message_type() == READY_FOR_COMMAND_MSG
 * 
 *         self.ignore_headers()             # <<<<<<<<<<<<<<
 * 
 *         status = self.buffer.read_byte()
 */
  __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1165
 *         self.ignore_headers()
 * 
 *         status = self.buffer.read_byte()             # <<<<<<<<<<<<<<
 * 
 *         if status == TRANS_STATUS_IDLE:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_byte(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(8, 1165, __pyx_L1_error)
  __pyx_v_status = __pyx_t_1;

  /* "gel/protocol/protocol.pyx":1167
 *         status = self.buffer.read_byte()
 * 
 *         if status == TRANS_STATUS_IDLE:             # <<<<<<<<<<<<<<
 *             self.xact_status = TRANS_IDLE
 *         elif status == TRANS_STATUS_INTRANS:
 */
  switch (__pyx_v_status) {
    case 'I':

    /* "gel/protocol/protocol.pyx":1168
 * 
 *         if status == TRANS_STATUS_IDLE:
 *             self.xact_status = TRANS_IDLE             # <<<<<<<<<<<<<<
 *         elif status == TRANS_STATUS_INTRANS:
 *             self.xact_status = TRANS_INTRANS
 */
    __pyx_v_self->xact_status = __pyx_e_3gel_8protocol_8protocol_TRANS_IDLE;

    /* "gel/protocol/protocol.pyx":1167
 *         status = self.buffer.read_byte()
 * 
 *         if status == TRANS_STATUS_IDLE:             # <<<<<<<<<<<<<<
 *             self.xact_status = TRANS_IDLE
 *         elif status == TRANS_STATUS_INTRANS:
 */
    break;
    case 'T':

    /* "gel/protocol/protocol.pyx":1170
 *             self.xact_status = TRANS_IDLE
 *         elif status == TRANS_STATUS_INTRANS:
 *             self.xact_status = TRANS_INTRANS             # <<<<<<<<<<<<<<
 *         elif status == TRANS_STATUS_ERROR:
 *             self.xact_status = TRANS_INERROR
 */
    __pyx_v_self->xact_status = __pyx_e_3gel_8protocol_8protocol_TRANS_INTRANS;

    /* "gel/protocol/protocol.pyx":1169
 *         if status == TRANS_STATUS_IDLE:
 *             self.xact_status = TRANS_IDLE
 *         elif status == TRANS_STATUS_INTRANS:             # <<<<<<<<<<<<<<
 *             self.xact_status = TRANS_INTRANS
 *         elif status == TRANS_STATUS_ERROR:
 */
    break;
    case 'E':

    /* "gel/protocol/protocol.pyx":1172
 *             self.xact_status = TRANS_INTRANS
 *         elif status == TRANS_STATUS_ERROR:
 *             self.xact_status = TRANS_INERROR             # <<<<<<<<<<<<<<
 *         else:
 *             self.xact_status = TRANS_UNKNOWN
 */
    __pyx_v_self->xact_status = __pyx_e_3gel_8protocol_8protocol_TRANS_INERROR;

    /* "gel/protocol/protocol.pyx":1171
 *         elif status == TRANS_STATUS_INTRANS:
 *             self.xact_status = TRANS_INTRANS
 *         elif status == TRANS_STATUS_ERROR:             # <<<<<<<<<<<<<<
 *             self.xact_status = TRANS_INERROR
 *         else:
 */
    break;
    default:

    /* "gel/protocol/protocol.pyx":1174
 *             self.xact_status = TRANS_INERROR
 *         else:
 *             self.xact_status = TRANS_UNKNOWN             # <<<<<<<<<<<<<<
 * 
 *         self.buffer.finish_message()
 */
    __pyx_v_self->xact_status = __pyx_e_3gel_8protocol_8protocol_TRANS_UNKNOWN;
    break;
  }

  /* "gel/protocol/protocol.pyx":1176
 *             self.xact_status = TRANS_UNKNOWN
 * 
 *         self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef _amend_parse_error(
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->finish_message(__pyx_v_self->buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":1158
 *         self.buffer.finish_message()
 * 
 *     cdef parse_sync_message(self):             # <<<<<<<<<<<<<<
 *         cdef char status
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_sync_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1178
 *         self.buffer.finish_message()
 * 
 *     cdef _amend_parse_error(             # <<<<<<<<<<<<<<
 *         self,
 *         exc,
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol__amend_parse_error(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v_exc, enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format, int __pyx_v_expect_one, int __pyx_v_required_one) {
  PyObject *__pyx_v_methname = NULL;
  PyObject *__pyx_v_new_exc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  unsigned int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_UCS4 __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_amend_parse_error", 0);
  __Pyx_INCREF(__pyx_v_exc);

  /* "gel/protocol/protocol.pyx":1185
 *         bint required_one,
 *     ):
 *         if expect_one and exc.get_code() == result_cardinality_mismatch_code:             # <<<<<<<<<<<<<<
 *             assert output_format != OutputFormat.NONE
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 */
  if (__pyx_v_expect_one) {
  } else {
    __pyx_t_1 = __pyx_v_expect_one;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_exc, __pyx_n_s_get_code); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_3gel_8protocol_8protocol_result_cardinality_mismatch_code, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(8, 1185, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "gel/protocol/protocol.pyx":1186
 *     ):
 *         if expect_one and exc.get_code() == result_cardinality_mismatch_code:
 *             assert output_format != OutputFormat.NONE             # <<<<<<<<<<<<<<
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *             new_exc = errors.InterfaceError(
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_1 = (__pyx_v_output_format != __pyx_e_3gel_8protocol_8protocol_NONE);
      if (unlikely(!__pyx_t_1)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(8, 1186, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(8, 1186, __pyx_L1_error)
    #endif

    /* "gel/protocol/protocol.pyx":1187
 *         if expect_one and exc.get_code() == result_cardinality_mismatch_code:
 *             assert output_format != OutputFormat.NONE
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]             # <<<<<<<<<<<<<<
 *             new_exc = errors.InterfaceError(
 *                 f'query cannot be executed with {methname}() as it '
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_QUERY_SINGLE_METHOD); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_required_one, int, 1, __Pyx_PyBool_FromLong, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_v_output_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_methname = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "gel/protocol/protocol.pyx":1188
 *             assert output_format != OutputFormat.NONE
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *             new_exc = errors.InterfaceError(             # <<<<<<<<<<<<<<
 *                 f'query cannot be executed with {methname}() as it '
 *                 f'may return more than one element')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 1188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol.pyx":1189
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *             new_exc = errors.InterfaceError(
 *                 f'query cannot be executed with {methname}() as it '             # <<<<<<<<<<<<<<
 *                 f'may return more than one element')
 *             new_exc.__cause__ = exc
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_8 = 127;
    __Pyx_INCREF(__pyx_kp_u_query_cannot_be_executed_with);
    __pyx_t_7 += 30;
    __Pyx_GIVEREF(__pyx_kp_u_query_cannot_be_executed_with);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_query_cannot_be_executed_with);
    __pyx_t_9 = __Pyx_PyObject_FormatSimple(__pyx_v_methname, __pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_8) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_8;
    __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9);
    __pyx_t_9 = 0;
    __Pyx_INCREF(__pyx_kp_u_as_it_may_return_more_than_one);
    __pyx_t_7 += 41;
    __Pyx_GIVEREF(__pyx_kp_u_as_it_may_return_more_than_one);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u_as_it_may_return_more_than_one);
    __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 1189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_v_new_exc = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "gel/protocol/protocol.pyx":1191
 *                 f'query cannot be executed with {methname}() as it '
 *                 f'may return more than one element')
 *             new_exc.__cause__ = exc             # <<<<<<<<<<<<<<
 *             exc = new_exc
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_new_exc, __pyx_n_s_cause, __pyx_v_exc) < 0) __PYX_ERR(8, 1191, __pyx_L1_error)

    /* "gel/protocol/protocol.pyx":1192
 *                 f'may return more than one element')
 *             new_exc.__cause__ = exc
 *             exc = new_exc             # <<<<<<<<<<<<<<
 * 
 *         return exc
 */
    __Pyx_INCREF(__pyx_v_new_exc);
    __Pyx_DECREF_SET(__pyx_v_exc, __pyx_v_new_exc);

    /* "gel/protocol/protocol.pyx":1185
 *         bint required_one,
 *     ):
 *         if expect_one and exc.get_code() == result_cardinality_mismatch_code:             # <<<<<<<<<<<<<<
 *             assert output_format != OutputFormat.NONE
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 */
  }

  /* "gel/protocol/protocol.pyx":1194
 *             exc = new_exc
 * 
 *         return exc             # <<<<<<<<<<<<<<
 * 
 *     cdef dict parse_error_headers(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_exc);
  __pyx_r = __pyx_v_exc;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":1178
 *         self.buffer.finish_message()
 * 
 *     cdef _amend_parse_error(             # <<<<<<<<<<<<<<
 *         self,
 *         exc,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol._amend_parse_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_methname);
  __Pyx_XDECREF(__pyx_v_new_exc);
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1196
 *         return exc
 * 
 *     cdef dict parse_error_headers(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             dict attrs
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_error_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_v_attrs = 0;
  uint16_t __pyx_v_num_fields;
  uint16_t __pyx_v_key;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int16_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_error_headers", 1);

  /* "gel/protocol/protocol.pyx":1203
 *             bytes value
 * 
 *         attrs = {}             # <<<<<<<<<<<<<<
 *         num_fields = <uint16_t>self.buffer.read_int16()
 *         while num_fields:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_attrs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol.pyx":1204
 * 
 *         attrs = {}
 *         num_fields = <uint16_t>self.buffer.read_int16()             # <<<<<<<<<<<<<<
 *         while num_fields:
 *             key = <uint16_t>self.buffer.read_int16()
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_v_self->buffer); if (unlikely(__pyx_t_2 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 1204, __pyx_L1_error)
  __pyx_v_num_fields = ((uint16_t)__pyx_t_2);

  /* "gel/protocol/protocol.pyx":1205
 *         attrs = {}
 *         num_fields = <uint16_t>self.buffer.read_int16()
 *         while num_fields:             # <<<<<<<<<<<<<<
 *             key = <uint16_t>self.buffer.read_int16()
 *             value = self.buffer.read_len_prefixed_bytes()
 */
  while (1) {
    __pyx_t_3 = (__pyx_v_num_fields != 0);
    if (!__pyx_t_3) break;

    /* "gel/protocol/protocol.pyx":1206
 *         num_fields = <uint16_t>self.buffer.read_int16()
 *         while num_fields:
 *             key = <uint16_t>self.buffer.read_int16()             # <<<<<<<<<<<<<<
 *             value = self.buffer.read_len_prefixed_bytes()
 *             attrs[key] = value
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int16(__pyx_v_self->buffer); if (unlikely(__pyx_t_2 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 1206, __pyx_L1_error)
    __pyx_v_key = ((uint16_t)__pyx_t_2);

    /* "gel/protocol/protocol.pyx":1207
 *         while num_fields:
 *             key = <uint16_t>self.buffer.read_int16()
 *             value = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *             attrs[key] = value
 *             num_fields -= 1
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":1208
 *             key = <uint16_t>self.buffer.read_int16()
 *             value = self.buffer.read_len_prefixed_bytes()
 *             attrs[key] = value             # <<<<<<<<<<<<<<
 *             num_fields -= 1
 *         return attrs
 */
    __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely((PyDict_SetItem(__pyx_v_attrs, __pyx_t_1, __pyx_v_value) < 0))) __PYX_ERR(8, 1208, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/protocol.pyx":1209
 *             value = self.buffer.read_len_prefixed_bytes()
 *             attrs[key] = value
 *             num_fields -= 1             # <<<<<<<<<<<<<<
 *         return attrs
 * 
 */
    __pyx_v_num_fields = (__pyx_v_num_fields - 1);
  }

  /* "gel/protocol/protocol.pyx":1210
 *             attrs[key] = value
 *             num_fields -= 1
 *         return attrs             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_error_message(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_attrs);
  __pyx_r = __pyx_v_attrs;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":1196
 *         return exc
 * 
 *     cdef dict parse_error_headers(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             dict attrs
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_error_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attrs);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pyx":1212
 *         return attrs
 * 
 *     cdef parse_error_message(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t code
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_error_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  uint32_t __pyx_v_code;
  CYTHON_UNUSED uint8_t __pyx_v_severity;
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_v_attrs = NULL;
  PyObject *__pyx_v_exc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_t_2;
  int32_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  uint32_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_error_message", 1);

  /* "gel/protocol/protocol.pyx":1219
 *             str msg
 * 
 *         assert self.buffer.get_message_type() == ERROR_RESPONSE_MSG             # <<<<<<<<<<<<<<
 * 
 *         severity = <uint8_t>self.buffer.read_byte()
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_self->buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1219, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 == 'E');
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(8, 1219, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(8, 1219, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol.pyx":1221
 *         assert self.buffer.get_message_type() == ERROR_RESPONSE_MSG
 * 
 *         severity = <uint8_t>self.buffer.read_byte()             # <<<<<<<<<<<<<<
 *         code = <uint32_t>self.buffer.read_int32()
 *         msg = self.buffer.read_len_prefixed_utf8()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_byte(__pyx_v_self->buffer); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(8, 1221, __pyx_L1_error)
  __pyx_v_severity = ((uint8_t)__pyx_t_1);

  /* "gel/protocol/protocol.pyx":1222
 * 
 *         severity = <uint8_t>self.buffer.read_byte()
 *         code = <uint32_t>self.buffer.read_int32()             # <<<<<<<<<<<<<<
 *         msg = self.buffer.read_len_prefixed_utf8()
 *         attrs = self.parse_error_headers()
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_int32(__pyx_v_self->buffer); if (unlikely(__pyx_t_3 == ((int32_t)-1) && PyErr_Occurred())) __PYX_ERR(8, 1222, __pyx_L1_error)
  __pyx_v_code = ((uint32_t)__pyx_t_3);

  /* "gel/protocol/protocol.pyx":1223
 *         severity = <uint8_t>self.buffer.read_byte()
 *         code = <uint32_t>self.buffer.read_int32()
 *         msg = self.buffer.read_len_prefixed_utf8()             # <<<<<<<<<<<<<<
 *         attrs = self.parse_error_headers()
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->buffer->__pyx_vtab)->read_len_prefixed_utf8(__pyx_v_self->buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_msg = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":1224
 *         code = <uint32_t>self.buffer.read_int32()
 *         msg = self.buffer.read_len_prefixed_utf8()
 *         attrs = self.parse_error_headers()             # <<<<<<<<<<<<<<
 * 
 *         # It's safe to always map error codes as we don't reuse them
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self->__pyx_vtab)->parse_error_headers(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_attrs = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":1227
 * 
 *         # It's safe to always map error codes as we don't reuse them
 *         code = OLD_ERROR_CODES.get(code, code)             # <<<<<<<<<<<<<<
 * 
 *         exc = errors.EdgeDBError._from_code(code, msg)
 */
  if (unlikely(__pyx_v_3gel_8protocol_8protocol_OLD_ERROR_CODES == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(8, 1227, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_code); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_3gel_8protocol_8protocol_OLD_ERROR_CODES, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_6); if (unlikely((__pyx_t_7 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(8, 1227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_code = __pyx_t_7;

  /* "gel/protocol/protocol.pyx":1229
 *         code = OLD_ERROR_CODES.get(code, code)
 * 
 *         exc = errors.EdgeDBError._from_code(code, msg)             # <<<<<<<<<<<<<<
 *         exc._attrs = attrs
 *         return exc
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_errors); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_EdgeDBError); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_from_code); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 1229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_9 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_4, __pyx_v_msg};
    __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 1229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_v_exc = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "gel/protocol/protocol.pyx":1230
 * 
 *         exc = errors.EdgeDBError._from_code(code, msg)
 *         exc._attrs = attrs             # <<<<<<<<<<<<<<
 *         return exc
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_exc, __pyx_n_s_attrs, __pyx_v_attrs) < 0) __PYX_ERR(8, 1230, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":1231
 *         exc = errors.EdgeDBError._from_code(code, msg)
 *         exc._attrs = attrs
 *         return exc             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_exc);
  __pyx_r = __pyx_v_exc;
  goto __pyx_L0;

  /* "gel/protocol/protocol.pyx":1212
 *         return attrs
 * 
 *     cdef parse_error_message(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             uint32_t code
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.parse_error_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_attrs);
  __Pyx_XDECREF(__pyx_v_exc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pxd":111
 *         ReadBuffer buffer
 * 
 *         readonly bint connected             # <<<<<<<<<<<<<<
 *         readonly bint cancelled
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9connected_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9connected_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9connected___get__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9connected___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->connected); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.connected.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pxd":112
 * 
 *         readonly bint connected
 *         readonly bint cancelled             # <<<<<<<<<<<<<<
 * 
 *         object con
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9cancelled_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9cancelled_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9cancelled___get__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9cancelled___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.cancelled.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol.pxd":115
 * 
 *         object con
 *         readonly object con_params             # <<<<<<<<<<<<<<
 * 
 *         object backend_secret
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_10con_params_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_10con_params_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_10con_params___get__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_10con_params___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->con_params);
  __pyx_r = __pyx_v_self->con_params;
  goto __pyx_L0;

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

/* "gel/protocol/protocol.pxd":124
 *         dict server_settings
 * 
 *         readonly bytes last_status             # <<<<<<<<<<<<<<
 *         readonly bytes last_details
 *         readonly object last_capabilities
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_11last_status_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_11last_status_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_11last_status___get__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_11last_status___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->last_status);
  __pyx_r = __pyx_v_self->last_status;
  goto __pyx_L0;

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

/* "gel/protocol/protocol.pxd":125
 * 
 *         readonly bytes last_status
 *         readonly bytes last_details             # <<<<<<<<<<<<<<
 *         readonly object last_capabilities
 *         readonly tuple protocol_version
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_12last_details_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_12last_details_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_12last_details___get__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_12last_details___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->last_details);
  __pyx_r = __pyx_v_self->last_details;
  goto __pyx_L0;

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

/* "gel/protocol/protocol.pxd":126
 *         readonly bytes last_status
 *         readonly bytes last_details
 *         readonly object last_capabilities             # <<<<<<<<<<<<<<
 *         readonly tuple protocol_version
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_17last_capabilities_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_17last_capabilities_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_17last_capabilities___get__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_17last_capabilities___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->last_capabilities);
  __pyx_r = __pyx_v_self->last_capabilities;
  goto __pyx_L0;

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

/* "gel/protocol/protocol.pxd":127
 *         readonly bytes last_details
 *         readonly object last_capabilities
 *         readonly tuple protocol_version             # <<<<<<<<<<<<<<
 * 
 *         readonly bint is_legacy
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_16protocol_version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_16protocol_version_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_16protocol_version___get__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_16protocol_version___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->protocol_version);
  __pyx_r = __pyx_v_self->protocol_version;
  goto __pyx_L0;

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

/* "gel/protocol/protocol.pxd":129
 *         readonly tuple protocol_version
 * 
 *         readonly bint is_legacy             # <<<<<<<<<<<<<<
 * 
 *         bytes state_type_id
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9is_legacy_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9is_legacy_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9is_legacy___get__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_9is_legacy___get__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 1);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_legacy); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.is_legacy.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_55__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_55__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_55__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_55__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_54__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_54__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.backend_secret, self.buffer, self.cancelled, self.con, self.con_params, self.connected, self.internal_reg, self.is_legacy, self.last_capabilities, self.last_details, self.last_status, self.protocol_version, self.server_settings, self.state_cache, self.state_codec, self.state_type_id, self.xact_status)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->connected); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->is_legacy); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(__pyx_v_self->xact_status); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(17); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->backend_secret);
  __Pyx_GIVEREF(__pyx_v_self->backend_secret);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->backend_secret)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->buffer);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->buffer);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->buffer))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->con);
  __Pyx_GIVEREF(__pyx_v_self->con);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_self->con)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->con_params);
  __Pyx_GIVEREF(__pyx_v_self->con_params);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->con_params)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->internal_reg);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->internal_reg);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 6, ((PyObject *)__pyx_v_self->internal_reg))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->last_capabilities);
  __Pyx_GIVEREF(__pyx_v_self->last_capabilities);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_v_self->last_capabilities)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->last_details);
  __Pyx_GIVEREF(__pyx_v_self->last_details);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_v_self->last_details)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->last_status);
  __Pyx_GIVEREF(__pyx_v_self->last_status);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 10, __pyx_v_self->last_status)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->protocol_version);
  __Pyx_GIVEREF(__pyx_v_self->protocol_version);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 11, __pyx_v_self->protocol_version)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->server_settings);
  __Pyx_GIVEREF(__pyx_v_self->server_settings);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 12, __pyx_v_self->server_settings)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->state_cache);
  __Pyx_GIVEREF(__pyx_v_self->state_cache);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 13, __pyx_v_self->state_cache)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->state_codec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->state_codec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 14, ((PyObject *)__pyx_v_self->state_codec))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->state_type_id);
  __Pyx_GIVEREF(__pyx_v_self->state_type_id);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 15, __pyx_v_self->state_type_id)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 16, __pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.backend_secret, self.buffer, self.cancelled, self.con, self.con_params, self.connected, self.internal_reg, self.is_legacy, self.last_capabilities, self.last_details, self.last_status, self.protocol_version, self.server_settings, self.state_cache, self.state_codec, self.state_type_id, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v__dict = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "(tree fragment)":7
 *     state = (self.backend_secret, self.buffer, self.cancelled, self.con, self.con_params, self.connected, self.internal_reg, self.is_legacy, self.last_capabilities, self.last_details, self.last_status, self.protocol_version, self.server_settings, self.state_cache, self.state_codec, self.state_type_id, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_6 = (__pyx_v__dict != Py_None);
  if (__pyx_t_6) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.backend_secret, self.buffer, self.cancelled, self.con, self.con_params, self.connected, self.internal_reg, self.is_legacy, self.last_capabilities, self.last_details, self.last_status, self.protocol_version, self.server_settings, self.state_cache, self.state_codec, self.state_type_id, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, None), state
 */
  /*else*/ {
    __pyx_t_7 = (__pyx_v_self->backend_secret != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)__pyx_v_self->buffer) != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->con != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->con_params != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)__pyx_v_self->internal_reg) != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->last_capabilities != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->last_details != ((PyObject*)Py_None));
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->last_status != ((PyObject*)Py_None));
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->protocol_version != ((PyObject*)Py_None));
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->server_settings != ((PyObject*)Py_None));
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->state_cache != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)__pyx_v_self->state_codec) != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->state_type_id != ((PyObject*)Py_None));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_6;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None
 *     if use_setstate:
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_SansIOProtocol); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_94322648);
    __Pyx_GIVEREF(__pyx_int_94322648);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_94322648)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, None), state
 *     else:
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SansIOProtocol__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_SansIOProtocol); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_94322648);
    __Pyx_GIVEREF(__pyx_int_94322648);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_94322648)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SansIOProtocol__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_57__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_57__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_57__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_57__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_56__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_14SansIOProtocol_56__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SansIOProtocol__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_SansIOProtocol__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SansIOProtocol__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocol.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol_v0.pyx":32
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):
 *     async def _legacy_parse(             # <<<<<<<<<<<<<<
 *         self,
 *         query: str,
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_1_legacy_parse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_1_legacy_parse = {"_legacy_parse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_1_legacy_parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_1_legacy_parse(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_query = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg = 0;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format;
  PyObject *__pyx_v_expect_one = 0;
  PyObject *__pyx_v_required_one = 0;
  PyObject *__pyx_v_implicit_limit = 0;
  PyObject *__pyx_v_inline_typenames = 0;
  PyObject *__pyx_v_inline_typeids = 0;
  PyObject *__pyx_v_allow_capabilities = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_legacy_parse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_reg,&__pyx_n_s_output_format,&__pyx_n_s_expect_one,&__pyx_n_s_required_one,&__pyx_n_s_implicit_limit,&__pyx_n_s_inline_typenames,&__pyx_n_s_inline_typeids,&__pyx_n_s_allow_capabilities,0};

    /* "gel/protocol/protocol_v0.pyx":38
 *         reg: CodecsRegistry,
 *         output_format: OutputFormat=OutputFormat.BINARY,
 *         expect_one: bint=False,             # <<<<<<<<<<<<<<
 *         required_one: bool=False,
 *         implicit_limit: int=0,
 */
    values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));

    /* "gel/protocol/protocol_v0.pyx":39
 *         output_format: OutputFormat=OutputFormat.BINARY,
 *         expect_one: bint=False,
 *         required_one: bool=False,             # <<<<<<<<<<<<<<
 *         implicit_limit: int=0,
 *         inline_typenames: bool=False,
 */
    values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));
    values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k__84);

    /* "gel/protocol/protocol_v0.pyx":41
 *         required_one: bool=False,
 *         implicit_limit: int=0,
 *         inline_typenames: bool=False,             # <<<<<<<<<<<<<<
 *         inline_typeids: bool=False,
 *         allow_capabilities: typing.Optional[int] = None,
 */
    values[6] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));

    /* "gel/protocol/protocol_v0.pyx":42
 *         implicit_limit: int=0,
 *         inline_typenames: bool=False,
 *         inline_typeids: bool=False,             # <<<<<<<<<<<<<<
 *         allow_capabilities: typing.Optional[int] = None,
 *     ):
 */
    values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_False));

    /* "gel/protocol/protocol_v0.pyx":43
 *         inline_typenames: bool=False,
 *         inline_typeids: bool=False,
 *         allow_capabilities: typing.Optional[int] = None,             # <<<<<<<<<<<<<<
 *     ):
 *         cdef:
 */
    values[8] = __Pyx_Arg_NewRef_FASTCALL(((PyObject*)Py_None));
    if (likely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 32, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_reg)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 32, __pyx_L3_error)
        else {
          __Pyx_RaiseKeywordRequired("_legacy_parse", __pyx_n_s_reg); __PYX_ERR(19, 32, __pyx_L3_error)
        }
      }
      if (kw_args > 0 && likely(kw_args <= 7)) {
        Py_ssize_t index;
        for (index = 2; index < 9 && kw_args > 0; index++) {
          PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]);
          if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 32, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_legacy_parse") < 0)) __PYX_ERR(19, 32, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      __Pyx_RaiseKeywordRequired("_legacy_parse", __pyx_n_s_reg); __PYX_ERR(19, 32, __pyx_L3_error)
    }
    __pyx_v_query = ((PyObject*)values[0]);
    __pyx_v_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)values[1]);
    if (values[2]) {
      __pyx_v_output_format = ((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)__Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(values[2])); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 37, __pyx_L3_error)
    } else {
      __pyx_v_output_format = __pyx_k__85;
    }
    __pyx_v_expect_one = values[3];
    __pyx_v_required_one = values[4];
    __pyx_v_implicit_limit = ((PyObject*)values[5]);
    __pyx_v_inline_typenames = values[6];
    __pyx_v_inline_typeids = values[7];
    __pyx_v_allow_capabilities = ((PyObject*)values[8]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_legacy_parse", 1, 1, 1, __pyx_nargs); __PYX_ERR(19, 32, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible._legacy_parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 0, "query", 1))) __PYX_ERR(19, 34, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reg), __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry, 0, "reg", 0))) __PYX_ERR(19, 36, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_implicit_limit), (&PyInt_Type), 0, "implicit_limit", 1))) __PYX_ERR(19, 40, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_allow_capabilities), (&PyInt_Type), 1, "allow_capabilities", 1))) __PYX_ERR(19, 43, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible__legacy_parse(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self), __pyx_v_query, __pyx_v_reg, __pyx_v_output_format, __pyx_v_expect_one, __pyx_v_required_one, __pyx_v_implicit_limit, __pyx_v_inline_typenames, __pyx_v_inline_typeids, __pyx_v_allow_capabilities);

  /* "gel/protocol/protocol_v0.pyx":32
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):
 *     async def _legacy_parse(             # <<<<<<<<<<<<<<
 *         self,
 *         query: str,
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible__legacy_parse(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, PyObject *__pyx_v_query, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg, enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_v_output_format, PyObject *__pyx_v_expect_one, PyObject *__pyx_v_required_one, PyObject *__pyx_v_implicit_limit, PyObject *__pyx_v_inline_typenames, PyObject *__pyx_v_inline_typeids, PyObject *__pyx_v_allow_capabilities) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_legacy_parse", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(19, 32, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_query = __pyx_v_query;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query);
  __pyx_cur_scope->__pyx_v_reg = __pyx_v_reg;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_reg);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_reg);
  __pyx_cur_scope->__pyx_v_output_format = __pyx_v_output_format;
  __pyx_cur_scope->__pyx_v_expect_one = __pyx_v_expect_one;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_expect_one);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_expect_one);
  __pyx_cur_scope->__pyx_v_required_one = __pyx_v_required_one;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_required_one);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_required_one);
  __pyx_cur_scope->__pyx_v_implicit_limit = __pyx_v_implicit_limit;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_implicit_limit);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_implicit_limit);
  __pyx_cur_scope->__pyx_v_inline_typenames = __pyx_v_inline_typenames;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inline_typenames);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_inline_typenames);
  __pyx_cur_scope->__pyx_v_inline_typeids = __pyx_v_inline_typeids;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inline_typeids);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_inline_typeids);
  __pyx_cur_scope->__pyx_v_allow_capabilities = __pyx_v_allow_capabilities;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_allow_capabilities);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_allow_capabilities);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_2generator14, __pyx_codeobj__86, (PyObject *) __pyx_cur_scope, __pyx_n_s_legacy_parse, __pyx_n_s_SansIOProtocolBackwardsCompatibl, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(19, 32, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible._legacy_parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_2generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  uint64_t __pyx_t_5;
  int __pyx_t_6;
  uint64_t __pyx_t_7;
  char __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int32_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  char const *__pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_UCS4 __pyx_t_27;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_legacy_parse", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L8_resume_from_await;
    case 2: goto __pyx_L31_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 32, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":48
 *             WriteBuffer buf
 *             char mtype
 *             BaseCodec in_dc = None             # <<<<<<<<<<<<<<
 *             BaseCodec out_dc = None
 *             int16_t type_size
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);

  /* "gel/protocol/protocol_v0.pyx":49
 *             char mtype
 *             BaseCodec in_dc = None
 *             BaseCodec out_dc = None             # <<<<<<<<<<<<<<
 *             int16_t type_size
 *             bytes in_type_id
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None);

  /* "gel/protocol/protocol_v0.pyx":55
 *             bytes cardinality
 * 
 *         if not self.connected:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('not connected')
 * 
 */
  __pyx_t_1 = (!__pyx_cur_scope->__pyx_v_self->__pyx_base.connected);
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/protocol_v0.pyx":56
 * 
 *         if not self.connected:
 *             raise RuntimeError('not connected')             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(PREPARE_MSG)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 56, __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(19, 56, __pyx_L1_error)

    /* "gel/protocol/protocol_v0.pyx":55
 *             bytes cardinality
 * 
 *         if not self.connected:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('not connected')
 * 
 */
  }

  /* "gel/protocol/protocol_v0.pyx":58
 *             raise RuntimeError('not connected')
 * 
 *         buf = WriteBuffer.new_message(PREPARE_MSG)             # <<<<<<<<<<<<<<
 *         self.legacy_write_execute_headers(
 *             buf, implicit_limit, inline_typenames, inline_typeids,
 */
  __pyx_t_2 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('P')); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_cur_scope->__pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":60
 *         buf = WriteBuffer.new_message(PREPARE_MSG)
 *         self.legacy_write_execute_headers(
 *             buf, implicit_limit, inline_typenames, inline_typeids,             # <<<<<<<<<<<<<<
 *             ALL_CAPABILITIES if allow_capabilities is None
 *             else allow_capabilities)
 */
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_implicit_limit); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(19, 60, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_inline_typenames); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(19, 60, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_inline_typeids); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(19, 60, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":61
 *         self.legacy_write_execute_headers(
 *             buf, implicit_limit, inline_typenames, inline_typeids,
 *             ALL_CAPABILITIES if allow_capabilities is None             # <<<<<<<<<<<<<<
 *             else allow_capabilities)
 *         buf.write_byte(output_format)
 */
  __pyx_t_6 = (__pyx_cur_scope->__pyx_v_allow_capabilities == ((PyObject*)Py_None));
  if (__pyx_t_6) {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ALL_CAPABILITIES); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 61, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __pyx_t_7;
  } else {

    /* "gel/protocol/protocol_v0.pyx":62
 *             buf, implicit_limit, inline_typenames, inline_typeids,
 *             ALL_CAPABILITIES if allow_capabilities is None
 *             else allow_capabilities)             # <<<<<<<<<<<<<<
 *         buf.write_byte(output_format)
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)
 */
    __pyx_t_7 = __Pyx_PyInt_As_uint64_t(__pyx_cur_scope->__pyx_v_allow_capabilities); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 62, __pyx_L1_error)
    __pyx_t_5 = __pyx_t_7;
  }

  /* "gel/protocol/protocol_v0.pyx":59
 * 
 *         buf = WriteBuffer.new_message(PREPARE_MSG)
 *         self.legacy_write_execute_headers(             # <<<<<<<<<<<<<<
 *             buf, implicit_limit, inline_typenames, inline_typeids,
 *             ALL_CAPABILITIES if allow_capabilities is None
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->legacy_write_execute_headers(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_buf, __pyx_t_3, __pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":63
 *             ALL_CAPABILITIES if allow_capabilities is None
 *             else allow_capabilities)
 *         buf.write_byte(output_format)             # <<<<<<<<<<<<<<
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_output_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":64
 *             else allow_capabilities)
 *         buf.write_byte(output_format)
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)             # <<<<<<<<<<<<<<
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name
 *         buf.write_len_prefixed_utf8(query)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_expect_one); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(19, 64, __pyx_L1_error)
  if (__pyx_t_4) {
    __pyx_t_8 = 'o';
  } else {
    __pyx_t_8 = 'm';
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_cur_scope->__pyx_v_buf, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":65
 *         buf.write_byte(output_format)
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name             # <<<<<<<<<<<<<<
 *         buf.write_len_prefixed_utf8(query)
 *         buf.end_message()
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_len_prefixed_bytes(__pyx_cur_scope->__pyx_v_buf, __pyx_kp_b_); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":66
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name
 *         buf.write_len_prefixed_utf8(query)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)
 */
  __pyx_t_2 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":67
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name
 *         buf.write_len_prefixed_utf8(query)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 *         buf.write_bytes(SYNC_MESSAGE)
 *         self.write(buf)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":68
 *         buf.write_len_prefixed_utf8(query)
 *         buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *         self.write(buf)
 * 
 */
  __pyx_t_2 = __pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "gel/protocol/protocol_v0.pyx":69
 *         buf.end_message()
 *         buf.write_bytes(SYNC_MESSAGE)
 *         self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *         attrs = None
 */
  __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.write(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "gel/protocol/protocol_v0.pyx":71
 *         self.write(buf)
 * 
 *         attrs = None             # <<<<<<<<<<<<<<
 *         exc = None
 *         while True:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_attrs = ((PyObject*)Py_None);

  /* "gel/protocol/protocol_v0.pyx":72
 * 
 *         attrs = None
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol_v0.pyx":73
 *         attrs = None
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol_v0.pyx":74
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_10 == ((int32_t)-1))) __PYX_ERR(19, 74, __pyx_L1_error)
    __pyx_t_4 = (!(__pyx_t_10 != 0));
    if (__pyx_t_4) {

      /* "gel/protocol/protocol_v0.pyx":75
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 75, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_11 = NULL;
      __pyx_t_12 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_12 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
        __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_12, 0+__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 75, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L8_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 75, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(19, 75, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol_v0.pyx":74
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol_v0.pyx":76
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_8 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 76, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_8;

    /* "gel/protocol/protocol_v0.pyx":78
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == PREPARE_COMPLETE_MSG:
 *                     attrs = self.legacy_parse_headers()
 */
    /*try:*/ {

      /* "gel/protocol/protocol_v0.pyx":79
 * 
 *             try:
 *                 if mtype == PREPARE_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     attrs = self.legacy_parse_headers()
 *                     cardinality = self.buffer.read_byte()
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case '1':

        /* "gel/protocol/protocol_v0.pyx":80
 *             try:
 *                 if mtype == PREPARE_COMPLETE_MSG:
 *                     attrs = self.legacy_parse_headers()             # <<<<<<<<<<<<<<
 *                     cardinality = self.buffer.read_byte()
 *                     if self.protocol_version >= (0, 14):
 */
        __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->legacy_parse_headers(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 80, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_attrs);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_attrs, ((PyObject*)__pyx_t_9));
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;

        /* "gel/protocol/protocol_v0.pyx":81
 *                 if mtype == PREPARE_COMPLETE_MSG:
 *                     attrs = self.legacy_parse_headers()
 *                     cardinality = self.buffer.read_byte()             # <<<<<<<<<<<<<<
 *                     if self.protocol_version >= (0, 14):
 *                         in_dc, out_dc = self.parse_type_data(reg)
 */
        __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->read_byte(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_8 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(19, 81, __pyx_L12_error)
        __pyx_t_9 = PyBytes_FromStringAndSize(&__pyx_t_8, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 81, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_cardinality);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_cardinality, ((PyObject*)__pyx_t_9));
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;

        /* "gel/protocol/protocol_v0.pyx":82
 *                     attrs = self.legacy_parse_headers()
 *                     cardinality = self.buffer.read_byte()
 *                     if self.protocol_version >= (0, 14):             # <<<<<<<<<<<<<<
 *                         in_dc, out_dc = self.parse_type_data(reg)
 *                     else:
 */
        __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_self->__pyx_base.protocol_version, __pyx_tuple__87, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 82, __pyx_L12_error)
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(19, 82, __pyx_L12_error)
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_4) {

          /* "gel/protocol/protocol_v0.pyx":83
 *                     cardinality = self.buffer.read_byte()
 *                     if self.protocol_version >= (0, 14):
 *                         in_dc, out_dc = self.parse_type_data(reg)             # <<<<<<<<<<<<<<
 *                     else:
 *                         in_type_id = self.buffer.read_bytes(16)
 */
          __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_type_data(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_reg); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 83, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_9);
          if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
            PyObject* sequence = __pyx_t_9;
            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(19, 83, __pyx_L12_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_11 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_11);
            #else
            __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 83, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 83, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_11);
            #endif
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 83, __pyx_L12_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13);
            index = 0; __pyx_t_2 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_2)) goto __pyx_L15_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_2);
            index = 1; __pyx_t_11 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_11)) goto __pyx_L15_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_11);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(19, 83, __pyx_L12_error)
            __pyx_t_14 = NULL;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            goto __pyx_L16_unpacking_done;
            __pyx_L15_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_14 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(19, 83, __pyx_L12_error)
            __pyx_L16_unpacking_done:;
          }
          if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(19, 83, __pyx_L12_error)
          if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(19, 83, __pyx_L12_error)
          __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_in_dc, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2));
          __Pyx_GIVEREF(__pyx_t_2);
          __pyx_t_2 = 0;
          __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_out_dc, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_11));
          __Pyx_GIVEREF(__pyx_t_11);
          __pyx_t_11 = 0;

          /* "gel/protocol/protocol_v0.pyx":82
 *                     attrs = self.legacy_parse_headers()
 *                     cardinality = self.buffer.read_byte()
 *                     if self.protocol_version >= (0, 14):             # <<<<<<<<<<<<<<
 *                         in_dc, out_dc = self.parse_type_data(reg)
 *                     else:
 */
          goto __pyx_L14;
        }

        /* "gel/protocol/protocol_v0.pyx":85
 *                         in_dc, out_dc = self.parse_type_data(reg)
 *                     else:
 *                         in_type_id = self.buffer.read_bytes(16)             # <<<<<<<<<<<<<<
 *                         out_type_id = self.buffer.read_bytes(16)
 * 
 */
        /*else*/ {
          __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->read_bytes(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer, 16); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 85, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_in_type_id);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_in_type_id, ((PyObject*)__pyx_t_9));
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;

          /* "gel/protocol/protocol_v0.pyx":86
 *                     else:
 *                         in_type_id = self.buffer.read_bytes(16)
 *                         out_type_id = self.buffer.read_bytes(16)             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
          __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->read_bytes(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer, 16); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 86, __pyx_L12_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_out_type_id);
          __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_out_type_id, ((PyObject*)__pyx_t_9));
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_9 = 0;
        }
        __pyx_L14:;

        /* "gel/protocol/protocol_v0.pyx":79
 * 
 *             try:
 *                 if mtype == PREPARE_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     attrs = self.legacy_parse_headers()
 *                     cardinality = self.buffer.read_byte()
 */
        break;
        case 'E':

        /* "gel/protocol/protocol_v0.pyx":89
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                     exc = self._amend_parse_error(
 *                         exc, output_format, expect_one, required_one)
 */
        __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_error_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 89, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;

        /* "gel/protocol/protocol_v0.pyx":91
 *                     exc = self.parse_error_message()
 *                     exc = self._amend_parse_error(
 *                         exc, output_format, expect_one, required_one)             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 */
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_expect_one); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(19, 91, __pyx_L12_error)
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_required_one); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(19, 91, __pyx_L12_error)

        /* "gel/protocol/protocol_v0.pyx":90
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 *                     exc = self._amend_parse_error(             # <<<<<<<<<<<<<<
 *                         exc, output_format, expect_one, required_one)
 * 
 */
        __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._amend_parse_error(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_exc, __pyx_cur_scope->__pyx_v_output_format, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 90, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        __pyx_t_9 = 0;

        /* "gel/protocol/protocol_v0.pyx":88
 *                         out_type_id = self.buffer.read_bytes(16)
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 *                     exc = self._amend_parse_error(
 */
        break;
        case 'Z':

        /* "gel/protocol/protocol_v0.pyx":94
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
        __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_sync_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 94, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "gel/protocol/protocol_v0.pyx":95
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
        goto __pyx_L10_break;

        /* "gel/protocol/protocol_v0.pyx":93
 *                         exc, output_format, expect_one, required_one)
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_sync_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol_v0.pyx":98
 * 
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 *             finally:
 *                 self.buffer.finish_message()
 */
        __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.fallthrough(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 98, __pyx_L12_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol_v0.pyx":100
 *                     self.fallthrough()
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 100, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L13;
      }
      __pyx_L12_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
        __Pyx_XGOTREF(__pyx_t_17);
        __Pyx_XGOTREF(__pyx_t_18);
        __Pyx_XGOTREF(__pyx_t_19);
        __Pyx_XGOTREF(__pyx_t_20);
        __Pyx_XGOTREF(__pyx_t_21);
        __Pyx_XGOTREF(__pyx_t_22);
        __pyx_t_3 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
        {
          __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 100, __pyx_L20_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
        }
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
        __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
        __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
        goto __pyx_L1_error;
        __pyx_L20_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
        }
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L10_break: {
        __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 100, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L6_break;
      }
      __pyx_L13:;
    }
  }
  __pyx_L6_break:;

  /* "gel/protocol/protocol_v0.pyx":102
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_1)) {

    /* "gel/protocol/protocol_v0.pyx":103
 * 
 *         if exc is not None:
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *         if self.protocol_version < (0, 14):
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(19, 103, __pyx_L1_error)

    /* "gel/protocol/protocol_v0.pyx":102
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  }

  /* "gel/protocol/protocol_v0.pyx":105
 *             raise exc
 * 
 *         if self.protocol_version < (0, 14):             # <<<<<<<<<<<<<<
 *             if reg.has_codec(in_type_id):
 *                 in_dc = reg.get_codec(in_type_id)
 */
  __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_self->__pyx_base.protocol_version, __pyx_tuple__87, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 105, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_1) {

    /* "gel/protocol/protocol_v0.pyx":106
 * 
 *         if self.protocol_version < (0, 14):
 *             if reg.has_codec(in_type_id):             # <<<<<<<<<<<<<<
 *                 in_dc = reg.get_codec(in_type_id)
 *             if reg.has_codec(out_type_id):
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_in_type_id)) { __Pyx_RaiseUnboundLocalError("in_type_id"); __PYX_ERR(19, 106, __pyx_L1_error) }
    __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_cur_scope->__pyx_v_reg->__pyx_vtab)->has_codec(__pyx_cur_scope->__pyx_v_reg, __pyx_cur_scope->__pyx_v_in_type_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 106, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_1) {

      /* "gel/protocol/protocol_v0.pyx":107
 *         if self.protocol_version < (0, 14):
 *             if reg.has_codec(in_type_id):
 *                 in_dc = reg.get_codec(in_type_id)             # <<<<<<<<<<<<<<
 *             if reg.has_codec(out_type_id):
 *                 out_dc = reg.get_codec(out_type_id)
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_in_type_id)) { __Pyx_RaiseUnboundLocalError("in_type_id"); __PYX_ERR(19, 107, __pyx_L1_error) }
      __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_cur_scope->__pyx_v_reg->__pyx_vtab)->get_codec(__pyx_cur_scope->__pyx_v_reg, __pyx_cur_scope->__pyx_v_in_type_id)); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_in_dc, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9));
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;

      /* "gel/protocol/protocol_v0.pyx":106
 * 
 *         if self.protocol_version < (0, 14):
 *             if reg.has_codec(in_type_id):             # <<<<<<<<<<<<<<
 *                 in_dc = reg.get_codec(in_type_id)
 *             if reg.has_codec(out_type_id):
 */
    }

    /* "gel/protocol/protocol_v0.pyx":108
 *             if reg.has_codec(in_type_id):
 *                 in_dc = reg.get_codec(in_type_id)
 *             if reg.has_codec(out_type_id):             # <<<<<<<<<<<<<<
 *                 out_dc = reg.get_codec(out_type_id)
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_out_type_id)) { __Pyx_RaiseUnboundLocalError("out_type_id"); __PYX_ERR(19, 108, __pyx_L1_error) }
    __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_cur_scope->__pyx_v_reg->__pyx_vtab)->has_codec(__pyx_cur_scope->__pyx_v_reg, __pyx_cur_scope->__pyx_v_out_type_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 108, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_1) {

      /* "gel/protocol/protocol_v0.pyx":109
 *                 in_dc = reg.get_codec(in_type_id)
 *             if reg.has_codec(out_type_id):
 *                 out_dc = reg.get_codec(out_type_id)             # <<<<<<<<<<<<<<
 * 
 *             if in_dc is None or out_dc is None:
 */
      if (unlikely(!__pyx_cur_scope->__pyx_v_out_type_id)) { __Pyx_RaiseUnboundLocalError("out_type_id"); __PYX_ERR(19, 109, __pyx_L1_error) }
      __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_cur_scope->__pyx_v_reg->__pyx_vtab)->get_codec(__pyx_cur_scope->__pyx_v_reg, __pyx_cur_scope->__pyx_v_out_type_id)); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 109, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_out_dc, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9));
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;

      /* "gel/protocol/protocol_v0.pyx":108
 *             if reg.has_codec(in_type_id):
 *                 in_dc = reg.get_codec(in_type_id)
 *             if reg.has_codec(out_type_id):             # <<<<<<<<<<<<<<
 *                 out_dc = reg.get_codec(out_type_id)
 * 
 */
    }

    /* "gel/protocol/protocol_v0.pyx":111
 *                 out_dc = reg.get_codec(out_type_id)
 * 
 *             if in_dc is None or out_dc is None:             # <<<<<<<<<<<<<<
 *                 buf = WriteBuffer.new_message(DESCRIBE_STMT_MSG)
 *                 buf.write_int16(0)  # no headers
 */
    __pyx_t_4 = (((PyObject *)__pyx_cur_scope->__pyx_v_in_dc) == Py_None);
    if (!__pyx_t_4) {
    } else {
      __pyx_t_1 = __pyx_t_4;
      goto __pyx_L26_bool_binop_done;
    }
    __pyx_t_4 = (((PyObject *)__pyx_cur_scope->__pyx_v_out_dc) == Py_None);
    __pyx_t_1 = __pyx_t_4;
    __pyx_L26_bool_binop_done:;
    if (__pyx_t_1) {

      /* "gel/protocol/protocol_v0.pyx":112
 * 
 *             if in_dc is None or out_dc is None:
 *                 buf = WriteBuffer.new_message(DESCRIBE_STMT_MSG)             # <<<<<<<<<<<<<<
 *                 buf.write_int16(0)  # no headers
 *                 buf.write_byte(DESCRIBE_ASPECT_DATA)
 */
      __pyx_t_9 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('D')); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_buf);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_buf, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_9));
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_9 = 0;

      /* "gel/protocol/protocol_v0.pyx":113
 *             if in_dc is None or out_dc is None:
 *                 buf = WriteBuffer.new_message(DESCRIBE_STMT_MSG)
 *                 buf.write_int16(0)  # no headers             # <<<<<<<<<<<<<<
 *                 buf.write_byte(DESCRIBE_ASPECT_DATA)
 *                 buf.write_len_prefixed_bytes(b'')  # stmt_name
 */
      __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_buf, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "gel/protocol/protocol_v0.pyx":114
 *                 buf = WriteBuffer.new_message(DESCRIBE_STMT_MSG)
 *                 buf.write_int16(0)  # no headers
 *                 buf.write_byte(DESCRIBE_ASPECT_DATA)             # <<<<<<<<<<<<<<
 *                 buf.write_len_prefixed_bytes(b'')  # stmt_name
 *                 buf.end_message()
 */
      __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_cur_scope->__pyx_v_buf, 'T'); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 114, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "gel/protocol/protocol_v0.pyx":115
 *                 buf.write_int16(0)  # no headers
 *                 buf.write_byte(DESCRIBE_ASPECT_DATA)
 *                 buf.write_len_prefixed_bytes(b'')  # stmt_name             # <<<<<<<<<<<<<<
 *                 buf.end_message()
 *                 buf.write_bytes(SYNC_MESSAGE)
 */
      __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_len_prefixed_bytes(__pyx_cur_scope->__pyx_v_buf, __pyx_kp_b_); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "gel/protocol/protocol_v0.pyx":116
 *                 buf.write_byte(DESCRIBE_ASPECT_DATA)
 *                 buf.write_len_prefixed_bytes(b'')  # stmt_name
 *                 buf.end_message()             # <<<<<<<<<<<<<<
 *                 buf.write_bytes(SYNC_MESSAGE)
 *                 self.write(buf)
 */
      __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "gel/protocol/protocol_v0.pyx":117
 *                 buf.write_len_prefixed_bytes(b'')  # stmt_name
 *                 buf.end_message()
 *                 buf.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *                 self.write(buf)
 * 
 */
      __pyx_t_9 = __pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE;
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_9)); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "gel/protocol/protocol_v0.pyx":118
 *                 buf.end_message()
 *                 buf.write_bytes(SYNC_MESSAGE)
 *                 self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *                 while True:
 */
      __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.write(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "gel/protocol/protocol_v0.pyx":120
 *                 self.write(buf)
 * 
 *                 while True:             # <<<<<<<<<<<<<<
 *                     if not self.buffer.take_message():
 *                         await self.wait_for_message()
 */
      while (1) {

        /* "gel/protocol/protocol_v0.pyx":121
 * 
 *                 while True:
 *                     if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                         await self.wait_for_message()
 *                     mtype = self.buffer.get_message_type()
 */
        __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_10 == ((int32_t)-1))) __PYX_ERR(19, 121, __pyx_L1_error)
        __pyx_t_1 = (!(__pyx_t_10 != 0));
        if (__pyx_t_1) {

          /* "gel/protocol/protocol_v0.pyx":122
 *                 while True:
 *                     if not self.buffer.take_message():
 *                         await self.wait_for_message()             # <<<<<<<<<<<<<<
 *                     mtype = self.buffer.get_message_type()
 * 
 */
          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 122, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = NULL;
          __pyx_t_12 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_9))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_9, function);
              __pyx_t_12 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
            __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_12, 0+__pyx_t_12);
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 122, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XGOTREF(__pyx_r);
          if (likely(__pyx_r)) {
            __Pyx_XGIVEREF(__pyx_r);
            __Pyx_RefNannyFinishContext();
            __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
            /* return from generator, awaiting value */
            __pyx_generator->resume_label = 2;
            return __pyx_r;
            __pyx_L31_resume_from_await:;
            if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 122, __pyx_L1_error)
          } else {
            PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
              else __PYX_ERR(19, 122, __pyx_L1_error)
            }
          }

          /* "gel/protocol/protocol_v0.pyx":121
 * 
 *                 while True:
 *                     if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                         await self.wait_for_message()
 *                     mtype = self.buffer.get_message_type()
 */
        }

        /* "gel/protocol/protocol_v0.pyx":123
 *                     if not self.buffer.take_message():
 *                         await self.wait_for_message()
 *                     mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *                     try:
 */
        __pyx_t_8 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 123, __pyx_L1_error)
        __pyx_cur_scope->__pyx_v_mtype = __pyx_t_8;

        /* "gel/protocol/protocol_v0.pyx":125
 *                     mtype = self.buffer.get_message_type()
 * 
 *                     try:             # <<<<<<<<<<<<<<
 *                         if mtype == STMT_DATA_DESC_MSG:
 *                             cardinality, in_dc, out_dc, _ = \
 */
        /*try:*/ {

          /* "gel/protocol/protocol_v0.pyx":126
 * 
 *                     try:
 *                         if mtype == STMT_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                             cardinality, in_dc, out_dc, _ = \
 *                                 self.parse_legacy_describe_type_message(reg)
 */
          switch (__pyx_cur_scope->__pyx_v_mtype) {
            case 'T':

            /* "gel/protocol/protocol_v0.pyx":128
 *                         if mtype == STMT_DATA_DESC_MSG:
 *                             cardinality, in_dc, out_dc, _ = \
 *                                 self.parse_legacy_describe_type_message(reg)             # <<<<<<<<<<<<<<
 * 
 *                         elif mtype == ERROR_RESPONSE_MSG:
 */
            __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->parse_legacy_describe_type_message(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_reg); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 128, __pyx_L35_error)
            __Pyx_GOTREF(__pyx_t_11);
            if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
              PyObject* sequence = __pyx_t_11;
              Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
              if (unlikely(size != 4)) {
                if (size > 4) __Pyx_RaiseTooManyValuesError(4);
                else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                __PYX_ERR(19, 127, __pyx_L35_error)
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              if (likely(PyTuple_CheckExact(sequence))) {
                __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
                __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
                __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2); 
                __pyx_t_23 = PyTuple_GET_ITEM(sequence, 3); 
              } else {
                __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
                __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
                __pyx_t_13 = PyList_GET_ITEM(sequence, 2); 
                __pyx_t_23 = PyList_GET_ITEM(sequence, 3); 
              }
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_23);
              #else
              {
                Py_ssize_t i;
                PyObject** temps[4] = {&__pyx_t_9,&__pyx_t_2,&__pyx_t_13,&__pyx_t_23};
                for (i=0; i < 4; i++) {
                  PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(19, 127, __pyx_L35_error)
                  __Pyx_GOTREF(item);
                  *(temps[i]) = item;
                }
              }
              #endif
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            } else {
              Py_ssize_t index = -1;
              PyObject** temps[4] = {&__pyx_t_9,&__pyx_t_2,&__pyx_t_13,&__pyx_t_23};
              __pyx_t_24 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_24)) __PYX_ERR(19, 127, __pyx_L35_error)
              __Pyx_GOTREF(__pyx_t_24);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_24);
              for (index=0; index < 4; index++) {
                PyObject* item = __pyx_t_14(__pyx_t_24); if (unlikely(!item)) goto __pyx_L37_unpacking_failed;
                __Pyx_GOTREF(item);
                *(temps[index]) = item;
              }
              if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_24), 4) < 0) __PYX_ERR(19, 127, __pyx_L35_error)
              __pyx_t_14 = NULL;
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              goto __pyx_L38_unpacking_done;
              __pyx_L37_unpacking_failed:;
              __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
              __pyx_t_14 = NULL;
              if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
              __PYX_ERR(19, 127, __pyx_L35_error)
              __pyx_L38_unpacking_done:;
            }

            /* "gel/protocol/protocol_v0.pyx":127
 *                     try:
 *                         if mtype == STMT_DATA_DESC_MSG:
 *                             cardinality, in_dc, out_dc, _ = \             # <<<<<<<<<<<<<<
 *                                 self.parse_legacy_describe_type_message(reg)
 * 
 */
            if (!(likely(PyBytes_CheckExact(__pyx_t_9))||((__pyx_t_9) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_9))) __PYX_ERR(19, 127, __pyx_L35_error)
            if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(19, 127, __pyx_L35_error)
            if (!(likely(((__pyx_t_13) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_13, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(19, 127, __pyx_L35_error)
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_cardinality);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_cardinality, ((PyObject*)__pyx_t_9));
            __Pyx_GIVEREF(__pyx_t_9);
            __pyx_t_9 = 0;
            __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_in_dc, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_2));
            __Pyx_GIVEREF(__pyx_t_2);
            __pyx_t_2 = 0;
            __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_out_dc, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_13));
            __Pyx_GIVEREF(__pyx_t_13);
            __pyx_t_13 = 0;
            __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v__);
            __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v__, __pyx_t_23);
            __Pyx_GIVEREF(__pyx_t_23);
            __pyx_t_23 = 0;

            /* "gel/protocol/protocol_v0.pyx":126
 * 
 *                     try:
 *                         if mtype == STMT_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                             cardinality, in_dc, out_dc, _ = \
 *                                 self.parse_legacy_describe_type_message(reg)
 */
            break;
            case 'E':

            /* "gel/protocol/protocol_v0.pyx":131
 * 
 *                         elif mtype == ERROR_RESPONSE_MSG:
 *                             exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                             exc = self._amend_parse_error(
 *                                 exc, output_format, expect_one, required_one)
 */
            __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_error_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 131, __pyx_L35_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_11);
            __pyx_t_11 = 0;

            /* "gel/protocol/protocol_v0.pyx":133
 *                             exc = self.parse_error_message()
 *                             exc = self._amend_parse_error(
 *                                 exc, output_format, expect_one, required_one)             # <<<<<<<<<<<<<<
 * 
 *                         elif mtype == READY_FOR_COMMAND_MSG:
 */
            __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_expect_one); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(19, 133, __pyx_L35_error)
            __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_required_one); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(19, 133, __pyx_L35_error)

            /* "gel/protocol/protocol_v0.pyx":132
 *                         elif mtype == ERROR_RESPONSE_MSG:
 *                             exc = self.parse_error_message()
 *                             exc = self._amend_parse_error(             # <<<<<<<<<<<<<<
 *                                 exc, output_format, expect_one, required_one)
 * 
 */
            __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._amend_parse_error(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_exc, __pyx_cur_scope->__pyx_v_output_format, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 132, __pyx_L35_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
            __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_11);
            __pyx_t_11 = 0;

            /* "gel/protocol/protocol_v0.pyx":130
 *                                 self.parse_legacy_describe_type_message(reg)
 * 
 *                         elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                             exc = self.parse_error_message()
 *                             exc = self._amend_parse_error(
 */
            break;
            case 'Z':

            /* "gel/protocol/protocol_v0.pyx":136
 * 
 *                         elif mtype == READY_FOR_COMMAND_MSG:
 *                             self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                             break
 * 
 */
            __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_sync_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 136, __pyx_L35_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

            /* "gel/protocol/protocol_v0.pyx":137
 *                         elif mtype == READY_FOR_COMMAND_MSG:
 *                             self.parse_sync_message()
 *                             break             # <<<<<<<<<<<<<<
 * 
 *                         else:
 */
            goto __pyx_L33_break;

            /* "gel/protocol/protocol_v0.pyx":135
 *                                 exc, output_format, expect_one, required_one)
 * 
 *                         elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                             self.parse_sync_message()
 *                             break
 */
            break;
            default:

            /* "gel/protocol/protocol_v0.pyx":140
 * 
 *                         else:
 *                             self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *                     finally:
 */
            __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.fallthrough(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 140, __pyx_L35_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            break;
          }
        }

        /* "gel/protocol/protocol_v0.pyx":143
 * 
 *                     finally:
 *                         self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *             if exc is not None:
 */
        /*finally:*/ {
          /*normal exit:*/{
            __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 143, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L36;
          }
          __pyx_L35_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_assign
            __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
            __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17);
            if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_22);
            __Pyx_XGOTREF(__pyx_t_21);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_17);
            __pyx_t_15 = __pyx_lineno; __pyx_t_3 = __pyx_clineno; __pyx_t_25 = __pyx_filename;
            {
              __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 143, __pyx_L42_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            }
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17);
            }
            __Pyx_XGIVEREF(__pyx_t_22);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
            __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
            __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_3; __pyx_filename = __pyx_t_25;
            goto __pyx_L1_error;
            __pyx_L42_error:;
            if (PY_MAJOR_VERSION >= 3) {
              __Pyx_XGIVEREF(__pyx_t_19);
              __Pyx_XGIVEREF(__pyx_t_18);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17);
            }
            __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
            __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
            __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
            goto __pyx_L1_error;
          }
          __pyx_L33_break: {
            __pyx_t_11 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 143, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L29_break;
          }
          __pyx_L36:;
        }
      }
      __pyx_L29_break:;

      /* "gel/protocol/protocol_v0.pyx":111
 *                 out_dc = reg.get_codec(out_type_id)
 * 
 *             if in_dc is None or out_dc is None:             # <<<<<<<<<<<<<<
 *                 buf = WriteBuffer.new_message(DESCRIBE_STMT_MSG)
 *                 buf.write_int16(0)  # no headers
 */
    }

    /* "gel/protocol/protocol_v0.pyx":145
 *                         self.buffer.finish_message()
 * 
 *             if exc is not None:             # <<<<<<<<<<<<<<
 *                 raise exc
 * 
 */
    __pyx_t_4 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
    if (unlikely(__pyx_t_4)) {

      /* "gel/protocol/protocol_v0.pyx":146
 * 
 *             if exc is not None:
 *                 raise exc             # <<<<<<<<<<<<<<
 * 
 *         if required_one and cardinality == CARDINALITY_NOT_APPLICABLE:
 */
      __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
      __PYX_ERR(19, 146, __pyx_L1_error)

      /* "gel/protocol/protocol_v0.pyx":145
 *                         self.buffer.finish_message()
 * 
 *             if exc is not None:             # <<<<<<<<<<<<<<
 *                 raise exc
 * 
 */
    }

    /* "gel/protocol/protocol_v0.pyx":105
 *             raise exc
 * 
 *         if self.protocol_version < (0, 14):             # <<<<<<<<<<<<<<
 *             if reg.has_codec(in_type_id):
 *                 in_dc = reg.get_codec(in_type_id)
 */
  }

  /* "gel/protocol/protocol_v0.pyx":148
 *                 raise exc
 * 
 *         if required_one and cardinality == CARDINALITY_NOT_APPLICABLE:             # <<<<<<<<<<<<<<
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *             raise errors.InterfaceError(
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_required_one); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 148, __pyx_L1_error)
  if (__pyx_t_1) {
  } else {
    __pyx_t_4 = __pyx_t_1;
    goto __pyx_L45_bool_binop_done;
  }
  if (unlikely(!__pyx_cur_scope->__pyx_v_cardinality)) { __Pyx_RaiseUnboundLocalError("cardinality"); __PYX_ERR(19, 148, __pyx_L1_error) }
  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_cur_scope->__pyx_v_cardinality, __pyx_n_b_n, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 148, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_1;
  __pyx_L45_bool_binop_done:;
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/protocol_v0.pyx":149
 * 
 *         if required_one and cardinality == CARDINALITY_NOT_APPLICABLE:
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]             # <<<<<<<<<<<<<<
 *             raise errors.InterfaceError(
 *                 f'query cannot be executed with {methname}() as it '
 */
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_QUERY_SINGLE_METHOD); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_required_one); if (unlikely(!__pyx_t_23)) __PYX_ERR(19, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_cur_scope->__pyx_v_output_format); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_t_23, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_GIVEREF(__pyx_t_13);
    __pyx_cur_scope->__pyx_v_methname = __pyx_t_13;
    __pyx_t_13 = 0;

    /* "gel/protocol/protocol_v0.pyx":150
 *         if required_one and cardinality == CARDINALITY_NOT_APPLICABLE:
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *             raise errors.InterfaceError(             # <<<<<<<<<<<<<<
 *                 f'query cannot be executed with {methname}() as it '
 *                 f'does not return any data')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_errors); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_23)) __PYX_ERR(19, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_23);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "gel/protocol/protocol_v0.pyx":151
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *             raise errors.InterfaceError(
 *                 f'query cannot be executed with {methname}() as it '             # <<<<<<<<<<<<<<
 *                 f'does not return any data')
 * 
 */
    __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(19, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_26 = 0;
    __pyx_t_27 = 127;
    __Pyx_INCREF(__pyx_kp_u_query_cannot_be_executed_with);
    __pyx_t_26 += 30;
    __Pyx_GIVEREF(__pyx_kp_u_query_cannot_be_executed_with);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_kp_u_query_cannot_be_executed_with);
    __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_methname, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_27 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_27) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_27;
    __pyx_t_26 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_kp_u_as_it_does_not_return_any_data);
    __pyx_t_26 += 33;
    __Pyx_GIVEREF(__pyx_kp_u_as_it_does_not_return_any_data);
    PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_kp_u_as_it_does_not_return_any_data);
    __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_11, 3, __pyx_t_26, __pyx_t_27); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_11 = NULL;
    __pyx_t_12 = 0;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_23))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_23);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_23, function);
        __pyx_t_12 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_2};
      __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_23, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
    }
    __Pyx_Raise(__pyx_t_13, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __PYX_ERR(19, 150, __pyx_L1_error)

    /* "gel/protocol/protocol_v0.pyx":148
 *                 raise exc
 * 
 *         if required_one and cardinality == CARDINALITY_NOT_APPLICABLE:             # <<<<<<<<<<<<<<
 *             methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *             raise errors.InterfaceError(
 */
  }

  /* "gel/protocol/protocol_v0.pyx":154
 *                 f'does not return any data')
 * 
 *         return cardinality, in_dc, out_dc, attrs             # <<<<<<<<<<<<<<
 * 
 *     async def _legacy_execute(
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(!__pyx_cur_scope->__pyx_v_cardinality)) { __Pyx_RaiseUnboundLocalError("cardinality"); __PYX_ERR(19, 154, __pyx_L1_error) }
  __pyx_t_13 = PyTuple_New(4); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_cardinality);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_cardinality);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_cardinality)) __PYX_ERR(19, 154, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_cur_scope->__pyx_v_in_dc))) __PYX_ERR(19, 154, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 2, ((PyObject *)__pyx_cur_scope->__pyx_v_out_dc))) __PYX_ERR(19, 154, __pyx_L1_error);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_attrs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_attrs);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_cur_scope->__pyx_v_attrs)) __PYX_ERR(19, 154, __pyx_L1_error);
  __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  goto __pyx_L0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol_v0.pyx":32
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):
 *     async def _legacy_parse(             # <<<<<<<<<<<<<<
 *         self,
 *         query: str,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("_legacy_parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_5generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol_v0.pyx":156
 *         return cardinality, in_dc, out_dc, attrs
 * 
 *     async def _legacy_execute(             # <<<<<<<<<<<<<<
 *         self, BaseCodec in_dc, BaseCodec out_dc, args, kwargs
 *     ):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_4_legacy_execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_4_legacy_execute = {"_legacy_execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_4_legacy_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_4_legacy_execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc = 0;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_legacy_execute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_in_dc,&__pyx_n_s_out_dc,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_in_dc)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 156, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out_dc)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 156, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_legacy_execute", 1, 4, 4, 1); __PYX_ERR(19, 156, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 156, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_legacy_execute", 1, 4, 4, 2); __PYX_ERR(19, 156, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kwargs)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 156, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_legacy_execute", 1, 4, 4, 3); __PYX_ERR(19, 156, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_legacy_execute") < 0)) __PYX_ERR(19, 156, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
    }
    __pyx_v_in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)values[0]);
    __pyx_v_out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)values[1]);
    __pyx_v_args = values[2];
    __pyx_v_kwargs = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_legacy_execute", 1, 4, 4, __pyx_nargs); __PYX_ERR(19, 156, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible._legacy_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_in_dc), __pyx_ptype_3gel_8protocol_8protocol_BaseCodec, 1, "in_dc", 0))) __PYX_ERR(19, 157, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_out_dc), __pyx_ptype_3gel_8protocol_8protocol_BaseCodec, 1, "out_dc", 0))) __PYX_ERR(19, 157, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_3_legacy_execute(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self), __pyx_v_in_dc, __pyx_v_out_dc, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_3_legacy_execute(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_in_dc, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *__pyx_v_out_dc, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_legacy_execute", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(19, 156, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_in_dc = __pyx_v_in_dc;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
  __pyx_cur_scope->__pyx_v_out_dc = __pyx_v_out_dc;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
  __pyx_cur_scope->__pyx_v_args = __pyx_v_args;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
  __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_5generator15, __pyx_codeobj__88, (PyObject *) __pyx_cur_scope, __pyx_n_s_legacy_execute, __pyx_n_s_SansIOProtocolBackwardsCompatibl_2, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(19, 156, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible._legacy_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_5generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int32_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  unsigned int __pyx_t_6;
  char __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  char const *__pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_legacy_execute", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 156, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":164
 *             char mtype
 * 
 *         self.ensure_connected()             # <<<<<<<<<<<<<<
 *         self.reset_status()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ensure_connected(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 164, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":165
 * 
 *         self.ensure_connected()
 *         self.reset_status()             # <<<<<<<<<<<<<<
 * 
 *         packet = WriteBuffer.new()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reset_status(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":167
 *         self.reset_status()
 * 
 *         packet = WriteBuffer.new()             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(LEGACY_EXECUTE_MSG)
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_packet = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":169
 *         packet = WriteBuffer.new()
 * 
 *         buf = WriteBuffer.new_message(LEGACY_EXECUTE_MSG)             # <<<<<<<<<<<<<<
 *         buf.write_int16(0)  # no headers
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('E')); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":170
 * 
 *         buf = WriteBuffer.new_message(LEGACY_EXECUTE_MSG)
 *         buf.write_int16(0)  # no headers             # <<<<<<<<<<<<<<
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name
 *         self.encode_args(in_dc, buf, args, kwargs)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_cur_scope->__pyx_v_buf, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":171
 *         buf = WriteBuffer.new_message(LEGACY_EXECUTE_MSG)
 *         buf.write_int16(0)  # no headers
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name             # <<<<<<<<<<<<<<
 *         self.encode_args(in_dc, buf, args, kwargs)
 *         packet.write_buffer(buf.end_message())
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_len_prefixed_bytes(__pyx_cur_scope->__pyx_v_buf, __pyx_kp_b_); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":172
 *         buf.write_int16(0)  # no headers
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name
 *         self.encode_args(in_dc, buf, args, kwargs)             # <<<<<<<<<<<<<<
 *         packet.write_buffer(buf.end_message())
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.encode_args(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_in_dc, __pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":173
 *         buf.write_len_prefixed_bytes(b'')  # stmt_name
 *         self.encode_args(in_dc, buf, args, kwargs)
 *         packet.write_buffer(buf.end_message())             # <<<<<<<<<<<<<<
 * 
 *         packet.write_bytes(SYNC_MESSAGE)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(19, 173, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_cur_scope->__pyx_v_packet, ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 173, __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;

  /* "gel/protocol/protocol_v0.pyx":175
 *         packet.write_buffer(buf.end_message())
 * 
 *         packet.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *         self.write(packet)
 * 
 */
  __pyx_t_2 = __pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_packet, ((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":176
 * 
 *         packet.write_bytes(SYNC_MESSAGE)
 *         self.write(packet)             # <<<<<<<<<<<<<<
 * 
 *         result = []
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.write(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_packet); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":178
 *         self.write(packet)
 * 
 *         result = []             # <<<<<<<<<<<<<<
 * 
 *         exc = None
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":180
 *         result = []
 * 
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol_v0.pyx":181
 * 
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol_v0.pyx":182
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_3 == ((int32_t)-1))) __PYX_ERR(19, 182, __pyx_L1_error)
    __pyx_t_4 = (!(__pyx_t_3 != 0));
    if (__pyx_t_4) {

      /* "gel/protocol/protocol_v0.pyx":183
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_6 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L7_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 183, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(19, 183, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol_v0.pyx":182
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol_v0.pyx":184
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 184, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

    /* "gel/protocol/protocol_v0.pyx":186
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == DATA_MSG:
 *                     if exc is None:
 */
    /*try:*/ {

      /* "gel/protocol/protocol_v0.pyx":187
 * 
 *             try:
 *                 if mtype == DATA_MSG:             # <<<<<<<<<<<<<<
 *                     if exc is None:
 *                         try:
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case 'D':

        /* "gel/protocol/protocol_v0.pyx":188
 *             try:
 *                 if mtype == DATA_MSG:
 *                     if exc is None:             # <<<<<<<<<<<<<<
 *                         try:
 *                             self.parse_data_messages(out_dc, result)
 */
        __pyx_t_4 = (__pyx_cur_scope->__pyx_v_exc == Py_None);
        if (__pyx_t_4) {

          /* "gel/protocol/protocol_v0.pyx":189
 *                 if mtype == DATA_MSG:
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:
 */
          {
            __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
            __Pyx_XGOTREF(__pyx_t_8);
            __Pyx_XGOTREF(__pyx_t_9);
            __Pyx_XGOTREF(__pyx_t_10);
            /*try:*/ {

              /* "gel/protocol/protocol_v0.pyx":190
 *                     if exc is None:
 *                         try:
 *                             self.parse_data_messages(out_dc, result)             # <<<<<<<<<<<<<<
 *                         except Exception as ex:
 *                             # An error during data decoding.  We need to
 */
              __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_data_messages(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_out_dc, __pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 190, __pyx_L14_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

              /* "gel/protocol/protocol_v0.pyx":189
 *                 if mtype == DATA_MSG:
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:
 */
            }
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L21_try_end;
            __pyx_L14_error:;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

            /* "gel/protocol/protocol_v0.pyx":191
 *                         try:
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:             # <<<<<<<<<<<<<<
 *                             # An error during data decoding.  We need to
 *                             # handle this as gracefully as possible:
 */
            __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
            if (__pyx_t_11) {
              __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible._legacy_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(19, 191, __pyx_L16_except_error)
              __Pyx_XGOTREF(__pyx_t_1);
              __Pyx_XGOTREF(__pyx_t_2);
              __Pyx_XGOTREF(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_2);
              __pyx_cur_scope->__pyx_v_ex = __pyx_t_2;
              /*try:*/ {

                /* "gel/protocol/protocol_v0.pyx":197
 *                             #   received;
 *                             # * ignore all 'D' messages for this query.
 *                             exc = errors.ClientError(             # <<<<<<<<<<<<<<
 *                                 'unable to decode data to Python objects')
 *                             exc.__cause__ = ex
 */
                __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_errors); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 197, __pyx_L27_error)
                __Pyx_GOTREF(__pyx_t_13);
                __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_ClientError); if (unlikely(!__pyx_t_14)) __PYX_ERR(19, 197, __pyx_L27_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                __pyx_t_13 = NULL;
                __pyx_t_6 = 0;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_14))) {
                  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
                  if (likely(__pyx_t_13)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                    __Pyx_INCREF(__pyx_t_13);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_14, function);
                    __pyx_t_6 = 1;
                  }
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_kp_u_unable_to_decode_data_to_Python};
                  __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 197, __pyx_L27_error)
                  __Pyx_GOTREF(__pyx_t_12);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                }
                __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
                __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_12);
                __Pyx_GIVEREF(__pyx_t_12);
                __pyx_t_12 = 0;

                /* "gel/protocol/protocol_v0.pyx":199
 *                             exc = errors.ClientError(
 *                                 'unable to decode data to Python objects')
 *                             exc.__cause__ = ex             # <<<<<<<<<<<<<<
 *                             # Take care of a partially consumed 'D' message
 *                             # and the ones yet unparsed.
 */
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_exc, __pyx_n_s_cause, __pyx_cur_scope->__pyx_v_ex) < 0) __PYX_ERR(19, 199, __pyx_L27_error)

                /* "gel/protocol/protocol_v0.pyx":202
 *                             # Take care of a partially consumed 'D' message
 *                             # and the ones yet unparsed.
 *                             while self.buffer.take_message_type(DATA_MSG):             # <<<<<<<<<<<<<<
 *                                 self.buffer.discard_message()
 *                     else:
 */
                while (1) {
                  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->take_message_type(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer, 'D'); if (unlikely(__pyx_t_3 == ((int32_t)-1))) __PYX_ERR(19, 202, __pyx_L27_error)
                  __pyx_t_4 = (__pyx_t_3 != 0);
                  if (!__pyx_t_4) break;

                  /* "gel/protocol/protocol_v0.pyx":203
 *                             # and the ones yet unparsed.
 *                             while self.buffer.take_message_type(DATA_MSG):
 *                                 self.buffer.discard_message()             # <<<<<<<<<<<<<<
 *                     else:
 *                         self.buffer.discard_message()
 */
                  __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->discard_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 203, __pyx_L27_error)
                  __Pyx_GOTREF(__pyx_t_12);
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                }
              }

              /* "gel/protocol/protocol_v0.pyx":191
 *                         try:
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:             # <<<<<<<<<<<<<<
 *                             # An error during data decoding.  We need to
 *                             # handle this as gracefully as possible:
 */
              /*finally:*/ {
                /*normal exit:*/{
                  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
                  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
                  goto __pyx_L28;
                }
                __pyx_L27_error:;
                /*exception exit:*/{
                  __Pyx_PyThreadState_assign
                  __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
                  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
                  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
                  __Pyx_XGOTREF(__pyx_t_17);
                  __Pyx_XGOTREF(__pyx_t_18);
                  __Pyx_XGOTREF(__pyx_t_19);
                  __Pyx_XGOTREF(__pyx_t_20);
                  __Pyx_XGOTREF(__pyx_t_21);
                  __Pyx_XGOTREF(__pyx_t_22);
                  __pyx_t_11 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
                  {
                    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
                    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
                  }
                  if (PY_MAJOR_VERSION >= 3) {
                    __Pyx_XGIVEREF(__pyx_t_20);
                    __Pyx_XGIVEREF(__pyx_t_21);
                    __Pyx_XGIVEREF(__pyx_t_22);
                    __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
                  }
                  __Pyx_XGIVEREF(__pyx_t_17);
                  __Pyx_XGIVEREF(__pyx_t_18);
                  __Pyx_XGIVEREF(__pyx_t_19);
                  __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
                  __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
                  __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
                  goto __pyx_L16_except_error;
                }
                __pyx_L28:;
              }
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              goto __pyx_L15_exception_handled;
            }
            goto __pyx_L16_except_error;

            /* "gel/protocol/protocol_v0.pyx":189
 *                 if mtype == DATA_MSG:
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:
 */
            __pyx_L16_except_error:;
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
            goto __pyx_L11_error;
            __pyx_L15_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
            __pyx_L21_try_end:;
          }

          /* "gel/protocol/protocol_v0.pyx":188
 *             try:
 *                 if mtype == DATA_MSG:
 *                     if exc is None:             # <<<<<<<<<<<<<<
 *                         try:
 *                             self.parse_data_messages(out_dc, result)
 */
          goto __pyx_L13;
        }

        /* "gel/protocol/protocol_v0.pyx":205
 *                                 self.buffer.discard_message()
 *                     else:
 *                         self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:
 */
        /*else*/ {
          __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->discard_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 205, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __pyx_L13:;

        /* "gel/protocol/protocol_v0.pyx":187
 * 
 *             try:
 *                 if mtype == DATA_MSG:             # <<<<<<<<<<<<<<
 *                     if exc is None:
 *                         try:
 */
        break;
        case 'C':

        /* "gel/protocol/protocol_v0.pyx":208
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:
 *                     self.parse_legacy_command_complete_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->parse_legacy_command_complete_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 208, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "gel/protocol/protocol_v0.pyx":207
 *                         self.buffer.discard_message()
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_legacy_command_complete_message()
 * 
 */
        break;
        case 'E':

        /* "gel/protocol/protocol_v0.pyx":211
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_error_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 211, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_5 = 0;

        /* "gel/protocol/protocol_v0.pyx":210
 *                     self.parse_legacy_command_complete_message()
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 * 
 */
        break;
        case 'Z':

        /* "gel/protocol/protocol_v0.pyx":214
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_sync_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 214, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "gel/protocol/protocol_v0.pyx":215
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
        goto __pyx_L9_break;

        /* "gel/protocol/protocol_v0.pyx":213
 *                     exc = self.parse_error_message()
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_sync_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol_v0.pyx":218
 * 
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *             finally:
 */
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.fallthrough(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 218, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol_v0.pyx":221
 * 
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L12;
      }
      __pyx_L11_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_9, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_22);
        __Pyx_XGOTREF(__pyx_t_21);
        __Pyx_XGOTREF(__pyx_t_20);
        __pyx_t_15 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
        {
          __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 221, __pyx_L38_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20);
        }
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ErrRestore(__pyx_t_10, __pyx_t_9, __pyx_t_8);
        __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_8 = 0; __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0;
        __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_23;
        goto __pyx_L1_error;
        __pyx_L38_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20);
        }
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L9_break: {
        __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L5_break;
      }
      __pyx_L12:;
    }
  }
  __pyx_L5_break:;

  /* "gel/protocol/protocol_v0.pyx":223
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  __pyx_t_4 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_4)) {

    /* "gel/protocol/protocol_v0.pyx":224
 * 
 *         if exc is not None:
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(19, 224, __pyx_L1_error)

    /* "gel/protocol/protocol_v0.pyx":223
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  }

  /* "gel/protocol/protocol_v0.pyx":226
 *             raise exc
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     async def _legacy_optimistic_execute(self, ctx: ExecuteContext):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_result);
  goto __pyx_L0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol_v0.pyx":156
 *         return cardinality, in_dc, out_dc, attrs
 * 
 *     async def _legacy_execute(             # <<<<<<<<<<<<<<
 *         self, BaseCodec in_dc, BaseCodec out_dc, args, kwargs
 *     ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("_legacy_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_8generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol_v0.pyx":228
 *         return result
 * 
 *     async def _legacy_optimistic_execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_7_legacy_optimistic_execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_7_legacy_optimistic_execute = {"_legacy_optimistic_execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_7_legacy_optimistic_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_7_legacy_optimistic_execute(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_legacy_optimistic_execute (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctx)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 228, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_legacy_optimistic_execute") < 0)) __PYX_ERR(19, 228, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_ctx = ((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_legacy_optimistic_execute", 1, 1, 1, __pyx_nargs); __PYX_ERR(19, 228, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible._legacy_optimistic_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, 0, "ctx", 0))) __PYX_ERR(19, 228, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_6_legacy_optimistic_execute(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self), __pyx_v_ctx);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_6_legacy_optimistic_execute(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_legacy_optimistic_execute", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(19, 228, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_ctx = __pyx_v_ctx;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_8generator16, __pyx_codeobj__89, (PyObject *) __pyx_cur_scope, __pyx_n_s_legacy_optimistic_execute, __pyx_n_s_SansIOProtocolBackwardsCompatibl_3, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(19, 228, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible._legacy_optimistic_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_8generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  uint64_t __pyx_t_5;
  uint64_t __pyx_t_6;
  char __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int32_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  unsigned int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  char const *__pyx_t_20;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  PyObject *__pyx_t_24 = NULL;
  PyObject *__pyx_t_25 = NULL;
  PyObject *__pyx_t_26 = NULL;
  char const *__pyx_t_27;
  int __pyx_t_28;
  Py_ssize_t __pyx_t_29;
  Py_UCS4 __pyx_t_30;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_legacy_optimistic_execute", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_await;
    case 2: goto __pyx_L47_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 228, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":235
 *             bint re_exec
 *             object result
 *             bytes new_cardinality = None             # <<<<<<<<<<<<<<
 * 
 *             str query = ctx.query
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_new_cardinality = ((PyObject*)Py_None);

  /* "gel/protocol/protocol_v0.pyx":237
 *             bytes new_cardinality = None
 * 
 *             str query = ctx.query             # <<<<<<<<<<<<<<
 *             object args = ctx.args
 *             object kwargs = ctx.kwargs
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_ctx->query;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_query = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":238
 * 
 *             str query = ctx.query
 *             object args = ctx.args             # <<<<<<<<<<<<<<
 *             object kwargs = ctx.kwargs
 *             CodecsRegistry reg = ctx.reg
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_ctx->args;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_args = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":239
 *             str query = ctx.query
 *             object args = ctx.args
 *             object kwargs = ctx.kwargs             # <<<<<<<<<<<<<<
 *             CodecsRegistry reg = ctx.reg
 *             OutputFormat output_format = ctx.output_format
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_ctx->kwargs;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_kwargs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":240
 *             object args = ctx.args
 *             object kwargs = ctx.kwargs
 *             CodecsRegistry reg = ctx.reg             # <<<<<<<<<<<<<<
 *             OutputFormat output_format = ctx.output_format
 *             bint expect_one = ctx.expect_one
 */
  __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_ctx->reg);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":241
 *             object kwargs = ctx.kwargs
 *             CodecsRegistry reg = ctx.reg
 *             OutputFormat output_format = ctx.output_format             # <<<<<<<<<<<<<<
 *             bint expect_one = ctx.expect_one
 *             bint required_one = ctx.required_one
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_ctx->output_format;
  __pyx_cur_scope->__pyx_v_output_format = __pyx_t_2;

  /* "gel/protocol/protocol_v0.pyx":242
 *             CodecsRegistry reg = ctx.reg
 *             OutputFormat output_format = ctx.output_format
 *             bint expect_one = ctx.expect_one             # <<<<<<<<<<<<<<
 *             bint required_one = ctx.required_one
 *             int implicit_limit = ctx.implicit_limit
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->expect_one;
  __pyx_cur_scope->__pyx_v_expect_one = __pyx_t_3;

  /* "gel/protocol/protocol_v0.pyx":243
 *             OutputFormat output_format = ctx.output_format
 *             bint expect_one = ctx.expect_one
 *             bint required_one = ctx.required_one             # <<<<<<<<<<<<<<
 *             int implicit_limit = ctx.implicit_limit
 *             bint inline_typenames = ctx.inline_typenames
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->required_one;
  __pyx_cur_scope->__pyx_v_required_one = __pyx_t_3;

  /* "gel/protocol/protocol_v0.pyx":244
 *             bint expect_one = ctx.expect_one
 *             bint required_one = ctx.required_one
 *             int implicit_limit = ctx.implicit_limit             # <<<<<<<<<<<<<<
 *             bint inline_typenames = ctx.inline_typenames
 *             bint inline_typeids = ctx.inline_typeids
 */
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_ctx->implicit_limit;
  __pyx_cur_scope->__pyx_v_implicit_limit = __pyx_t_4;

  /* "gel/protocol/protocol_v0.pyx":245
 *             bint required_one = ctx.required_one
 *             int implicit_limit = ctx.implicit_limit
 *             bint inline_typenames = ctx.inline_typenames             # <<<<<<<<<<<<<<
 *             bint inline_typeids = ctx.inline_typeids
 *             uint64_t allow_capabilities = ctx.allow_capabilities
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->inline_typenames;
  __pyx_cur_scope->__pyx_v_inline_typenames = __pyx_t_3;

  /* "gel/protocol/protocol_v0.pyx":246
 *             int implicit_limit = ctx.implicit_limit
 *             bint inline_typenames = ctx.inline_typenames
 *             bint inline_typeids = ctx.inline_typeids             # <<<<<<<<<<<<<<
 *             uint64_t allow_capabilities = ctx.allow_capabilities
 *             BaseCodec in_dc = ctx.in_dc
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->inline_typeids;
  __pyx_cur_scope->__pyx_v_inline_typeids = __pyx_t_3;

  /* "gel/protocol/protocol_v0.pyx":247
 *             bint inline_typenames = ctx.inline_typenames
 *             bint inline_typeids = ctx.inline_typeids
 *             uint64_t allow_capabilities = ctx.allow_capabilities             # <<<<<<<<<<<<<<
 *             BaseCodec in_dc = ctx.in_dc
 *             BaseCodec out_dc = ctx.out_dc
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_ctx->allow_capabilities;
  __pyx_cur_scope->__pyx_v_allow_capabilities = __pyx_t_5;

  /* "gel/protocol/protocol_v0.pyx":248
 *             bint inline_typeids = ctx.inline_typeids
 *             uint64_t allow_capabilities = ctx.allow_capabilities
 *             BaseCodec in_dc = ctx.in_dc             # <<<<<<<<<<<<<<
 *             BaseCodec out_dc = ctx.out_dc
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":249
 *             uint64_t allow_capabilities = ctx.allow_capabilities
 *             BaseCodec in_dc = ctx.in_dc
 *             BaseCodec out_dc = ctx.out_dc             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(EXECUTE_MSG)
 */
  __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_ctx->out_dc);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":251
 *             BaseCodec out_dc = ctx.out_dc
 * 
 *         buf = WriteBuffer.new_message(EXECUTE_MSG)             # <<<<<<<<<<<<<<
 *         self.legacy_write_execute_headers(
 *             buf, implicit_limit, inline_typenames, inline_typeids,
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('O')); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":254
 *         self.legacy_write_execute_headers(
 *             buf, implicit_limit, inline_typenames, inline_typeids,
 *             ALL_CAPABILITIES if allow_capabilities is None             # <<<<<<<<<<<<<<
 *             else allow_capabilities)
 *         buf.write_byte(output_format)
 */
  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_allow_capabilities); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ALL_CAPABILITIES); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 254, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 254, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __pyx_t_6;
  } else {

    /* "gel/protocol/protocol_v0.pyx":255
 *             buf, implicit_limit, inline_typenames, inline_typeids,
 *             ALL_CAPABILITIES if allow_capabilities is None
 *             else allow_capabilities)             # <<<<<<<<<<<<<<
 *         buf.write_byte(output_format)
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)
 */
    __pyx_t_5 = __pyx_cur_scope->__pyx_v_allow_capabilities;
  }

  /* "gel/protocol/protocol_v0.pyx":252
 * 
 *         buf = WriteBuffer.new_message(EXECUTE_MSG)
 *         self.legacy_write_execute_headers(             # <<<<<<<<<<<<<<
 *             buf, implicit_limit, inline_typenames, inline_typeids,
 *             ALL_CAPABILITIES if allow_capabilities is None
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->legacy_write_execute_headers(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_implicit_limit, __pyx_cur_scope->__pyx_v_inline_typenames, __pyx_cur_scope->__pyx_v_inline_typeids, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":256
 *             ALL_CAPABILITIES if allow_capabilities is None
 *             else allow_capabilities)
 *         buf.write_byte(output_format)             # <<<<<<<<<<<<<<
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)
 *         buf.write_len_prefixed_utf8(query)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_output_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":257
 *             else allow_capabilities)
 *         buf.write_byte(output_format)
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)             # <<<<<<<<<<<<<<
 *         buf.write_len_prefixed_utf8(query)
 *         buf.write_bytes(in_dc.get_tid())
 */
  if (__pyx_cur_scope->__pyx_v_expect_one) {
    __pyx_t_7 = 'o';
  } else {
    __pyx_t_7 = 'm';
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_byte(__pyx_cur_scope->__pyx_v_buf, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":258
 *         buf.write_byte(output_format)
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)
 *         buf.write_len_prefixed_utf8(query)             # <<<<<<<<<<<<<<
 *         buf.write_bytes(in_dc.get_tid())
 *         buf.write_bytes(out_dc.get_tid())
 */
  __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":259
 *         buf.write_byte(CARDINALITY_ONE if expect_one else CARDINALITY_MANY)
 *         buf.write_len_prefixed_utf8(query)
 *         buf.write_bytes(in_dc.get_tid())             # <<<<<<<<<<<<<<
 *         buf.write_bytes(out_dc.get_tid())
 *         self.encode_args(in_dc, buf, args, kwargs)
 */
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol_9BaseCodec_get_tid(__pyx_cur_scope->__pyx_v_in_dc); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 259, __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;

  /* "gel/protocol/protocol_v0.pyx":260
 *         buf.write_len_prefixed_utf8(query)
 *         buf.write_bytes(in_dc.get_tid())
 *         buf.write_bytes(out_dc.get_tid())             # <<<<<<<<<<<<<<
 *         self.encode_args(in_dc, buf, args, kwargs)
 *         buf.end_message()
 */
  __pyx_t_8 = __pyx_f_3gel_8protocol_8protocol_9BaseCodec_get_tid(__pyx_cur_scope->__pyx_v_out_dc); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 260, __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;

  /* "gel/protocol/protocol_v0.pyx":261
 *         buf.write_bytes(in_dc.get_tid())
 *         buf.write_bytes(out_dc.get_tid())
 *         self.encode_args(in_dc, buf, args, kwargs)             # <<<<<<<<<<<<<<
 *         buf.end_message()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.encode_args(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_in_dc, __pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":262
 *         buf.write_bytes(out_dc.get_tid())
 *         self.encode_args(in_dc, buf, args, kwargs)
 *         buf.end_message()             # <<<<<<<<<<<<<<
 * 
 *         packet = WriteBuffer.new()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":264
 *         buf.end_message()
 * 
 *         packet = WriteBuffer.new()             # <<<<<<<<<<<<<<
 *         packet.write_buffer(buf)
 *         packet.write_bytes(SYNC_MESSAGE)
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new()); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_packet = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":265
 * 
 *         packet = WriteBuffer.new()
 *         packet.write_buffer(buf)             # <<<<<<<<<<<<<<
 *         packet.write_bytes(SYNC_MESSAGE)
 *         self.write(packet)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_packet->__pyx_vtab)->write_buffer(__pyx_cur_scope->__pyx_v_packet, __pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":266
 *         packet = WriteBuffer.new()
 *         packet.write_buffer(buf)
 *         packet.write_bytes(SYNC_MESSAGE)             # <<<<<<<<<<<<<<
 *         self.write(packet)
 * 
 */
  __pyx_t_1 = __pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_packet->__pyx_vtab)->write_bytes(__pyx_cur_scope->__pyx_v_packet, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 266, __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;

  /* "gel/protocol/protocol_v0.pyx":267
 *         packet.write_buffer(buf)
 *         packet.write_bytes(SYNC_MESSAGE)
 *         self.write(packet)             # <<<<<<<<<<<<<<
 * 
 *         result = []
 */
  __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.write(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_packet); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "gel/protocol/protocol_v0.pyx":269
 *         self.write(packet)
 * 
 *         result = []             # <<<<<<<<<<<<<<
 *         re_exec = False
 *         exc = None
 */
  __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_cur_scope->__pyx_v_result = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "gel/protocol/protocol_v0.pyx":270
 * 
 *         result = []
 *         re_exec = False             # <<<<<<<<<<<<<<
 *         exc = None
 *         while True:
 */
  __pyx_cur_scope->__pyx_v_re_exec = 0;

  /* "gel/protocol/protocol_v0.pyx":271
 *         result = []
 *         re_exec = False
 *         exc = None             # <<<<<<<<<<<<<<
 *         while True:
 *             if not self.buffer.take_message():
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol_v0.pyx":272
 *         re_exec = False
 *         exc = None
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol_v0.pyx":273
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_9 == ((int32_t)-1))) __PYX_ERR(19, 273, __pyx_L1_error)
    __pyx_t_3 = (!(__pyx_t_9 != 0));
    if (__pyx_t_3) {

      /* "gel/protocol/protocol_v0.pyx":274
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 274, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(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_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_11, 0+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_8);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L7_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 274, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(19, 274, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol_v0.pyx":273
 *         exc = None
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol_v0.pyx":275
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_7 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 275, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_7;

    /* "gel/protocol/protocol_v0.pyx":277
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == STMT_DATA_DESC_MSG:
 *                     # our in/out type spec is out-dated
 */
    /*try:*/ {

      /* "gel/protocol/protocol_v0.pyx":278
 * 
 *             try:
 *                 if mtype == STMT_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                     # our in/out type spec is out-dated
 *                     new_cardinality, in_dc, out_dc, headers = \
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case 'T':

        /* "gel/protocol/protocol_v0.pyx":281
 *                     # our in/out type spec is out-dated
 *                     new_cardinality, in_dc, out_dc, headers = \
 *                         self.parse_legacy_describe_type_message(reg)             # <<<<<<<<<<<<<<
 * 
 *                     capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 */
        __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->parse_legacy_describe_type_message(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_reg); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 281, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_8);
        if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
          PyObject* sequence = __pyx_t_8;
          Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
          if (unlikely(size != 4)) {
            if (size > 4) __Pyx_RaiseTooManyValuesError(4);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(19, 280, __pyx_L11_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_10 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); 
            __pyx_t_13 = PyTuple_GET_ITEM(sequence, 3); 
          } else {
            __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_12 = PyList_GET_ITEM(sequence, 2); 
            __pyx_t_13 = PyList_GET_ITEM(sequence, 3); 
          }
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_13);
          #else
          {
            Py_ssize_t i;
            PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_10,&__pyx_t_12,&__pyx_t_13};
            for (i=0; i < 4; i++) {
              PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(19, 280, __pyx_L11_error)
              __Pyx_GOTREF(item);
              *(temps[i]) = item;
            }
          }
          #endif
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else {
          Py_ssize_t index = -1;
          PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_10,&__pyx_t_12,&__pyx_t_13};
          __pyx_t_14 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(19, 280, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14);
          for (index=0; index < 4; index++) {
            PyObject* item = __pyx_t_15(__pyx_t_14); if (unlikely(!item)) goto __pyx_L13_unpacking_failed;
            __Pyx_GOTREF(item);
            *(temps[index]) = item;
          }
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_15(__pyx_t_14), 4) < 0) __PYX_ERR(19, 280, __pyx_L11_error)
          __pyx_t_15 = NULL;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          goto __pyx_L14_unpacking_done;
          __pyx_L13_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_15 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(19, 280, __pyx_L11_error)
          __pyx_L14_unpacking_done:;
        }

        /* "gel/protocol/protocol_v0.pyx":280
 *                 if mtype == STMT_DATA_DESC_MSG:
 *                     # our in/out type spec is out-dated
 *                     new_cardinality, in_dc, out_dc, headers = \             # <<<<<<<<<<<<<<
 *                         self.parse_legacy_describe_type_message(reg)
 * 
 */
        if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(19, 280, __pyx_L11_error)
        if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(19, 280, __pyx_L11_error)
        if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(19, 280, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_cardinality);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_new_cardinality, ((PyObject*)__pyx_t_1));
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_in_dc, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_10));
        __Pyx_GIVEREF(__pyx_t_10);
        __pyx_t_10 = 0;
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_out_dc, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_12));
        __Pyx_GIVEREF(__pyx_t_12);
        __pyx_t_12 = 0;
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_headers);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_headers, __pyx_t_13);
        __Pyx_GIVEREF(__pyx_t_13);
        __pyx_t_13 = 0;

        /* "gel/protocol/protocol_v0.pyx":283
 *                         self.parse_legacy_describe_type_message(reg)
 * 
 *                     capabilities = headers.get(SERVER_HEADER_CAPABILITIES)             # <<<<<<<<<<<<<<
 *                     if capabilities is not None:
 *                         capabilities = int.from_bytes(capabilities, 'big')
 */
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_headers, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 283, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_12 = NULL;
        __pyx_t_11 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_11 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_int_4097};
          __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 283, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        }
        __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_capabilities);
        __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_capabilities, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_t_8 = 0;

        /* "gel/protocol/protocol_v0.pyx":284
 * 
 *                     capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *                     if capabilities is not None:             # <<<<<<<<<<<<<<
 *                         capabilities = int.from_bytes(capabilities, 'big')
 * 
 */
        __pyx_t_3 = (__pyx_cur_scope->__pyx_v_capabilities != Py_None);
        if (__pyx_t_3) {

          /* "gel/protocol/protocol_v0.pyx":285
 *                     capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *                     if capabilities is not None:
 *                         capabilities = int.from_bytes(capabilities, 'big')             # <<<<<<<<<<<<<<
 * 
 *                     ctx.cardinality = new_cardinality
 */
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 285, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_12 = NULL;
          __pyx_t_11 = 0;
          #if CYTHON_UNPACK_METHODS
          if (likely(PyMethod_Check(__pyx_t_13))) {
            __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
            if (likely(__pyx_t_12)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
              __Pyx_INCREF(__pyx_t_12);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_13, function);
              __pyx_t_11 = 1;
            }
          }
          #endif
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_capabilities, __pyx_n_u_big};
            __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_11, 2+__pyx_t_11);
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 285, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          }
          __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_capabilities);
          __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_capabilities, __pyx_t_8);
          __Pyx_GIVEREF(__pyx_t_8);
          __pyx_t_8 = 0;

          /* "gel/protocol/protocol_v0.pyx":284
 * 
 *                     capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *                     if capabilities is not None:             # <<<<<<<<<<<<<<
 *                         capabilities = int.from_bytes(capabilities, 'big')
 * 
 */
        }

        /* "gel/protocol/protocol_v0.pyx":287
 *                         capabilities = int.from_bytes(capabilities, 'big')
 * 
 *                     ctx.cardinality = new_cardinality             # <<<<<<<<<<<<<<
 *                     ctx.in_dc = in_dc
 *                     ctx.out_dc = out_dc
 */
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_new_cardinality);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_cardinality);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ctx->cardinality);
        __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ctx->cardinality);
        __pyx_cur_scope->__pyx_v_ctx->cardinality = __pyx_cur_scope->__pyx_v_new_cardinality;

        /* "gel/protocol/protocol_v0.pyx":288
 * 
 *                     ctx.cardinality = new_cardinality
 *                     ctx.in_dc = in_dc             # <<<<<<<<<<<<<<
 *                     ctx.out_dc = out_dc
 *                     ctx.capabilities = capabilities
 */
        __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
        __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
        __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
        __pyx_cur_scope->__pyx_v_ctx->in_dc = __pyx_cur_scope->__pyx_v_in_dc;

        /* "gel/protocol/protocol_v0.pyx":289
 *                     ctx.cardinality = new_cardinality
 *                     ctx.in_dc = in_dc
 *                     ctx.out_dc = out_dc             # <<<<<<<<<<<<<<
 *                     ctx.capabilities = capabilities
 *                     ctx.store_to_cache()
 */
        __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
        __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
        __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->out_dc);
        __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->out_dc);
        __pyx_cur_scope->__pyx_v_ctx->out_dc = __pyx_cur_scope->__pyx_v_out_dc;

        /* "gel/protocol/protocol_v0.pyx":290
 *                     ctx.in_dc = in_dc
 *                     ctx.out_dc = out_dc
 *                     ctx.capabilities = capabilities             # <<<<<<<<<<<<<<
 *                     ctx.store_to_cache()
 * 
 */
        __pyx_t_5 = __Pyx_PyInt_As_uint64_t(__pyx_cur_scope->__pyx_v_capabilities); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 290, __pyx_L11_error)
        __pyx_cur_scope->__pyx_v_ctx->capabilities = __pyx_t_5;

        /* "gel/protocol/protocol_v0.pyx":291
 *                     ctx.out_dc = out_dc
 *                     ctx.capabilities = capabilities
 *                     ctx.store_to_cache()             # <<<<<<<<<<<<<<
 * 
 *                     re_exec = True
 */
        __pyx_t_8 = __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_store_to_cache(__pyx_cur_scope->__pyx_v_ctx); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 291, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "gel/protocol/protocol_v0.pyx":293
 *                     ctx.store_to_cache()
 * 
 *                     re_exec = True             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == DATA_MSG:
 */
        __pyx_cur_scope->__pyx_v_re_exec = 1;

        /* "gel/protocol/protocol_v0.pyx":278
 * 
 *             try:
 *                 if mtype == STMT_DATA_DESC_MSG:             # <<<<<<<<<<<<<<
 *                     # our in/out type spec is out-dated
 *                     new_cardinality, in_dc, out_dc, headers = \
 */
        break;
        case 'D':

        /* "gel/protocol/protocol_v0.pyx":296
 * 
 *                 elif mtype == DATA_MSG:
 *                     assert not re_exec             # <<<<<<<<<<<<<<
 *                     if exc is None:
 *                         try:
 */
        #ifndef CYTHON_WITHOUT_ASSERTIONS
        if (unlikely(__pyx_assertions_enabled())) {
          __pyx_t_3 = (!__pyx_cur_scope->__pyx_v_re_exec);
          if (unlikely(!__pyx_t_3)) {
            __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
            __PYX_ERR(19, 296, __pyx_L11_error)
          }
        }
        #else
        if ((1)); else __PYX_ERR(19, 296, __pyx_L11_error)
        #endif

        /* "gel/protocol/protocol_v0.pyx":297
 *                 elif mtype == DATA_MSG:
 *                     assert not re_exec
 *                     if exc is None:             # <<<<<<<<<<<<<<
 *                         try:
 *                             self.parse_data_messages(out_dc, result)
 */
        __pyx_t_3 = (__pyx_cur_scope->__pyx_v_exc == Py_None);
        if (__pyx_t_3) {

          /* "gel/protocol/protocol_v0.pyx":298
 *                     assert not re_exec
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:
 */
          {
            __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            /*try:*/ {

              /* "gel/protocol/protocol_v0.pyx":299
 *                     if exc is None:
 *                         try:
 *                             self.parse_data_messages(out_dc, result)             # <<<<<<<<<<<<<<
 *                         except Exception as ex:
 *                             # An error during data decoding.  We need to
 */
              __pyx_t_8 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_data_messages(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_out_dc, __pyx_cur_scope->__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 299, __pyx_L17_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

              /* "gel/protocol/protocol_v0.pyx":298
 *                     assert not re_exec
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:
 */
            }
            __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
            __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            goto __pyx_L24_try_end;
            __pyx_L17_error:;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "gel/protocol/protocol_v0.pyx":300
 *                         try:
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:             # <<<<<<<<<<<<<<
 *                             # An error during data decoding.  We need to
 *                             # handle this as gracefully as possible:
 */
            __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
            if (__pyx_t_4) {
              __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible._legacy_optimistic_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_13, &__pyx_t_12) < 0) __PYX_ERR(19, 300, __pyx_L19_except_error)
              __Pyx_XGOTREF(__pyx_t_8);
              __Pyx_XGOTREF(__pyx_t_13);
              __Pyx_XGOTREF(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_GIVEREF(__pyx_t_13);
              __pyx_cur_scope->__pyx_v_ex = __pyx_t_13;
              /*try:*/ {

                /* "gel/protocol/protocol_v0.pyx":306
 *                             #   received;
 *                             # * ignore all 'D' messages for this query.
 *                             exc = errors.ClientError(             # <<<<<<<<<<<<<<
 *                                 'unable to decode data to Python objects')
 *                             exc.__cause__ = ex
 */
                __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_errors); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 306, __pyx_L30_error)
                __Pyx_GOTREF(__pyx_t_1);
                __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ClientError); if (unlikely(!__pyx_t_14)) __PYX_ERR(19, 306, __pyx_L30_error)
                __Pyx_GOTREF(__pyx_t_14);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __pyx_t_1 = NULL;
                __pyx_t_11 = 0;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_14))) {
                  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
                  if (likely(__pyx_t_1)) {
                    PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                    __Pyx_INCREF(__pyx_t_1);
                    __Pyx_INCREF(function);
                    __Pyx_DECREF_SET(__pyx_t_14, function);
                    __pyx_t_11 = 1;
                  }
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u_unable_to_decode_data_to_Python};
                  __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 306, __pyx_L30_error)
                  __Pyx_GOTREF(__pyx_t_10);
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                }
                __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
                __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_10);
                __Pyx_GIVEREF(__pyx_t_10);
                __pyx_t_10 = 0;

                /* "gel/protocol/protocol_v0.pyx":308
 *                             exc = errors.ClientError(
 *                                 'unable to decode data to Python objects')
 *                             exc.__cause__ = ex             # <<<<<<<<<<<<<<
 *                             # Take care of a partially consumed 'D' message
 *                             # and the ones yet unparsed.
 */
                if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_exc, __pyx_n_s_cause, __pyx_cur_scope->__pyx_v_ex) < 0) __PYX_ERR(19, 308, __pyx_L30_error)

                /* "gel/protocol/protocol_v0.pyx":311
 *                             # Take care of a partially consumed 'D' message
 *                             # and the ones yet unparsed.
 *                             while self.buffer.take_message_type(DATA_MSG):             # <<<<<<<<<<<<<<
 *                                 self.buffer.discard_message()
 *                     else:
 */
                while (1) {
                  __pyx_t_9 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->take_message_type(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer, 'D'); if (unlikely(__pyx_t_9 == ((int32_t)-1))) __PYX_ERR(19, 311, __pyx_L30_error)
                  __pyx_t_3 = (__pyx_t_9 != 0);
                  if (!__pyx_t_3) break;

                  /* "gel/protocol/protocol_v0.pyx":312
 *                             # and the ones yet unparsed.
 *                             while self.buffer.take_message_type(DATA_MSG):
 *                                 self.buffer.discard_message()             # <<<<<<<<<<<<<<
 *                     else:
 *                         self.buffer.discard_message()
 */
                  __pyx_t_10 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->discard_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 312, __pyx_L30_error)
                  __Pyx_GOTREF(__pyx_t_10);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                }
              }

              /* "gel/protocol/protocol_v0.pyx":300
 *                         try:
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:             # <<<<<<<<<<<<<<
 *                             # An error during data decoding.  We need to
 *                             # handle this as gracefully as possible:
 */
              /*finally:*/ {
                /*normal exit:*/{
                  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
                  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
                  goto __pyx_L31;
                }
                __pyx_L30_error:;
                /*exception exit:*/{
                  __Pyx_PyThreadState_assign
                  __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_24, &__pyx_t_25, &__pyx_t_26);
                  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23) < 0)) __Pyx_ErrFetch(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
                  __Pyx_XGOTREF(__pyx_t_21);
                  __Pyx_XGOTREF(__pyx_t_22);
                  __Pyx_XGOTREF(__pyx_t_23);
                  __Pyx_XGOTREF(__pyx_t_24);
                  __Pyx_XGOTREF(__pyx_t_25);
                  __Pyx_XGOTREF(__pyx_t_26);
                  __pyx_t_4 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
                  {
                    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ex);
                    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ex); __pyx_cur_scope->__pyx_v_ex = 0;
                  }
                  if (PY_MAJOR_VERSION >= 3) {
                    __Pyx_XGIVEREF(__pyx_t_24);
                    __Pyx_XGIVEREF(__pyx_t_25);
                    __Pyx_XGIVEREF(__pyx_t_26);
                    __Pyx_ExceptionReset(__pyx_t_24, __pyx_t_25, __pyx_t_26);
                  }
                  __Pyx_XGIVEREF(__pyx_t_21);
                  __Pyx_XGIVEREF(__pyx_t_22);
                  __Pyx_XGIVEREF(__pyx_t_23);
                  __Pyx_ErrRestore(__pyx_t_21, __pyx_t_22, __pyx_t_23);
                  __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0; __pyx_t_24 = 0; __pyx_t_25 = 0; __pyx_t_26 = 0;
                  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
                  goto __pyx_L19_except_error;
                }
                __pyx_L31:;
              }
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              goto __pyx_L18_exception_handled;
            }
            goto __pyx_L19_except_error;

            /* "gel/protocol/protocol_v0.pyx":298
 *                     assert not re_exec
 *                     if exc is None:
 *                         try:             # <<<<<<<<<<<<<<
 *                             self.parse_data_messages(out_dc, result)
 *                         except Exception as ex:
 */
            __pyx_L19_except_error:;
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            goto __pyx_L11_error;
            __pyx_L18_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            __pyx_L24_try_end:;
          }

          /* "gel/protocol/protocol_v0.pyx":297
 *                 elif mtype == DATA_MSG:
 *                     assert not re_exec
 *                     if exc is None:             # <<<<<<<<<<<<<<
 *                         try:
 *                             self.parse_data_messages(out_dc, result)
 */
          goto __pyx_L16;
        }

        /* "gel/protocol/protocol_v0.pyx":314
 *                                 self.buffer.discard_message()
 *                     else:
 *                         self.buffer.discard_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:
 */
        /*else*/ {
          __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->discard_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 314, __pyx_L11_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __pyx_L16:;

        /* "gel/protocol/protocol_v0.pyx":295
 *                     re_exec = True
 * 
 *                 elif mtype == DATA_MSG:             # <<<<<<<<<<<<<<
 *                     assert not re_exec
 *                     if exc is None:
 */
        break;
        case 'C':

        /* "gel/protocol/protocol_v0.pyx":317
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:
 *                     self.parse_legacy_command_complete_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
        __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->parse_legacy_command_complete_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 317, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "gel/protocol/protocol_v0.pyx":316
 *                         self.buffer.discard_message()
 * 
 *                 elif mtype == COMMAND_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_legacy_command_complete_message()
 * 
 */
        break;
        case 'E':

        /* "gel/protocol/protocol_v0.pyx":320
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 *                     exc = self._amend_parse_error(
 *                         exc, output_format, expect_one, required_one)
 */
        __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_error_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 320, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        __pyx_t_12 = 0;

        /* "gel/protocol/protocol_v0.pyx":321
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     exc = self.parse_error_message()
 *                     exc = self._amend_parse_error(             # <<<<<<<<<<<<<<
 *                         exc, output_format, expect_one, required_one)
 * 
 */
        __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._amend_parse_error(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_exc, __pyx_cur_scope->__pyx_v_output_format, __pyx_cur_scope->__pyx_v_expect_one, __pyx_cur_scope->__pyx_v_required_one); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 321, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_12);
        __pyx_t_12 = 0;

        /* "gel/protocol/protocol_v0.pyx":319
 *                     self.parse_legacy_command_complete_message()
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     exc = self.parse_error_message()
 *                     exc = self._amend_parse_error(
 */
        break;
        case 'Z':

        /* "gel/protocol/protocol_v0.pyx":325
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
        __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_sync_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 325, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "gel/protocol/protocol_v0.pyx":326
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
        goto __pyx_L9_break;

        /* "gel/protocol/protocol_v0.pyx":324
 *                         exc, output_format, expect_one, required_one)
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_sync_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol_v0.pyx":329
 * 
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *             finally:
 */
        __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.fallthrough(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 329, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol_v0.pyx":332
 * 
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 332, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L12;
      }
      __pyx_L11_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_26, &__pyx_t_25, &__pyx_t_24);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_17, &__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_18);
        __Pyx_XGOTREF(__pyx_t_17);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_26);
        __Pyx_XGOTREF(__pyx_t_25);
        __Pyx_XGOTREF(__pyx_t_24);
        __pyx_t_19 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_27 = __pyx_filename;
        {
          __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 332, __pyx_L41_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_26);
          __Pyx_XGIVEREF(__pyx_t_25);
          __Pyx_XGIVEREF(__pyx_t_24);
          __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
        }
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ErrRestore(__pyx_t_18, __pyx_t_17, __pyx_t_16);
        __pyx_t_18 = 0; __pyx_t_17 = 0; __pyx_t_16 = 0; __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
        __pyx_lineno = __pyx_t_19; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_27;
        goto __pyx_L1_error;
        __pyx_L41_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_26);
          __Pyx_XGIVEREF(__pyx_t_25);
          __Pyx_XGIVEREF(__pyx_t_24);
          __Pyx_ExceptionReset(__pyx_t_26, __pyx_t_25, __pyx_t_24);
        }
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_26 = 0; __pyx_t_25 = 0; __pyx_t_24 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L9_break: {
        __pyx_t_12 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 332, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L5_break;
      }
      __pyx_L12:;
    }
  }
  __pyx_L5_break:;

  /* "gel/protocol/protocol_v0.pyx":334
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  __pyx_t_3 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_3)) {

    /* "gel/protocol/protocol_v0.pyx":335
 * 
 *         if exc is not None:
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *         if re_exec:
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(19, 335, __pyx_L1_error)

    /* "gel/protocol/protocol_v0.pyx":334
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  }

  /* "gel/protocol/protocol_v0.pyx":337
 *             raise exc
 * 
 *         if re_exec:             # <<<<<<<<<<<<<<
 *             assert new_cardinality is not None
 *             if required_one and new_cardinality == CARDINALITY_NOT_APPLICABLE:
 */
  if (__pyx_cur_scope->__pyx_v_re_exec) {

    /* "gel/protocol/protocol_v0.pyx":338
 * 
 *         if re_exec:
 *             assert new_cardinality is not None             # <<<<<<<<<<<<<<
 *             if required_one and new_cardinality == CARDINALITY_NOT_APPLICABLE:
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(__pyx_assertions_enabled())) {
      __pyx_t_3 = (__pyx_cur_scope->__pyx_v_new_cardinality != ((PyObject*)Py_None));
      if (unlikely(!__pyx_t_3)) {
        __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
        __PYX_ERR(19, 338, __pyx_L1_error)
      }
    }
    #else
    if ((1)); else __PYX_ERR(19, 338, __pyx_L1_error)
    #endif

    /* "gel/protocol/protocol_v0.pyx":339
 *         if re_exec:
 *             assert new_cardinality is not None
 *             if required_one and new_cardinality == CARDINALITY_NOT_APPLICABLE:             # <<<<<<<<<<<<<<
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.InterfaceError(
 */
    if (__pyx_cur_scope->__pyx_v_required_one) {
    } else {
      __pyx_t_3 = __pyx_cur_scope->__pyx_v_required_one;
      goto __pyx_L45_bool_binop_done;
    }
    __pyx_t_28 = (__Pyx_PyBytes_Equals(__pyx_cur_scope->__pyx_v_new_cardinality, __pyx_n_b_n, Py_EQ)); if (unlikely((__pyx_t_28 < 0))) __PYX_ERR(19, 339, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_28;
    __pyx_L45_bool_binop_done:;
    if (unlikely(__pyx_t_3)) {

      /* "gel/protocol/protocol_v0.pyx":340
 *             assert new_cardinality is not None
 *             if required_one and new_cardinality == CARDINALITY_NOT_APPLICABLE:
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]             # <<<<<<<<<<<<<<
 *                 raise errors.InterfaceError(
 *                     f'query cannot be executed with {methname}() as it '
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_QUERY_SINGLE_METHOD); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_12, __pyx_cur_scope->__pyx_v_required_one, int, 1, __Pyx_PyBool_FromLong, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_cur_scope->__pyx_v_output_format); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_cur_scope->__pyx_v_methname = __pyx_t_8;
      __pyx_t_8 = 0;

      /* "gel/protocol/protocol_v0.pyx":341
 *             if required_one and new_cardinality == CARDINALITY_NOT_APPLICABLE:
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.InterfaceError(             # <<<<<<<<<<<<<<
 *                     f'query cannot be executed with {methname}() as it '
 *                     f'does not return any data')
 */
      __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_errors); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 341, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "gel/protocol/protocol_v0.pyx":342
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.InterfaceError(
 *                     f'query cannot be executed with {methname}() as it '             # <<<<<<<<<<<<<<
 *                     f'does not return any data')
 *             return await self._legacy_execute(in_dc, out_dc, args, kwargs)
 */
      __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(19, 342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_29 = 0;
      __pyx_t_30 = 127;
      __Pyx_INCREF(__pyx_kp_u_query_cannot_be_executed_with);
      __pyx_t_29 += 30;
      __Pyx_GIVEREF(__pyx_kp_u_query_cannot_be_executed_with);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_u_query_cannot_be_executed_with);
      __pyx_t_10 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_methname, __pyx_empty_unicode); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_30 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_30) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_30;
      __pyx_t_29 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_INCREF(__pyx_kp_u_as_it_does_not_return_any_data);
      __pyx_t_29 += 33;
      __Pyx_GIVEREF(__pyx_kp_u_as_it_does_not_return_any_data);
      PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_kp_u_as_it_does_not_return_any_data);
      __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __pyx_t_29, __pyx_t_30); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      __pyx_t_11 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
          __pyx_t_11 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_10};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_11, 1+__pyx_t_11);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 341, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(19, 341, __pyx_L1_error)

      /* "gel/protocol/protocol_v0.pyx":339
 *         if re_exec:
 *             assert new_cardinality is not None
 *             if required_one and new_cardinality == CARDINALITY_NOT_APPLICABLE:             # <<<<<<<<<<<<<<
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.InterfaceError(
 */
    }

    /* "gel/protocol/protocol_v0.pyx":344
 *                     f'query cannot be executed with {methname}() as it '
 *                     f'does not return any data')
 *             return await self._legacy_execute(in_dc, out_dc, args, kwargs)             # <<<<<<<<<<<<<<
 *         else:
 *             return result
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_legacy_execute); if (unlikely(!__pyx_t_13)) __PYX_ERR(19, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_10 = NULL;
    __pyx_t_11 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_11 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_10, ((PyObject *)__pyx_cur_scope->__pyx_v_in_dc), ((PyObject *)__pyx_cur_scope->__pyx_v_out_dc), __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_11, 4+__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    }
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L47_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 344, __pyx_L1_error)
      __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_8 = NULL;
      if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(19, 344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "gel/protocol/protocol_v0.pyx":337
 *             raise exc
 * 
 *         if re_exec:             # <<<<<<<<<<<<<<
 *             assert new_cardinality is not None
 *             if required_one and new_cardinality == CARDINALITY_NOT_APPLICABLE:
 */
  }

  /* "gel/protocol/protocol_v0.pyx":346
 *             return await self._legacy_execute(in_dc, out_dc, args, kwargs)
 *         else:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *     async def legacy_execute_anonymous(self, ctx: ExecuteContext):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_result);
    goto __pyx_L0;
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol_v0.pyx":228
 *         return result
 * 
 *     async def _legacy_optimistic_execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("_legacy_optimistic_execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_11generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol_v0.pyx":348
 *             return result
 * 
 *     async def legacy_execute_anonymous(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             BaseCodec in_dc
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_10legacy_execute_anonymous(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_10legacy_execute_anonymous = {"legacy_execute_anonymous", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_10legacy_execute_anonymous, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_10legacy_execute_anonymous(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("legacy_execute_anonymous (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ctx,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ctx)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 348, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "legacy_execute_anonymous") < 0)) __PYX_ERR(19, 348, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_ctx = ((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("legacy_execute_anonymous", 1, 1, 1, __pyx_nargs); __PYX_ERR(19, 348, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.legacy_execute_anonymous", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, 0, "ctx", 0))) __PYX_ERR(19, 348, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_9legacy_execute_anonymous(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self), __pyx_v_ctx);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_9legacy_execute_anonymous(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v_ctx) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("legacy_execute_anonymous", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(19, 348, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_ctx = __pyx_v_ctx;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_11generator17, __pyx_codeobj__90, (PyObject *) __pyx_cur_scope, __pyx_n_s_legacy_execute_anonymous, __pyx_n_s_SansIOProtocolBackwardsCompatibl_4, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(19, 348, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.legacy_execute_anonymous", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_11generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  uint64_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_UCS4 __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("legacy_execute_anonymous", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L5_resume_from_await;
    case 2: goto __pyx_L8_resume_from_await;
    case 3: goto __pyx_L12_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 348, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":353
 *             BaseCodec out_dc
 * 
 *             str query = ctx.query             # <<<<<<<<<<<<<<
 *             object args = ctx.args
 *             object kwargs = ctx.kwargs
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_ctx->query;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_query = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":354
 * 
 *             str query = ctx.query
 *             object args = ctx.args             # <<<<<<<<<<<<<<
 *             object kwargs = ctx.kwargs
 *             CodecsRegistry reg = ctx.reg
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_ctx->args;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_args = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":355
 *             str query = ctx.query
 *             object args = ctx.args
 *             object kwargs = ctx.kwargs             # <<<<<<<<<<<<<<
 *             CodecsRegistry reg = ctx.reg
 *             OutputFormat output_format = ctx.output_format
 */
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_ctx->kwargs;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_kwargs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":356
 *             object args = ctx.args
 *             object kwargs = ctx.kwargs
 *             CodecsRegistry reg = ctx.reg             # <<<<<<<<<<<<<<
 *             OutputFormat output_format = ctx.output_format
 *             bint expect_one = ctx.expect_one
 */
  __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_v_ctx->reg);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":357
 *             object kwargs = ctx.kwargs
 *             CodecsRegistry reg = ctx.reg
 *             OutputFormat output_format = ctx.output_format             # <<<<<<<<<<<<<<
 *             bint expect_one = ctx.expect_one
 *             bint required_one = ctx.required_one
 */
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_ctx->output_format;
  __pyx_cur_scope->__pyx_v_output_format = __pyx_t_2;

  /* "gel/protocol/protocol_v0.pyx":358
 *             CodecsRegistry reg = ctx.reg
 *             OutputFormat output_format = ctx.output_format
 *             bint expect_one = ctx.expect_one             # <<<<<<<<<<<<<<
 *             bint required_one = ctx.required_one
 *             int implicit_limit = ctx.implicit_limit
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->expect_one;
  __pyx_cur_scope->__pyx_v_expect_one = __pyx_t_3;

  /* "gel/protocol/protocol_v0.pyx":359
 *             OutputFormat output_format = ctx.output_format
 *             bint expect_one = ctx.expect_one
 *             bint required_one = ctx.required_one             # <<<<<<<<<<<<<<
 *             int implicit_limit = ctx.implicit_limit
 *             bint inline_typenames = ctx.inline_typenames
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->required_one;
  __pyx_cur_scope->__pyx_v_required_one = __pyx_t_3;

  /* "gel/protocol/protocol_v0.pyx":360
 *             bint expect_one = ctx.expect_one
 *             bint required_one = ctx.required_one
 *             int implicit_limit = ctx.implicit_limit             # <<<<<<<<<<<<<<
 *             bint inline_typenames = ctx.inline_typenames
 *             bint inline_typeids = ctx.inline_typeids
 */
  __pyx_t_4 = __pyx_cur_scope->__pyx_v_ctx->implicit_limit;
  __pyx_cur_scope->__pyx_v_implicit_limit = __pyx_t_4;

  /* "gel/protocol/protocol_v0.pyx":361
 *             bint required_one = ctx.required_one
 *             int implicit_limit = ctx.implicit_limit
 *             bint inline_typenames = ctx.inline_typenames             # <<<<<<<<<<<<<<
 *             bint inline_typeids = ctx.inline_typeids
 *             uint64_t allow_capabilities = ctx.allow_capabilities
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->inline_typenames;
  __pyx_cur_scope->__pyx_v_inline_typenames = __pyx_t_3;

  /* "gel/protocol/protocol_v0.pyx":362
 *             int implicit_limit = ctx.implicit_limit
 *             bint inline_typenames = ctx.inline_typenames
 *             bint inline_typeids = ctx.inline_typeids             # <<<<<<<<<<<<<<
 *             uint64_t allow_capabilities = ctx.allow_capabilities
 * 
 */
  __pyx_t_3 = __pyx_cur_scope->__pyx_v_ctx->inline_typeids;
  __pyx_cur_scope->__pyx_v_inline_typeids = __pyx_t_3;

  /* "gel/protocol/protocol_v0.pyx":363
 *             bint inline_typenames = ctx.inline_typenames
 *             bint inline_typeids = ctx.inline_typeids
 *             uint64_t allow_capabilities = ctx.allow_capabilities             # <<<<<<<<<<<<<<
 * 
 *         self.ensure_connected()
 */
  __pyx_t_5 = __pyx_cur_scope->__pyx_v_ctx->allow_capabilities;
  __pyx_cur_scope->__pyx_v_allow_capabilities = __pyx_t_5;

  /* "gel/protocol/protocol_v0.pyx":365
 *             uint64_t allow_capabilities = ctx.allow_capabilities
 * 
 *         self.ensure_connected()             # <<<<<<<<<<<<<<
 *         self.reset_status()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ensure_connected(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":366
 * 
 *         self.ensure_connected()
 *         self.reset_status()             # <<<<<<<<<<<<<<
 * 
 *         if not ctx.load_from_cache():
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reset_status(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":368
 *         self.reset_status()
 * 
 *         if not ctx.load_from_cache():             # <<<<<<<<<<<<<<
 *             codecs = await self._legacy_parse(
 *                 query,
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_ExecuteContext *)__pyx_cur_scope->__pyx_v_ctx->__pyx_vtab)->load_from_cache(__pyx_cur_scope->__pyx_v_ctx); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 368, __pyx_L1_error)
  __pyx_t_6 = (!__pyx_t_3);
  if (__pyx_t_6) {

    /* "gel/protocol/protocol_v0.pyx":369
 * 
 *         if not ctx.load_from_cache():
 *             codecs = await self._legacy_parse(             # <<<<<<<<<<<<<<
 *                 query,
 *                 reg=reg,
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_legacy_parse); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "gel/protocol/protocol_v0.pyx":370
 *         if not ctx.load_from_cache():
 *             codecs = await self._legacy_parse(
 *                 query,             # <<<<<<<<<<<<<<
 *                 reg=reg,
 *                 output_format=output_format,
 */
    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_query)) __PYX_ERR(19, 369, __pyx_L1_error);

    /* "gel/protocol/protocol_v0.pyx":371
 *             codecs = await self._legacy_parse(
 *                 query,
 *                 reg=reg,             # <<<<<<<<<<<<<<
 *                 output_format=output_format,
 *                 expect_one=expect_one,
 */
    __pyx_t_8 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_reg, ((PyObject *)__pyx_cur_scope->__pyx_v_reg)) < 0) __PYX_ERR(19, 371, __pyx_L1_error)

    /* "gel/protocol/protocol_v0.pyx":372
 *                 query,
 *                 reg=reg,
 *                 output_format=output_format,             # <<<<<<<<<<<<<<
 *                 expect_one=expect_one,
 *                 required_one=required_one,
 */
    __pyx_t_9 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_cur_scope->__pyx_v_output_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_output_format, __pyx_t_9) < 0) __PYX_ERR(19, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":373
 *                 reg=reg,
 *                 output_format=output_format,
 *                 expect_one=expect_one,             # <<<<<<<<<<<<<<
 *                 required_one=required_one,
 *                 implicit_limit=implicit_limit,
 */
    __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_expect_one); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_expect_one, __pyx_t_9) < 0) __PYX_ERR(19, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":374
 *                 output_format=output_format,
 *                 expect_one=expect_one,
 *                 required_one=required_one,             # <<<<<<<<<<<<<<
 *                 implicit_limit=implicit_limit,
 *                 inline_typenames=inline_typenames,
 */
    __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_required_one); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_required_one, __pyx_t_9) < 0) __PYX_ERR(19, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":375
 *                 expect_one=expect_one,
 *                 required_one=required_one,
 *                 implicit_limit=implicit_limit,             # <<<<<<<<<<<<<<
 *                 inline_typenames=inline_typenames,
 *                 inline_typeids=inline_typeids,
 */
    __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_implicit_limit); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_implicit_limit, __pyx_t_9) < 0) __PYX_ERR(19, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":376
 *                 required_one=required_one,
 *                 implicit_limit=implicit_limit,
 *                 inline_typenames=inline_typenames,             # <<<<<<<<<<<<<<
 *                 inline_typeids=inline_typeids,
 *                 allow_capabilities=allow_capabilities,
 */
    __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_inline_typenames); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_inline_typenames, __pyx_t_9) < 0) __PYX_ERR(19, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":377
 *                 implicit_limit=implicit_limit,
 *                 inline_typenames=inline_typenames,
 *                 inline_typeids=inline_typeids,             # <<<<<<<<<<<<<<
 *                 allow_capabilities=allow_capabilities,
 *             )
 */
    __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_inline_typeids); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_inline_typeids, __pyx_t_9) < 0) __PYX_ERR(19, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":378
 *                 inline_typenames=inline_typenames,
 *                 inline_typeids=inline_typeids,
 *                 allow_capabilities=allow_capabilities,             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_9 = __Pyx_PyInt_From_uint64_t(__pyx_cur_scope->__pyx_v_allow_capabilities); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_allow_capabilities, __pyx_t_9) < 0) __PYX_ERR(19, 371, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":369
 * 
 *         if not ctx.load_from_cache():
 *             codecs = await self._legacy_parse(             # <<<<<<<<<<<<<<
 *                 query,
 *                 reg=reg,
 */
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_9);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 1;
      return __pyx_r;
      __pyx_L5_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 369, __pyx_L1_error)
      __pyx_t_9 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_9);
    } else {
      __pyx_t_9 = NULL;
      if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_9) < 0) __PYX_ERR(19, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_cur_scope->__pyx_v_codecs = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":381
 *             )
 * 
 *             cardinality = codecs[0]             # <<<<<<<<<<<<<<
 *             in_dc = <BaseCodec>codecs[1]
 *             out_dc = <BaseCodec>codecs[2]
 */
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_codecs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_cur_scope->__pyx_v_cardinality = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":382
 * 
 *             cardinality = codecs[0]
 *             in_dc = <BaseCodec>codecs[1]             # <<<<<<<<<<<<<<
 *             out_dc = <BaseCodec>codecs[2]
 *             headers = <BaseCodec>codecs[3]
 */
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_codecs, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __pyx_t_9;
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_cur_scope->__pyx_v_in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/protocol_v0.pyx":383
 *             cardinality = codecs[0]
 *             in_dc = <BaseCodec>codecs[1]
 *             out_dc = <BaseCodec>codecs[2]             # <<<<<<<<<<<<<<
 *             headers = <BaseCodec>codecs[3]
 * 
 */
    __pyx_t_8 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_codecs, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __pyx_t_8;
    __Pyx_INCREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GIVEREF(__pyx_t_9);
    __pyx_cur_scope->__pyx_v_out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_9);
    __pyx_t_9 = 0;

    /* "gel/protocol/protocol_v0.pyx":384
 *             in_dc = <BaseCodec>codecs[1]
 *             out_dc = <BaseCodec>codecs[2]
 *             headers = <BaseCodec>codecs[3]             # <<<<<<<<<<<<<<
 * 
 *             capabilities = None
 */
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_codecs, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __pyx_t_9;
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_cur_scope->__pyx_v_headers = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/protocol_v0.pyx":386
 *             headers = <BaseCodec>codecs[3]
 * 
 *             capabilities = None             # <<<<<<<<<<<<<<
 *             if headers:
 *                 capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __pyx_cur_scope->__pyx_v_capabilities = Py_None;

    /* "gel/protocol/protocol_v0.pyx":387
 * 
 *             capabilities = None
 *             if headers:             # <<<<<<<<<<<<<<
 *                 capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *                 if capabilities is not None:
 */
    __pyx_t_6 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_cur_scope->__pyx_v_headers)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(19, 387, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "gel/protocol/protocol_v0.pyx":388
 *             capabilities = None
 *             if headers:
 *                 capabilities = headers.get(SERVER_HEADER_CAPABILITIES)             # <<<<<<<<<<<<<<
 *                 if capabilities is not None:
 *                     capabilities = int.from_bytes(capabilities, 'big')
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_headers), __pyx_n_s_get); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = NULL;
      __pyx_t_10 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_10 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_int_4097};
        __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_capabilities);
      __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_capabilities, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      __pyx_t_8 = 0;

      /* "gel/protocol/protocol_v0.pyx":389
 *             if headers:
 *                 capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *                 if capabilities is not None:             # <<<<<<<<<<<<<<
 *                     capabilities = int.from_bytes(capabilities, 'big')
 * 
 */
      __pyx_t_6 = (__pyx_cur_scope->__pyx_v_capabilities != Py_None);
      if (__pyx_t_6) {

        /* "gel/protocol/protocol_v0.pyx":390
 *                 capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *                 if capabilities is not None:
 *                     capabilities = int.from_bytes(capabilities, 'big')             # <<<<<<<<<<<<<<
 * 
 *             ctx.cardinality = cardinality
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 390, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = NULL;
        __pyx_t_10 = 0;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
            __pyx_t_10 = 1;
          }
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_capabilities, __pyx_n_u_big};
          __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 390, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_capabilities);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_capabilities, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_8);
        __pyx_t_8 = 0;

        /* "gel/protocol/protocol_v0.pyx":389
 *             if headers:
 *                 capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *                 if capabilities is not None:             # <<<<<<<<<<<<<<
 *                     capabilities = int.from_bytes(capabilities, 'big')
 * 
 */
      }

      /* "gel/protocol/protocol_v0.pyx":387
 * 
 *             capabilities = None
 *             if headers:             # <<<<<<<<<<<<<<
 *                 capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *                 if capabilities is not None:
 */
    }

    /* "gel/protocol/protocol_v0.pyx":392
 *                     capabilities = int.from_bytes(capabilities, 'big')
 * 
 *             ctx.cardinality = cardinality             # <<<<<<<<<<<<<<
 *             ctx.in_dc = in_dc
 *             ctx.out_dc = out_dc
 */
    if (!(likely(PyBytes_CheckExact(__pyx_cur_scope->__pyx_v_cardinality))||((__pyx_cur_scope->__pyx_v_cardinality) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_cur_scope->__pyx_v_cardinality))) __PYX_ERR(19, 392, __pyx_L1_error)
    __pyx_t_8 = __pyx_cur_scope->__pyx_v_cardinality;
    __Pyx_INCREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_ctx->cardinality);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_ctx->cardinality);
    __pyx_cur_scope->__pyx_v_ctx->cardinality = ((PyObject*)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "gel/protocol/protocol_v0.pyx":393
 * 
 *             ctx.cardinality = cardinality
 *             ctx.in_dc = in_dc             # <<<<<<<<<<<<<<
 *             ctx.out_dc = out_dc
 *             ctx.capabilities = capabilities
 */
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
    __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_in_dc);
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
    __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->in_dc);
    __pyx_cur_scope->__pyx_v_ctx->in_dc = __pyx_cur_scope->__pyx_v_in_dc;

    /* "gel/protocol/protocol_v0.pyx":394
 *             ctx.cardinality = cardinality
 *             ctx.in_dc = in_dc
 *             ctx.out_dc = out_dc             # <<<<<<<<<<<<<<
 *             ctx.capabilities = capabilities
 *             ctx.store_to_cache()
 */
    __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
    __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_out_dc);
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->out_dc);
    __Pyx_DECREF((PyObject *)__pyx_cur_scope->__pyx_v_ctx->out_dc);
    __pyx_cur_scope->__pyx_v_ctx->out_dc = __pyx_cur_scope->__pyx_v_out_dc;

    /* "gel/protocol/protocol_v0.pyx":395
 *             ctx.in_dc = in_dc
 *             ctx.out_dc = out_dc
 *             ctx.capabilities = capabilities             # <<<<<<<<<<<<<<
 *             ctx.store_to_cache()
 * 
 */
    __pyx_t_5 = __Pyx_PyInt_As_uint64_t(__pyx_cur_scope->__pyx_v_capabilities); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 395, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_ctx->capabilities = __pyx_t_5;

    /* "gel/protocol/protocol_v0.pyx":396
 *             ctx.out_dc = out_dc
 *             ctx.capabilities = capabilities
 *             ctx.store_to_cache()             # <<<<<<<<<<<<<<
 * 
 *             ret = await self._legacy_execute(in_dc, out_dc, args, kwargs)
 */
    __pyx_t_8 = __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_store_to_cache(__pyx_cur_scope->__pyx_v_ctx); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "gel/protocol/protocol_v0.pyx":398
 *             ctx.store_to_cache()
 * 
 *             ret = await self._legacy_execute(in_dc, out_dc, args, kwargs)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_legacy_execute); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_7 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_9))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_9, function);
        __pyx_t_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[5] = {__pyx_t_7, ((PyObject *)__pyx_cur_scope->__pyx_v_in_dc), ((PyObject *)__pyx_cur_scope->__pyx_v_out_dc), __pyx_cur_scope->__pyx_v_args, __pyx_cur_scope->__pyx_v_kwargs};
      __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 4+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 2;
      return __pyx_r;
      __pyx_L8_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 398, __pyx_L1_error)
      __pyx_t_8 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_8);
    } else {
      __pyx_t_8 = NULL;
      if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_8) < 0) __PYX_ERR(19, 398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
    }
    __Pyx_GIVEREF(__pyx_t_8);
    __pyx_cur_scope->__pyx_v_ret = __pyx_t_8;
    __pyx_t_8 = 0;

    /* "gel/protocol/protocol_v0.pyx":368
 *         self.reset_status()
 * 
 *         if not ctx.load_from_cache():             # <<<<<<<<<<<<<<
 *             codecs = await self._legacy_parse(
 *                 query,
 */
    goto __pyx_L4;
  }

  /* "gel/protocol/protocol_v0.pyx":401
 * 
 *         else:
 *             if required_one and ctx.has_na_cardinality():             # <<<<<<<<<<<<<<
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.InterfaceError(
 */
  /*else*/ {
    if (__pyx_cur_scope->__pyx_v_required_one) {
    } else {
      __pyx_t_6 = __pyx_cur_scope->__pyx_v_required_one;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_3 = __pyx_f_3gel_8protocol_8protocol_14ExecuteContext_has_na_cardinality(__pyx_cur_scope->__pyx_v_ctx); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 401, __pyx_L1_error)
    __pyx_t_6 = __pyx_t_3;
    __pyx_L10_bool_binop_done:;
    if (unlikely(__pyx_t_6)) {

      /* "gel/protocol/protocol_v0.pyx":402
 *         else:
 *             if required_one and ctx.has_na_cardinality():
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]             # <<<<<<<<<<<<<<
 *                 raise errors.InterfaceError(
 *                     f'query cannot be executed with {methname}() as it '
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_QUERY_SINGLE_METHOD); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 402, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, __pyx_cur_scope->__pyx_v_required_one, int, 1, __Pyx_PyBool_FromLong, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 402, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_cur_scope->__pyx_v_output_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 402, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 402, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_cur_scope->__pyx_v_methname = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "gel/protocol/protocol_v0.pyx":403
 *             if required_one and ctx.has_na_cardinality():
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.InterfaceError(             # <<<<<<<<<<<<<<
 *                     f'query cannot be executed with {methname}() as it '
 *                     f'does not return any data')
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_errors); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "gel/protocol/protocol_v0.pyx":404
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.InterfaceError(
 *                     f'query cannot be executed with {methname}() as it '             # <<<<<<<<<<<<<<
 *                     f'does not return any data')
 * 
 */
      __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_11 = 0;
      __pyx_t_12 = 127;
      __Pyx_INCREF(__pyx_kp_u_query_cannot_be_executed_with);
      __pyx_t_11 += 30;
      __Pyx_GIVEREF(__pyx_kp_u_query_cannot_be_executed_with);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_kp_u_query_cannot_be_executed_with);
      __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_methname, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_12;
      __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_kp_u_as_it_does_not_return_any_data);
      __pyx_t_11 += 33;
      __Pyx_GIVEREF(__pyx_kp_u_as_it_does_not_return_any_data);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_u_as_it_does_not_return_any_data);
      __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_8, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 404, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      __pyx_t_10 = 0;
      #if CYTHON_UNPACK_METHODS
      if (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_10 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_1};
        __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(19, 403, __pyx_L1_error)

      /* "gel/protocol/protocol_v0.pyx":401
 * 
 *         else:
 *             if required_one and ctx.has_na_cardinality():             # <<<<<<<<<<<<<<
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.InterfaceError(
 */
    }

    /* "gel/protocol/protocol_v0.pyx":407
 *                     f'does not return any data')
 * 
 *             ret = await self._legacy_optimistic_execute(ctx)             # <<<<<<<<<<<<<<
 * 
 *         if expect_one:
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_legacy_optimistic_execute); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_1 = NULL;
    __pyx_t_10 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_10 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_cur_scope->__pyx_v_ctx)};
      __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_7);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XGOTREF(__pyx_r);
    if (likely(__pyx_r)) {
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
      /* return from generator, awaiting value */
      __pyx_generator->resume_label = 3;
      return __pyx_r;
      __pyx_L12_resume_from_await:;
      if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 407, __pyx_L1_error)
      __pyx_t_7 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_7);
    } else {
      __pyx_t_7 = NULL;
      if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_7) < 0) __PYX_ERR(19, 407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_GIVEREF(__pyx_t_7);
    __pyx_cur_scope->__pyx_v_ret = __pyx_t_7;
    __pyx_t_7 = 0;
  }
  __pyx_L4:;

  /* "gel/protocol/protocol_v0.pyx":409
 *             ret = await self._legacy_optimistic_execute(ctx)
 * 
 *         if expect_one:             # <<<<<<<<<<<<<<
 *             if ret or not required_one:
 *                 if ret:
 */
  if (__pyx_cur_scope->__pyx_v_expect_one) {

    /* "gel/protocol/protocol_v0.pyx":410
 * 
 *         if expect_one:
 *             if ret or not required_one:             # <<<<<<<<<<<<<<
 *                 if ret:
 *                     return ret[0]
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ret); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(19, 410, __pyx_L1_error)
    if (!__pyx_t_3) {
    } else {
      __pyx_t_6 = __pyx_t_3;
      goto __pyx_L15_bool_binop_done;
    }
    __pyx_t_3 = (!__pyx_cur_scope->__pyx_v_required_one);
    __pyx_t_6 = __pyx_t_3;
    __pyx_L15_bool_binop_done:;
    if (likely(__pyx_t_6)) {

      /* "gel/protocol/protocol_v0.pyx":411
 *         if expect_one:
 *             if ret or not required_one:
 *                 if ret:             # <<<<<<<<<<<<<<
 *                     return ret[0]
 *                 else:
 */
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ret); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(19, 411, __pyx_L1_error)
      if (__pyx_t_6) {

        /* "gel/protocol/protocol_v0.pyx":412
 *             if ret or not required_one:
 *                 if ret:
 *                     return ret[0]             # <<<<<<<<<<<<<<
 *                 else:
 *                     if output_format == OutputFormat.JSON:
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "gel/protocol/protocol_v0.pyx":411
 *         if expect_one:
 *             if ret or not required_one:
 *                 if ret:             # <<<<<<<<<<<<<<
 *                     return ret[0]
 *                 else:
 */
      }

      /* "gel/protocol/protocol_v0.pyx":414
 *                     return ret[0]
 *                 else:
 *                     if output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                         return 'null'
 *                     else:
 */
      /*else*/ {
        __pyx_t_6 = (__pyx_cur_scope->__pyx_v_output_format == __pyx_e_3gel_8protocol_8protocol_JSON);
        if (__pyx_t_6) {

          /* "gel/protocol/protocol_v0.pyx":415
 *                 else:
 *                     if output_format == OutputFormat.JSON:
 *                         return 'null'             # <<<<<<<<<<<<<<
 *                     else:
 *                         return None
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_n_u_null);
          goto __pyx_L0;

          /* "gel/protocol/protocol_v0.pyx":414
 *                     return ret[0]
 *                 else:
 *                     if output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                         return 'null'
 *                     else:
 */
        }

        /* "gel/protocol/protocol_v0.pyx":417
 *                         return 'null'
 *                     else:
 *                         return None             # <<<<<<<<<<<<<<
 *             else:
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 */
        /*else*/ {
          __Pyx_XDECREF(__pyx_r);
          __pyx_r = NULL;
          goto __pyx_L0;
        }
      }

      /* "gel/protocol/protocol_v0.pyx":410
 * 
 *         if expect_one:
 *             if ret or not required_one:             # <<<<<<<<<<<<<<
 *                 if ret:
 *                     return ret[0]
 */
    }

    /* "gel/protocol/protocol_v0.pyx":419
 *                         return None
 *             else:
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]             # <<<<<<<<<<<<<<
 *                 raise errors.NoDataError(
 *                     f'query executed via {methname}() returned no data')
 */
    /*else*/ {
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_QUERY_SINGLE_METHOD); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, __pyx_cur_scope->__pyx_v_required_one, int, 1, __Pyx_PyBool_FromLong, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_cur_scope->__pyx_v_output_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_cur_scope->__pyx_v_methname = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "gel/protocol/protocol_v0.pyx":420
 *             else:
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.NoDataError(             # <<<<<<<<<<<<<<
 *                     f'query executed via {methname}() returned no data')
 *         else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_errors); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_NoDataError); if (unlikely(!__pyx_t_9)) __PYX_ERR(19, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "gel/protocol/protocol_v0.pyx":421
 *                 methname = _QUERY_SINGLE_METHOD[required_one][output_format]
 *                 raise errors.NoDataError(
 *                     f'query executed via {methname}() returned no data')             # <<<<<<<<<<<<<<
 *         else:
 *             if ret:
 */
      __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(19, 421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = 0;
      __pyx_t_12 = 127;
      __Pyx_INCREF(__pyx_kp_u_query_executed_via);
      __pyx_t_11 += 19;
      __Pyx_GIVEREF(__pyx_kp_u_query_executed_via);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_u_query_executed_via);
      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_cur_scope->__pyx_v_methname, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_12;
      __pyx_t_11 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_INCREF(__pyx_kp_u_returned_no_data);
      __pyx_t_11 += 19;
      __Pyx_GIVEREF(__pyx_kp_u_returned_no_data);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_kp_u_returned_no_data);
      __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, __pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(19, 421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = NULL;
      __pyx_t_10 = 0;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_10 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(19, 420, __pyx_L1_error)
    }

    /* "gel/protocol/protocol_v0.pyx":409
 *             ret = await self._legacy_optimistic_execute(ctx)
 * 
 *         if expect_one:             # <<<<<<<<<<<<<<
 *             if ret or not required_one:
 *                 if ret:
 */
  }

  /* "gel/protocol/protocol_v0.pyx":423
 *                     f'query executed via {methname}() returned no data')
 *         else:
 *             if ret:             # <<<<<<<<<<<<<<
 *                 if output_format == OutputFormat.JSON:
 *                     return ret[0]
 */
  /*else*/ {
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_ret); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(19, 423, __pyx_L1_error)
    if (__pyx_t_6) {

      /* "gel/protocol/protocol_v0.pyx":424
 *         else:
 *             if ret:
 *                 if output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                     return ret[0]
 *                 else:
 */
      __pyx_t_6 = (__pyx_cur_scope->__pyx_v_output_format == __pyx_e_3gel_8protocol_8protocol_JSON);
      if (__pyx_t_6) {

        /* "gel/protocol/protocol_v0.pyx":425
 *             if ret:
 *                 if output_format == OutputFormat.JSON:
 *                     return ret[0]             # <<<<<<<<<<<<<<
 *                 else:
 *                     return ret
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_ret, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 425, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;

        /* "gel/protocol/protocol_v0.pyx":424
 *         else:
 *             if ret:
 *                 if output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                     return ret[0]
 *                 else:
 */
      }

      /* "gel/protocol/protocol_v0.pyx":427
 *                     return ret[0]
 *                 else:
 *                     return ret             # <<<<<<<<<<<<<<
 *             else:
 *                 if output_format == OutputFormat.JSON:
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_ret);
        goto __pyx_L0;
      }

      /* "gel/protocol/protocol_v0.pyx":423
 *                     f'query executed via {methname}() returned no data')
 *         else:
 *             if ret:             # <<<<<<<<<<<<<<
 *                 if output_format == OutputFormat.JSON:
 *                     return ret[0]
 */
    }

    /* "gel/protocol/protocol_v0.pyx":429
 *                     return ret
 *             else:
 *                 if output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                     return '[]'
 *                 else:
 */
    /*else*/ {
      __pyx_t_6 = (__pyx_cur_scope->__pyx_v_output_format == __pyx_e_3gel_8protocol_8protocol_JSON);
      if (__pyx_t_6) {

        /* "gel/protocol/protocol_v0.pyx":430
 *             else:
 *                 if output_format == OutputFormat.JSON:
 *                     return '[]'             # <<<<<<<<<<<<<<
 *                 else:
 *                     return ret
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_kp_u__65);
        goto __pyx_L0;

        /* "gel/protocol/protocol_v0.pyx":429
 *                     return ret
 *             else:
 *                 if output_format == OutputFormat.JSON:             # <<<<<<<<<<<<<<
 *                     return '[]'
 *                 else:
 */
      }

      /* "gel/protocol/protocol_v0.pyx":432
 *                     return '[]'
 *                 else:
 *                     return ret             # <<<<<<<<<<<<<<
 * 
 *     async def legacy_simple_query(
 */
      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_cur_scope->__pyx_v_ret);
        goto __pyx_L0;
      }
    }
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol_v0.pyx":348
 *             return result
 * 
 *     async def legacy_execute_anonymous(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             BaseCodec in_dc
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("legacy_execute_anonymous", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_14generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "gel/protocol/protocol_v0.pyx":434
 *                     return ret
 * 
 *     async def legacy_simple_query(             # <<<<<<<<<<<<<<
 *         self, str query, capabilities: enums.Capability
 *     ):
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_13legacy_simple_query(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_13legacy_simple_query = {"legacy_simple_query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_13legacy_simple_query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_13legacy_simple_query(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_capabilities = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("legacy_simple_query (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_capabilities,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_query)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 434, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_capabilities)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 434, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("legacy_simple_query", 1, 2, 2, 1); __PYX_ERR(19, 434, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "legacy_simple_query") < 0)) __PYX_ERR(19, 434, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_query = ((PyObject*)values[0]);
    __pyx_v_capabilities = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("legacy_simple_query", 1, 2, 2, __pyx_nargs); __PYX_ERR(19, 434, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.legacy_simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyUnicode_Type), 1, "query", 1))) __PYX_ERR(19, 435, __pyx_L1_error)
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_12legacy_simple_query(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self), __pyx_v_query, __pyx_v_capabilities);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_12legacy_simple_query(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_capabilities) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("legacy_simple_query", 0);
  __pyx_cur_scope = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(19, 434, __pyx_L1_error)
  } else {
    __Pyx_GOTREF((PyObject *)__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_query = __pyx_v_query;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_query);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_query);
  __pyx_cur_scope->__pyx_v_capabilities = __pyx_v_capabilities;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_capabilities);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_capabilities);
  {
    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_14generator18, __pyx_codeobj__91, (PyObject *) __pyx_cur_scope, __pyx_n_s_legacy_simple_query, __pyx_n_s_SansIOProtocolBackwardsCompatibl_5, __pyx_n_s_gel_protocol_protocol); if (unlikely(!gen)) __PYX_ERR(19, 434, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.legacy_simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF((PyObject *)__pyx_cur_scope);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_14generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *__pyx_cur_scope = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  char *__pyx_t_2;
  uint64_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int32_t __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  char __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("legacy_simple_query", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L7_resume_from_await;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 434, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":441
 *             char mtype
 * 
 *         self.ensure_connected()             # <<<<<<<<<<<<<<
 *         self.reset_status()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.ensure_connected(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":442
 * 
 *         self.ensure_connected()
 *         self.reset_status()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.reset_status(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":445
 * 
 * 
 *         buf = WriteBuffer.new_message(EXECUTE_SCRIPT_MSG)             # <<<<<<<<<<<<<<
 *         cap_bytes = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))
 *         hton.pack_int64(
 */
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('Q')); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_buf = ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":446
 * 
 *         buf = WriteBuffer.new_message(EXECUTE_SCRIPT_MSG)
 *         cap_bytes = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))             # <<<<<<<<<<<<<<
 *         hton.pack_int64(
 *             cpython.PyBytes_AsString(cap_bytes),
 */
  __pyx_t_1 = PyBytes_FromStringAndSize(NULL, (sizeof(uint64_t))); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_cap_bytes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":448
 *         cap_bytes = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))
 *         hton.pack_int64(
 *             cpython.PyBytes_AsString(cap_bytes),             # <<<<<<<<<<<<<<
 *             <int64_t><uint64_t>capabilities,
 *         )
 */
  __pyx_t_2 = PyBytes_AsString(__pyx_cur_scope->__pyx_v_cap_bytes); if (unlikely(__pyx_t_2 == ((char *)NULL))) __PYX_ERR(19, 448, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":449
 *         hton.pack_int64(
 *             cpython.PyBytes_AsString(cap_bytes),
 *             <int64_t><uint64_t>capabilities,             # <<<<<<<<<<<<<<
 *         )
 *         self.legacy_write_headers(
 */
  __pyx_t_3 = __Pyx_PyInt_As_uint64_t(__pyx_cur_scope->__pyx_v_capabilities); if (unlikely((__pyx_t_3 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 449, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":447
 *         buf = WriteBuffer.new_message(EXECUTE_SCRIPT_MSG)
 *         cap_bytes = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))
 *         hton.pack_int64(             # <<<<<<<<<<<<<<
 *             cpython.PyBytes_AsString(cap_bytes),
 *             <int64_t><uint64_t>capabilities,
 */
  pack_int64(__pyx_t_2, ((int64_t)((uint64_t)__pyx_t_3)));

  /* "gel/protocol/protocol_v0.pyx":453
 *         self.legacy_write_headers(
 *             buf,
 *             {QUERY_OPT_ALLOW_CAPABILITIES: cap_bytes},             # <<<<<<<<<<<<<<
 *         )
 *         buf.write_len_prefixed_utf8(query)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_65284, __pyx_cur_scope->__pyx_v_cap_bytes) < 0) __PYX_ERR(19, 453, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":451
 *             <int64_t><uint64_t>capabilities,
 *         )
 *         self.legacy_write_headers(             # <<<<<<<<<<<<<<
 *             buf,
 *             {QUERY_OPT_ALLOW_CAPABILITIES: cap_bytes},
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->legacy_write_headers(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_buf, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 451, __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;

  /* "gel/protocol/protocol_v0.pyx":455
 *             {QUERY_OPT_ALLOW_CAPABILITIES: cap_bytes},
 *         )
 *         buf.write_len_prefixed_utf8(query)             # <<<<<<<<<<<<<<
 *         self.write(buf.end_message())
 * 
 */
  __pyx_t_4 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_cur_scope->__pyx_v_buf, __pyx_cur_scope->__pyx_v_query); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/protocol_v0.pyx":456
 *         )
 *         buf.write_len_prefixed_utf8(query)
 *         self.write(buf.end_message())             # <<<<<<<<<<<<<<
 * 
 *         exc = None
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_cur_scope->__pyx_v_buf->__pyx_vtab)->end_message(__pyx_cur_scope->__pyx_v_buf); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer))))) __PYX_ERR(19, 456, __pyx_L1_error)
  __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.write(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self), ((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 456, __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;

  /* "gel/protocol/protocol_v0.pyx":458
 *         self.write(buf.end_message())
 * 
 *         exc = None             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_cur_scope->__pyx_v_exc = Py_None;

  /* "gel/protocol/protocol_v0.pyx":460
 *         exc = None
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 */
  while (1) {

    /* "gel/protocol/protocol_v0.pyx":461
 * 
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->take_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_5 == ((int32_t)-1))) __PYX_ERR(19, 461, __pyx_L1_error)
    __pyx_t_6 = (!(__pyx_t_5 != 0));
    if (__pyx_t_6) {

      /* "gel/protocol/protocol_v0.pyx":462
 *         while True:
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()             # <<<<<<<<<<<<<<
 *             mtype = self.buffer.get_message_type()
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_wait_for_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      #if CYTHON_UNPACK_METHODS
      if (likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_8 = 1;
        }
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 462, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XGOTREF(__pyx_r);
      if (likely(__pyx_r)) {
        __Pyx_XGIVEREF(__pyx_r);
        __Pyx_RefNannyFinishContext();
        __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
        /* return from generator, awaiting value */
        __pyx_generator->resume_label = 1;
        return __pyx_r;
        __pyx_L7_resume_from_await:;
        if (unlikely(!__pyx_sent_value)) __PYX_ERR(19, 462, __pyx_L1_error)
      } else {
        PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
          else __PYX_ERR(19, 462, __pyx_L1_error)
        }
      }

      /* "gel/protocol/protocol_v0.pyx":461
 * 
 *         while True:
 *             if not self.buffer.take_message():             # <<<<<<<<<<<<<<
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()
 */
    }

    /* "gel/protocol/protocol_v0.pyx":463
 *             if not self.buffer.take_message():
 *                 await self.wait_for_message()
 *             mtype = self.buffer.get_message_type()             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __pyx_t_9 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 463, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_mtype = __pyx_t_9;

    /* "gel/protocol/protocol_v0.pyx":465
 *             mtype = self.buffer.get_message_type()
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if mtype == COMMAND_COMPLETE_MSG:
 *                     self.parse_legacy_command_complete_message()
 */
    /*try:*/ {

      /* "gel/protocol/protocol_v0.pyx":466
 * 
 *             try:
 *                 if mtype == COMMAND_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_legacy_command_complete_message()
 * 
 */
      switch (__pyx_cur_scope->__pyx_v_mtype) {
        case 'C':

        /* "gel/protocol/protocol_v0.pyx":467
 *             try:
 *                 if mtype == COMMAND_COMPLETE_MSG:
 *                     self.parse_legacy_command_complete_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->parse_legacy_command_complete_message(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 467, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "gel/protocol/protocol_v0.pyx":466
 * 
 *             try:
 *                 if mtype == COMMAND_COMPLETE_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_legacy_command_complete_message()
 * 
 */
        break;
        case 'E':

        /* "gel/protocol/protocol_v0.pyx":471
 *                 elif mtype == ERROR_RESPONSE_MSG:
 *                     # ErrorResponse
 *                     exc = self.parse_error_message()             # <<<<<<<<<<<<<<
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_error_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 471, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_exc);
        __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_exc, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        __pyx_t_1 = 0;

        /* "gel/protocol/protocol_v0.pyx":469
 *                     self.parse_legacy_command_complete_message()
 * 
 *                 elif mtype == ERROR_RESPONSE_MSG:             # <<<<<<<<<<<<<<
 *                     # ErrorResponse
 *                     exc = self.parse_error_message()
 */
        break;
        case 'Z':

        /* "gel/protocol/protocol_v0.pyx":474
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_sync_message(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 474, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "gel/protocol/protocol_v0.pyx":475
 *                 elif mtype == READY_FOR_COMMAND_MSG:
 *                     self.parse_sync_message()
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
        goto __pyx_L9_break;

        /* "gel/protocol/protocol_v0.pyx":473
 *                     exc = self.parse_error_message()
 * 
 *                 elif mtype == READY_FOR_COMMAND_MSG:             # <<<<<<<<<<<<<<
 *                     self.parse_sync_message()
 *                     break
 */
        break;
        default:

        /* "gel/protocol/protocol_v0.pyx":478
 * 
 *                 else:
 *                     self.fallthrough()             # <<<<<<<<<<<<<<
 * 
 *             finally:
 */
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.fallthrough(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 478, __pyx_L11_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        break;
      }
    }

    /* "gel/protocol/protocol_v0.pyx":481
 * 
 *             finally:
 *                 self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
    /*finally:*/ {
      /*normal exit:*/{
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L12;
      }
      __pyx_L11_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_assign
        __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        __Pyx_XGOTREF(__pyx_t_16);
        __Pyx_XGOTREF(__pyx_t_17);
        __Pyx_XGOTREF(__pyx_t_18);
        __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
        {
          __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 481, __pyx_L16_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
        }
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
        __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
        goto __pyx_L1_error;
        __pyx_L16_error:;
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
        }
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
        goto __pyx_L1_error;
      }
      __pyx_L9_break: {
        __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_cur_scope->__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L5_break;
      }
      __pyx_L12:;
    }
  }
  __pyx_L5_break:;

  /* "gel/protocol/protocol_v0.pyx":483
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  __pyx_t_6 = (__pyx_cur_scope->__pyx_v_exc != Py_None);
  if (unlikely(__pyx_t_6)) {

    /* "gel/protocol/protocol_v0.pyx":484
 * 
 *         if exc is not None:
 *             raise exc             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_legacy_describe_type_message(self, CodecsRegistry reg):
 */
    __Pyx_Raise(__pyx_cur_scope->__pyx_v_exc, 0, 0, 0);
    __PYX_ERR(19, 484, __pyx_L1_error)

    /* "gel/protocol/protocol_v0.pyx":483
 *                 self.buffer.finish_message()
 * 
 *         if exc is not None:             # <<<<<<<<<<<<<<
 *             raise exc
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "gel/protocol/protocol_v0.pyx":434
 *                     return ret
 * 
 *     async def legacy_simple_query(             # <<<<<<<<<<<<<<
 *         self, str query, capabilities: enums.Capability
 *     ):
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_Generator_Replace_StopIteration(0);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("legacy_simple_query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol_v0.pyx":486
 *             raise exc
 * 
 *     cdef parse_legacy_describe_type_message(self, CodecsRegistry reg):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == COMMAND_DATA_DESC_MSG
 * 
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_parse_legacy_describe_type_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v_reg) {
  PyObject *__pyx_v_cardinality = 0;
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_in_dc = NULL;
  PyObject *__pyx_v_out_dc = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  char const *__pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_legacy_describe_type_message", 1);

  /* "gel/protocol/protocol_v0.pyx":487
 * 
 *     cdef parse_legacy_describe_type_message(self, CodecsRegistry reg):
 *         assert self.buffer.get_message_type() == COMMAND_DATA_DESC_MSG             # <<<<<<<<<<<<<<
 * 
 *         cdef:
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_self->__pyx_base.buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 487, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 == 'T');
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(19, 487, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(19, 487, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol_v0.pyx":492
 *             bytes cardinality
 * 
 *         headers = self.legacy_parse_headers()             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self->__pyx_base.__pyx_vtab)->legacy_parse_headers(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_headers = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol_v0.pyx":494
 *         headers = self.legacy_parse_headers()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             cardinality = self.buffer.read_byte()
 * 
 */
  /*try:*/ {

    /* "gel/protocol/protocol_v0.pyx":495
 * 
 *         try:
 *             cardinality = self.buffer.read_byte()             # <<<<<<<<<<<<<<
 * 
 *             in_dc, out_dc = self.parse_type_data(reg)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->read_byte(__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_1 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(19, 495, __pyx_L4_error)
    __pyx_t_3 = PyBytes_FromStringAndSize(&__pyx_t_1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 495, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_cardinality = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol_v0.pyx":497
 *             cardinality = self.buffer.read_byte()
 * 
 *             in_dc, out_dc = self.parse_type_data(reg)             # <<<<<<<<<<<<<<
 *         finally:
 *             self.buffer.finish_message()
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.parse_type_data(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v_self), __pyx_v_reg); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 497, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    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(19, 497, __pyx_L4_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 497, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 497, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 497, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6);
      index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(19, 497, __pyx_L4_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(19, 497, __pyx_L4_error)
      __pyx_L7_unpacking_done:;
    }
    __pyx_v_in_dc = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_v_out_dc = __pyx_t_5;
    __pyx_t_5 = 0;
  }

  /* "gel/protocol/protocol_v0.pyx":499
 *             in_dc, out_dc = self.parse_type_data(reg)
 *         finally:
 *             self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *         return cardinality, in_dc, out_dc, headers
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L5;
    }
    __pyx_L4_error:;
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
      {
        __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 499, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      }
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
      goto __pyx_L1_error;
      __pyx_L9_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      }
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "gel/protocol/protocol_v0.pyx":501
 *             self.buffer.finish_message()
 * 
 *         return cardinality, in_dc, out_dc, headers             # <<<<<<<<<<<<<<
 * 
 *     cdef parse_legacy_command_complete_message(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_cardinality);
  __Pyx_GIVEREF(__pyx_v_cardinality);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cardinality)) __PYX_ERR(19, 501, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_in_dc);
  __Pyx_GIVEREF(__pyx_v_in_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_in_dc)) __PYX_ERR(19, 501, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_out_dc);
  __Pyx_GIVEREF(__pyx_v_out_dc);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_out_dc)) __PYX_ERR(19, 501, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_headers);
  __Pyx_GIVEREF(__pyx_v_headers);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_headers)) __PYX_ERR(19, 501, __pyx_L1_error);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "gel/protocol/protocol_v0.pyx":486
 *             raise exc
 * 
 *     cdef parse_legacy_describe_type_message(self, CodecsRegistry reg):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == COMMAND_DATA_DESC_MSG
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.parse_legacy_describe_type_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cardinality);
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_in_dc);
  __Pyx_XDECREF(__pyx_v_out_dc);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol_v0.pyx":503
 *         return cardinality, in_dc, out_dc, headers
 * 
 *     cdef parse_legacy_command_complete_message(self):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG
 *         headers = self.legacy_parse_headers()
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_parse_legacy_command_complete_message(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self) {
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_v_capabilities = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  char __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("parse_legacy_command_complete_message", 1);

  /* "gel/protocol/protocol_v0.pyx":504
 * 
 *     cdef parse_legacy_command_complete_message(self):
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG             # <<<<<<<<<<<<<<
 *         headers = self.legacy_parse_headers()
 *         capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(__pyx_assertions_enabled())) {
    __pyx_t_1 = __pyx_f_3gel_7pgproto_7pgproto_10ReadBuffer_get_message_type(__pyx_v_self->__pyx_base.buffer); if (unlikely(PyErr_Occurred())) __PYX_ERR(19, 504, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_1 == 'C');
    if (unlikely(!__pyx_t_2)) {
      __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
      __PYX_ERR(19, 504, __pyx_L1_error)
    }
  }
  #else
  if ((1)); else __PYX_ERR(19, 504, __pyx_L1_error)
  #endif

  /* "gel/protocol/protocol_v0.pyx":505
 *     cdef parse_legacy_command_complete_message(self):
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG
 *         headers = self.legacy_parse_headers()             # <<<<<<<<<<<<<<
 *         capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *         if capabilities is not None:
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self->__pyx_base.__pyx_vtab)->legacy_parse_headers(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_headers = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol_v0.pyx":506
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG
 *         headers = self.legacy_parse_headers()
 *         capabilities = headers.get(SERVER_HEADER_CAPABILITIES)             # <<<<<<<<<<<<<<
 *         if capabilities is not None:
 *             self.last_capabilities = enums.Capability(
 */
  if (unlikely(__pyx_v_headers == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
    __PYX_ERR(19, 506, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_headers, __pyx_int_4097, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_capabilities = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol_v0.pyx":507
 *         headers = self.legacy_parse_headers()
 *         capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *         if capabilities is not None:             # <<<<<<<<<<<<<<
 *             self.last_capabilities = enums.Capability(
 *                 int.from_bytes(capabilities, 'big'))
 */
  __pyx_t_2 = (__pyx_v_capabilities != Py_None);
  if (__pyx_t_2) {

    /* "gel/protocol/protocol_v0.pyx":508
 *         capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *         if capabilities is not None:
 *             self.last_capabilities = enums.Capability(             # <<<<<<<<<<<<<<
 *                 int.from_bytes(capabilities, 'big'))
 *         else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_enums); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Capability); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "gel/protocol/protocol_v0.pyx":509
 *         if capabilities is not None:
 *             self.last_capabilities = enums.Capability(
 *                 int.from_bytes(capabilities, 'big'))             # <<<<<<<<<<<<<<
 *         else:
 *             self.last_capabilities = None
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 509, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_capabilities, __pyx_n_u_big};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __pyx_t_6 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_4};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }

    /* "gel/protocol/protocol_v0.pyx":508
 *         capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *         if capabilities is not None:
 *             self.last_capabilities = enums.Capability(             # <<<<<<<<<<<<<<
 *                 int.from_bytes(capabilities, 'big'))
 *         else:
 */
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->__pyx_base.last_capabilities);
    __Pyx_DECREF(__pyx_v_self->__pyx_base.last_capabilities);
    __pyx_v_self->__pyx_base.last_capabilities = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "gel/protocol/protocol_v0.pyx":507
 *         headers = self.legacy_parse_headers()
 *         capabilities = headers.get(SERVER_HEADER_CAPABILITIES)
 *         if capabilities is not None:             # <<<<<<<<<<<<<<
 *             self.last_capabilities = enums.Capability(
 *                 int.from_bytes(capabilities, 'big'))
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/protocol_v0.pyx":511
 *                 int.from_bytes(capabilities, 'big'))
 *         else:
 *             self.last_capabilities = None             # <<<<<<<<<<<<<<
 *         self.last_status = self.buffer.read_len_prefixed_bytes()
 *         self.buffer.finish_message()
 */
  /*else*/ {
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->__pyx_base.last_capabilities);
    __Pyx_DECREF(__pyx_v_self->__pyx_base.last_capabilities);
    __pyx_v_self->__pyx_base.last_capabilities = Py_None;
  }
  __pyx_L3:;

  /* "gel/protocol/protocol_v0.pyx":512
 *         else:
 *             self.last_capabilities = None
 *         self.last_status = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *         self.buffer.finish_message()
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.last_status);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.last_status);
  __pyx_v_self->__pyx_base.last_status = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "gel/protocol/protocol_v0.pyx":513
 *             self.last_capabilities = None
 *         self.last_status = self.buffer.read_len_prefixed_bytes()
 *         self.buffer.finish_message()             # <<<<<<<<<<<<<<
 * 
 *     cdef legacy_write_headers(self, buf: WriteBuffer, headers: dict):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->finish_message(__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol_v0.pyx":503
 *         return cardinality, in_dc, out_dc, headers
 * 
 *     cdef parse_legacy_command_complete_message(self):             # <<<<<<<<<<<<<<
 *         assert self.buffer.get_message_type() == COMMAND_COMPLETE_MSG
 *         headers = self.legacy_parse_headers()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.parse_legacy_command_complete_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XDECREF(__pyx_v_capabilities);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol_v0.pyx":515
 *         self.buffer.finish_message()
 * 
 *     cdef legacy_write_headers(self, buf: WriteBuffer, headers: dict):             # <<<<<<<<<<<<<<
 *         buf.write_int16(len(headers))
 *         for k, v in headers.items():
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_write_headers(CYTHON_UNUSED struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, PyObject *__pyx_v_headers) {
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  uint16_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("legacy_write_headers", 1);

  /* "gel/protocol/protocol_v0.pyx":516
 * 
 *     cdef legacy_write_headers(self, buf: WriteBuffer, headers: dict):
 *         buf.write_int16(len(headers))             # <<<<<<<<<<<<<<
 *         for k, v in headers.items():
 *             buf.write_int16(<int16_t><uint16_t>k)
 */
  __pyx_t_1 = PyDict_Size(__pyx_v_headers); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(19, 516, __pyx_L1_error)
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":517
 *     cdef legacy_write_headers(self, buf: WriteBuffer, headers: dict):
 *         buf.write_int16(len(headers))
 *         for k, v in headers.items():             # <<<<<<<<<<<<<<
 *             buf.write_int16(<int16_t><uint16_t>k)
 *             if isinstance(v, bytes):
 */
  __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_headers, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_3, &__pyx_t_1, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(19, 517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "gel/protocol/protocol_v0.pyx":518
 *         buf.write_int16(len(headers))
 *         for k, v in headers.items():
 *             buf.write_int16(<int16_t><uint16_t>k)             # <<<<<<<<<<<<<<
 *             if isinstance(v, bytes):
 *                 buf.write_len_prefixed_bytes(v)
 */
    __pyx_t_8 = __Pyx_PyInt_As_uint16_t(__pyx_v_k); if (unlikely((__pyx_t_8 == ((uint16_t)-1)) && PyErr_Occurred())) __PYX_ERR(19, 518, __pyx_L1_error)
    __pyx_t_6 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, ((int16_t)((uint16_t)__pyx_t_8))); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "gel/protocol/protocol_v0.pyx":519
 *         for k, v in headers.items():
 *             buf.write_int16(<int16_t><uint16_t>k)
 *             if isinstance(v, bytes):             # <<<<<<<<<<<<<<
 *                 buf.write_len_prefixed_bytes(v)
 *             else:
 */
    __pyx_t_9 = PyBytes_Check(__pyx_v_v); 
    if (__pyx_t_9) {

      /* "gel/protocol/protocol_v0.pyx":520
 *             buf.write_int16(<int16_t><uint16_t>k)
 *             if isinstance(v, bytes):
 *                 buf.write_len_prefixed_bytes(v)             # <<<<<<<<<<<<<<
 *             else:
 *                 buf.write_len_prefixed_utf8(str(v))
 */
      if (!(likely(PyBytes_CheckExact(__pyx_v_v))||((__pyx_v_v) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_v))) __PYX_ERR(19, 520, __pyx_L1_error)
      __pyx_t_6 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_len_prefixed_bytes(__pyx_v_buf, ((PyObject*)__pyx_v_v)); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "gel/protocol/protocol_v0.pyx":519
 *         for k, v in headers.items():
 *             buf.write_int16(<int16_t><uint16_t>k)
 *             if isinstance(v, bytes):             # <<<<<<<<<<<<<<
 *                 buf.write_len_prefixed_bytes(v)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "gel/protocol/protocol_v0.pyx":522
 *                 buf.write_len_prefixed_bytes(v)
 *             else:
 *                 buf.write_len_prefixed_utf8(str(v))             # <<<<<<<<<<<<<<
 * 
 *     cdef legacy_write_execute_headers(
 */
    /*else*/ {
      __pyx_t_6 = __Pyx_PyObject_Unicode(__pyx_v_v); if (unlikely(!__pyx_t_6)) __PYX_ERR(19, 522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __pyx_f_3gel_7pgproto_7pgproto_11WriteBuffer_write_len_prefixed_utf8(__pyx_v_buf, ((PyObject*)__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 522, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "gel/protocol/protocol_v0.pyx":515
 *         self.buffer.finish_message()
 * 
 *     cdef legacy_write_headers(self, buf: WriteBuffer, headers: dict):             # <<<<<<<<<<<<<<
 *         buf.write_int16(len(headers))
 *         for k, v in headers.items():
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.legacy_write_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol_v0.pyx":524
 *                 buf.write_len_prefixed_utf8(str(v))
 * 
 *     cdef legacy_write_execute_headers(             # <<<<<<<<<<<<<<
 *         self,
 *         WriteBuffer buf,
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_write_execute_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *__pyx_v_buf, int __pyx_v_implicit_limit, int __pyx_v_inline_typenames, int __pyx_v_inline_typeids, uint64_t __pyx_v_allow_capabilities) {
  PyObject *__pyx_v_val = 0;
  PyObject *__pyx_v_headers = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("legacy_write_execute_headers", 1);

  /* "gel/protocol/protocol_v0.pyx":534
 *         cdef bytes val
 *         if (
 *             implicit_limit or             # <<<<<<<<<<<<<<
 *             inline_typenames or inline_typeids or
 *             allow_capabilities != ALL_CAPABILITIES
 */
  __pyx_t_2 = (__pyx_v_implicit_limit != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }

  /* "gel/protocol/protocol_v0.pyx":535
 *         if (
 *             implicit_limit or
 *             inline_typenames or inline_typeids or             # <<<<<<<<<<<<<<
 *             allow_capabilities != ALL_CAPABILITIES
 *         ):
 */
  if (!__pyx_v_inline_typenames) {
  } else {
    __pyx_t_1 = __pyx_v_inline_typenames;
    goto __pyx_L4_bool_binop_done;
  }
  if (!__pyx_v_inline_typeids) {
  } else {
    __pyx_t_1 = __pyx_v_inline_typeids;
    goto __pyx_L4_bool_binop_done;
  }

  /* "gel/protocol/protocol_v0.pyx":536
 *             implicit_limit or
 *             inline_typenames or inline_typeids or
 *             allow_capabilities != ALL_CAPABILITIES             # <<<<<<<<<<<<<<
 *         ):
 *             headers = {}
 */
  __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_allow_capabilities); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ALL_CAPABILITIES); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(19, 536, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;

  /* "gel/protocol/protocol_v0.pyx":533
 *     ):
 *         cdef bytes val
 *         if (             # <<<<<<<<<<<<<<
 *             implicit_limit or
 *             inline_typenames or inline_typeids or
 */
  if (__pyx_t_1) {

    /* "gel/protocol/protocol_v0.pyx":538
 *             allow_capabilities != ALL_CAPABILITIES
 *         ):
 *             headers = {}             # <<<<<<<<<<<<<<
 *             if implicit_limit:
 *                 headers[QUERY_OPT_IMPLICIT_LIMIT] = implicit_limit
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_headers = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "gel/protocol/protocol_v0.pyx":539
 *         ):
 *             headers = {}
 *             if implicit_limit:             # <<<<<<<<<<<<<<
 *                 headers[QUERY_OPT_IMPLICIT_LIMIT] = implicit_limit
 *             if inline_typenames:
 */
    __pyx_t_1 = (__pyx_v_implicit_limit != 0);
    if (__pyx_t_1) {

      /* "gel/protocol/protocol_v0.pyx":540
 *             headers = {}
 *             if implicit_limit:
 *                 headers[QUERY_OPT_IMPLICIT_LIMIT] = implicit_limit             # <<<<<<<<<<<<<<
 *             if inline_typenames:
 *                 headers[QUERY_OPT_INLINE_TYPENAMES] = True
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_implicit_limit); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely((PyDict_SetItem(__pyx_v_headers, __pyx_int_65281, __pyx_t_5) < 0))) __PYX_ERR(19, 540, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "gel/protocol/protocol_v0.pyx":539
 *         ):
 *             headers = {}
 *             if implicit_limit:             # <<<<<<<<<<<<<<
 *                 headers[QUERY_OPT_IMPLICIT_LIMIT] = implicit_limit
 *             if inline_typenames:
 */
    }

    /* "gel/protocol/protocol_v0.pyx":541
 *             if implicit_limit:
 *                 headers[QUERY_OPT_IMPLICIT_LIMIT] = implicit_limit
 *             if inline_typenames:             # <<<<<<<<<<<<<<
 *                 headers[QUERY_OPT_INLINE_TYPENAMES] = True
 *             if inline_typeids:
 */
    if (__pyx_v_inline_typenames) {

      /* "gel/protocol/protocol_v0.pyx":542
 *                 headers[QUERY_OPT_IMPLICIT_LIMIT] = implicit_limit
 *             if inline_typenames:
 *                 headers[QUERY_OPT_INLINE_TYPENAMES] = True             # <<<<<<<<<<<<<<
 *             if inline_typeids:
 *                 headers[QUERY_OPT_INLINE_TYPEIDS] = True
 */
      if (unlikely((PyDict_SetItem(__pyx_v_headers, __pyx_int_65282, Py_True) < 0))) __PYX_ERR(19, 542, __pyx_L1_error)

      /* "gel/protocol/protocol_v0.pyx":541
 *             if implicit_limit:
 *                 headers[QUERY_OPT_IMPLICIT_LIMIT] = implicit_limit
 *             if inline_typenames:             # <<<<<<<<<<<<<<
 *                 headers[QUERY_OPT_INLINE_TYPENAMES] = True
 *             if inline_typeids:
 */
    }

    /* "gel/protocol/protocol_v0.pyx":543
 *             if inline_typenames:
 *                 headers[QUERY_OPT_INLINE_TYPENAMES] = True
 *             if inline_typeids:             # <<<<<<<<<<<<<<
 *                 headers[QUERY_OPT_INLINE_TYPEIDS] = True
 *             if allow_capabilities != ALL_CAPABILITIES:
 */
    if (__pyx_v_inline_typeids) {

      /* "gel/protocol/protocol_v0.pyx":544
 *                 headers[QUERY_OPT_INLINE_TYPENAMES] = True
 *             if inline_typeids:
 *                 headers[QUERY_OPT_INLINE_TYPEIDS] = True             # <<<<<<<<<<<<<<
 *             if allow_capabilities != ALL_CAPABILITIES:
 *                 val = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))
 */
      if (unlikely((PyDict_SetItem(__pyx_v_headers, __pyx_int_65283, Py_True) < 0))) __PYX_ERR(19, 544, __pyx_L1_error)

      /* "gel/protocol/protocol_v0.pyx":543
 *             if inline_typenames:
 *                 headers[QUERY_OPT_INLINE_TYPENAMES] = True
 *             if inline_typeids:             # <<<<<<<<<<<<<<
 *                 headers[QUERY_OPT_INLINE_TYPEIDS] = True
 *             if allow_capabilities != ALL_CAPABILITIES:
 */
    }

    /* "gel/protocol/protocol_v0.pyx":545
 *             if inline_typeids:
 *                 headers[QUERY_OPT_INLINE_TYPEIDS] = True
 *             if allow_capabilities != ALL_CAPABILITIES:             # <<<<<<<<<<<<<<
 *                 val = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))
 *                 hton.pack_int64(
 */
    __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_allow_capabilities); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ALL_CAPABILITIES); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 545, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(19, 545, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "gel/protocol/protocol_v0.pyx":546
 *                 headers[QUERY_OPT_INLINE_TYPEIDS] = True
 *             if allow_capabilities != ALL_CAPABILITIES:
 *                 val = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))             # <<<<<<<<<<<<<<
 *                 hton.pack_int64(
 *                     cpython.PyBytes_AsString(val),
 */
      __pyx_t_3 = PyBytes_FromStringAndSize(NULL, (sizeof(uint64_t))); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_val = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "gel/protocol/protocol_v0.pyx":548
 *                 val = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))
 *                 hton.pack_int64(
 *                     cpython.PyBytes_AsString(val),             # <<<<<<<<<<<<<<
 *                     <int64_t><uint64_t>allow_capabilities
 *                 )
 */
      __pyx_t_6 = PyBytes_AsString(__pyx_v_val); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(19, 548, __pyx_L1_error)

      /* "gel/protocol/protocol_v0.pyx":547
 *             if allow_capabilities != ALL_CAPABILITIES:
 *                 val = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))
 *                 hton.pack_int64(             # <<<<<<<<<<<<<<
 *                     cpython.PyBytes_AsString(val),
 *                     <int64_t><uint64_t>allow_capabilities
 */
      pack_int64(__pyx_t_6, ((int64_t)((uint64_t)__pyx_v_allow_capabilities)));

      /* "gel/protocol/protocol_v0.pyx":551
 *                     <int64_t><uint64_t>allow_capabilities
 *                 )
 *                 headers[QUERY_OPT_ALLOW_CAPABILITIES] = val             # <<<<<<<<<<<<<<
 *             self.legacy_write_headers(buf, headers)
 *         else:
 */
      if (unlikely((PyDict_SetItem(__pyx_v_headers, __pyx_int_65284, __pyx_v_val) < 0))) __PYX_ERR(19, 551, __pyx_L1_error)

      /* "gel/protocol/protocol_v0.pyx":545
 *             if inline_typeids:
 *                 headers[QUERY_OPT_INLINE_TYPEIDS] = True
 *             if allow_capabilities != ALL_CAPABILITIES:             # <<<<<<<<<<<<<<
 *                 val = cpython.PyBytes_FromStringAndSize(NULL, sizeof(uint64_t))
 *                 hton.pack_int64(
 */
    }

    /* "gel/protocol/protocol_v0.pyx":552
 *                 )
 *                 headers[QUERY_OPT_ALLOW_CAPABILITIES] = val
 *             self.legacy_write_headers(buf, headers)             # <<<<<<<<<<<<<<
 *         else:
 *             buf.write_int16(0)  # no headers
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self->__pyx_base.__pyx_vtab)->legacy_write_headers(__pyx_v_self, __pyx_v_buf, __pyx_v_headers); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 552, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "gel/protocol/protocol_v0.pyx":533
 *     ):
 *         cdef bytes val
 *         if (             # <<<<<<<<<<<<<<
 *             implicit_limit or
 *             inline_typenames or inline_typeids or
 */
    goto __pyx_L3;
  }

  /* "gel/protocol/protocol_v0.pyx":554
 *             self.legacy_write_headers(buf, headers)
 *         else:
 *             buf.write_int16(0)  # no headers             # <<<<<<<<<<<<<<
 * 
 *     cdef dict legacy_parse_headers(self):
 */
  /*else*/ {
    __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_v_buf->__pyx_vtab)->write_int16(__pyx_v_buf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "gel/protocol/protocol_v0.pyx":524
 *                 buf.write_len_prefixed_utf8(str(v))
 * 
 *     cdef legacy_write_execute_headers(             # <<<<<<<<<<<<<<
 *         self,
 *         WriteBuffer buf,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.legacy_write_execute_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XDECREF(__pyx_v_headers);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gel/protocol/protocol_v0.pyx":556
 *             buf.write_int16(0)  # no headers
 * 
 *     cdef dict legacy_parse_headers(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             dict attrs
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_parse_headers(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self) {
  PyObject *__pyx_v_attrs = 0;
  uint16_t __pyx_v_num_fields;
  uint16_t __pyx_v_key;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int16_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("legacy_parse_headers", 1);

  /* "gel/protocol/protocol_v0.pyx":563
 *             bytes value
 * 
 *         attrs = {}             # <<<<<<<<<<<<<<
 *         num_fields = <uint16_t> self.buffer.read_int16()
 *         while num_fields:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_attrs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "gel/protocol/protocol_v0.pyx":564
 * 
 *         attrs = {}
 *         num_fields = <uint16_t> self.buffer.read_int16()             # <<<<<<<<<<<<<<
 *         while num_fields:
 *             key = <uint16_t> self.buffer.read_int16()
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->read_int16(__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_2 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(19, 564, __pyx_L1_error)
  __pyx_v_num_fields = ((uint16_t)__pyx_t_2);

  /* "gel/protocol/protocol_v0.pyx":565
 *         attrs = {}
 *         num_fields = <uint16_t> self.buffer.read_int16()
 *         while num_fields:             # <<<<<<<<<<<<<<
 *             key = <uint16_t> self.buffer.read_int16()
 *             value = self.buffer.read_len_prefixed_bytes()
 */
  while (1) {
    __pyx_t_3 = (__pyx_v_num_fields != 0);
    if (!__pyx_t_3) break;

    /* "gel/protocol/protocol_v0.pyx":566
 *         num_fields = <uint16_t> self.buffer.read_int16()
 *         while num_fields:
 *             key = <uint16_t> self.buffer.read_int16()             # <<<<<<<<<<<<<<
 *             value = self.buffer.read_len_prefixed_bytes()
 *             attrs[key] = value
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->read_int16(__pyx_v_self->__pyx_base.buffer); if (unlikely(__pyx_t_2 == ((int16_t)-1) && PyErr_Occurred())) __PYX_ERR(19, 566, __pyx_L1_error)
    __pyx_v_key = ((uint16_t)__pyx_t_2);

    /* "gel/protocol/protocol_v0.pyx":567
 *         while num_fields:
 *             key = <uint16_t> self.buffer.read_int16()
 *             value = self.buffer.read_len_prefixed_bytes()             # <<<<<<<<<<<<<<
 *             attrs[key] = value
 *             num_fields -= 1
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_v_self->__pyx_base.buffer->__pyx_vtab)->read_len_prefixed_bytes(__pyx_v_self->__pyx_base.buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "gel/protocol/protocol_v0.pyx":568
 *             key = <uint16_t> self.buffer.read_int16()
 *             value = self.buffer.read_len_prefixed_bytes()
 *             attrs[key] = value             # <<<<<<<<<<<<<<
 *             num_fields -= 1
 *         return attrs
 */
    __pyx_t_1 = __Pyx_PyInt_From_uint16_t(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(19, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely((PyDict_SetItem(__pyx_v_attrs, __pyx_t_1, __pyx_v_value) < 0))) __PYX_ERR(19, 568, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "gel/protocol/protocol_v0.pyx":569
 *             value = self.buffer.read_len_prefixed_bytes()
 *             attrs[key] = value
 *             num_fields -= 1             # <<<<<<<<<<<<<<
 *         return attrs
 */
    __pyx_v_num_fields = (__pyx_v_num_fields - 1);
  }

  /* "gel/protocol/protocol_v0.pyx":570
 *             attrs[key] = value
 *             num_fields -= 1
 *         return attrs             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_attrs);
  __pyx_r = __pyx_v_attrs;
  goto __pyx_L0;

  /* "gel/protocol/protocol_v0.pyx":556
 *             buf.write_int16(0)  # no headers
 * 
 *     cdef dict legacy_parse_headers(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             dict attrs
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.legacy_parse_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_attrs);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_16__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_16__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_16__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_16__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_15__reduce_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self));

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

static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_15__reduce_cython__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 1);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.backend_secret, self.buffer, self.cancelled, self.con, self.con_params, self.connected, self.internal_reg, self.is_legacy, self.last_capabilities, self.last_details, self.last_status, self.protocol_version, self.server_settings, self.state_cache, self.state_codec, self.state_type_id, self.xact_status)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.cancelled); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.connected); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.is_legacy); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(__pyx_v_self->__pyx_base.xact_status); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(17); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.backend_secret);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.backend_secret);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->__pyx_base.backend_secret)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.buffer);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.buffer);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->__pyx_base.buffer))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.con);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.con);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_self->__pyx_base.con)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.con_params);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.con_params);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->__pyx_base.con_params)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.internal_reg);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.internal_reg);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 6, ((PyObject *)__pyx_v_self->__pyx_base.internal_reg))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.last_capabilities);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.last_capabilities);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_v_self->__pyx_base.last_capabilities)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.last_details);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.last_details);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_v_self->__pyx_base.last_details)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.last_status);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.last_status);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 10, __pyx_v_self->__pyx_base.last_status)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.protocol_version);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.protocol_version);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 11, __pyx_v_self->__pyx_base.protocol_version)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.server_settings);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.server_settings);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 12, __pyx_v_self->__pyx_base.server_settings)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.state_cache);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.state_cache);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 13, __pyx_v_self->__pyx_base.state_cache)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v_self->__pyx_base.state_codec);
  __Pyx_GIVEREF((PyObject *)__pyx_v_self->__pyx_base.state_codec);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 14, ((PyObject *)__pyx_v_self->__pyx_base.state_codec))) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.state_type_id);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.state_type_id);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 15, __pyx_v_self->__pyx_base.state_type_id)) __PYX_ERR(2, 5, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 16, __pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.backend_secret, self.buffer, self.cancelled, self.con, self.con_params, self.connected, self.internal_reg, self.is_legacy, self.last_capabilities, self.last_details, self.last_status, self.protocol_version, self.server_settings, self.state_cache, self.state_codec, self.state_type_id, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v__dict = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "(tree fragment)":7
 *     state = (self.backend_secret, self.buffer, self.cancelled, self.con, self.con_params, self.connected, self.internal_reg, self.is_legacy, self.last_capabilities, self.last_details, self.last_status, self.protocol_version, self.server_settings, self.state_cache, self.state_codec, self.state_type_id, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_6 = (__pyx_v__dict != Py_None);
  if (__pyx_t_6) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict)) __PYX_ERR(2, 8, __pyx_L1_error);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.backend_secret, self.buffer, self.cancelled, self.con, self.con_params, self.connected, self.internal_reg, self.is_legacy, self.last_capabilities, self.last_details, self.last_status, self.protocol_version, self.server_settings, self.state_cache, self.state_codec, self.state_type_id, self.xact_status)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, None), state
 */
  /*else*/ {
    __pyx_t_7 = (__pyx_v_self->__pyx_base.backend_secret != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)__pyx_v_self->__pyx_base.buffer) != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.con != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.con_params != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)__pyx_v_self->__pyx_base.internal_reg) != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.last_capabilities != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.last_details != ((PyObject*)Py_None));
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.last_status != ((PyObject*)Py_None));
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.protocol_version != ((PyObject*)Py_None));
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.server_settings != ((PyObject*)Py_None));
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.state_cache != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (((PyObject *)__pyx_v_self->__pyx_base.state_codec) != Py_None);
    if (!__pyx_t_7) {
    } else {
      __pyx_t_6 = __pyx_t_7;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_7 = (__pyx_v_self->__pyx_base.state_type_id != ((PyObject*)Py_None));
    __pyx_t_6 = __pyx_t_7;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_6;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, None), state
 *     else:
 */
  if (__pyx_v_use_setstate) {

    /* "(tree fragment)":13
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None
 *     if use_setstate:
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_SansIOProtocolBac); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_94322648);
    __Pyx_GIVEREF(__pyx_int_94322648);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_94322648)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.backend_secret is not None or self.buffer is not None or self.con is not None or self.con_params is not None or self.internal_reg is not None or self.last_capabilities is not None or self.last_details is not None or self.last_status is not None or self.protocol_version is not None or self.server_settings is not None or self.state_cache is not None or self.state_codec is not None or self.state_type_id is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, None), state
 *     else:
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_SansIOProtocolBac); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_int_94322648);
    __Pyx_GIVEREF(__pyx_int_94322648);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_94322648)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(2, 15, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(2, 15, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_18__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_18__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_18__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_18__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(2, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(2, 16, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_17__setstate_cython__(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_17__setstate_cython__(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  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("__setstate_cython__", 1);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gel.protocol.protocol.SansIOProtocolBackwardsCompatible.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_LRUMapping(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_1__pyx_unpickle_LRUMapping(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_1__pyx_unpickle_LRUMapping = {"__pyx_unpickle_LRUMapping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_1__pyx_unpickle_LRUMapping, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_1__pyx_unpickle_LRUMapping(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_LRUMapping (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LRUMapping", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LRUMapping", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_LRUMapping") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_LRUMapping", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_LRUMapping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol___pyx_unpickle_LRUMapping(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol___pyx_unpickle_LRUMapping(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_LRUMapping", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x0e1f4d2, 0x737459e, 0x53368d7):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__92, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x0e1f4d2, 0x737459e, 0x53368d7):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))" % __pyx_checksum
 *     __pyx_result = LRUMapping.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x0e1f4d2, 0x737459e, 0x53368d7):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = LRUMapping.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x0e1f4d2, 0x737459e, 0x53368d7):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))" % __pyx_checksum
 *     __pyx_result = LRUMapping.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_LRUMapping__set_state(<LRUMapping> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_LRUMapping), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))" % __pyx_checksum
 *     __pyx_result = LRUMapping.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_LRUMapping__set_state(<LRUMapping> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = LRUMapping.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_LRUMapping__set_state(<LRUMapping> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_LRUMapping__set_state(LRUMapping __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_LRUMapping__set_state(((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))" % __pyx_checksum
 *     __pyx_result = LRUMapping.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_LRUMapping__set_state(<LRUMapping> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_LRUMapping__set_state(<LRUMapping> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_LRUMapping__set_state(LRUMapping __pyx_result, tuple __pyx_state):
 *     __pyx_result._dict = __pyx_state[0]; __pyx_result._dict_get = __pyx_state[1]; __pyx_result._dict_move_to_end = __pyx_state[2]; __pyx_result._maxsize = __pyx_state[3]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_LRUMapping(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_LRUMapping", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_LRUMapping__set_state(<LRUMapping> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_LRUMapping__set_state(LRUMapping __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._dict = __pyx_state[0]; __pyx_result._dict_get = __pyx_state[1]; __pyx_result._dict_move_to_end = __pyx_state[2]; __pyx_result._maxsize = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_LRUMapping__set_state(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_LRUMapping__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_LRUMapping__set_state(LRUMapping __pyx_result, tuple __pyx_state):
 *     __pyx_result._dict = __pyx_state[0]; __pyx_result._dict_get = __pyx_state[1]; __pyx_result._dict_move_to_end = __pyx_state[2]; __pyx_result._maxsize = __pyx_state[3]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[4])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_dict);
  __Pyx_DECREF(__pyx_v___pyx_result->_dict);
  __pyx_v___pyx_result->_dict = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_dict_get);
  __Pyx_DECREF(__pyx_v___pyx_result->_dict_get);
  __pyx_v___pyx_result->_dict_get = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->_dict_move_to_end);
  __Pyx_DECREF(__pyx_v___pyx_result->_dict_move_to_end);
  __pyx_v___pyx_result->_dict_move_to_end = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->_maxsize = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_LRUMapping__set_state(LRUMapping __pyx_result, tuple __pyx_state):
 *     __pyx_result._dict = __pyx_state[0]; __pyx_result._dict_get = __pyx_state[1]; __pyx_result._dict_move_to_end = __pyx_state[2]; __pyx_result._maxsize = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[4])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 > 4);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __pyx_result._dict = __pyx_state[0]; __pyx_result._dict_get = __pyx_state[1]; __pyx_result._dict_move_to_end = __pyx_state[2]; __pyx_result._maxsize = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[4])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_LRUMapping__set_state(LRUMapping __pyx_result, tuple __pyx_state):
 *     __pyx_result._dict = __pyx_state[0]; __pyx_result._dict_get = __pyx_state[1]; __pyx_result._dict_move_to_end = __pyx_state[2]; __pyx_result._maxsize = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[4])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_LRUMapping__set_state(<LRUMapping> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_LRUMapping__set_state(LRUMapping __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._dict = __pyx_state[0]; __pyx_result._dict_get = __pyx_state[1]; __pyx_result._dict_move_to_end = __pyx_state[2]; __pyx_result._maxsize = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_LRUMapping__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_CodecsRegistry(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_3__pyx_unpickle_CodecsRegistry(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_3__pyx_unpickle_CodecsRegistry = {"__pyx_unpickle_CodecsRegistry", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_3__pyx_unpickle_CodecsRegistry, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_3__pyx_unpickle_CodecsRegistry(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_CodecsRegistry (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CodecsRegistry", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CodecsRegistry", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_CodecsRegistry") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_CodecsRegistry", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_CodecsRegistry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_2__pyx_unpickle_CodecsRegistry(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_2__pyx_unpickle_CodecsRegistry(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CodecsRegistry", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xd998748, 0x6ca3226, 0x324635c):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd998748, 0x6ca3226, 0x324635c) = (base_codec_overrides, codecs, codecs_build_cache))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__93, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xd998748, 0x6ca3226, 0x324635c):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd998748, 0x6ca3226, 0x324635c) = (base_codec_overrides, codecs, codecs_build_cache))" % __pyx_checksum
 *     __pyx_result = CodecsRegistry.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0xd998748, 0x6ca3226, 0x324635c):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd998748, 0x6ca3226, 0x324635c) = (base_codec_overrides, codecs, codecs_build_cache))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = CodecsRegistry.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xd998748, 0x6ca3226, 0x324635c):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd998748, 0x6ca3226, 0x324635c) = (base_codec_overrides, codecs, codecs_build_cache))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd998748, 0x6ca3226, 0x324635c) = (base_codec_overrides, codecs, codecs_build_cache))" % __pyx_checksum
 *     __pyx_result = CodecsRegistry.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CodecsRegistry__set_state(<CodecsRegistry> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd998748, 0x6ca3226, 0x324635c) = (base_codec_overrides, codecs, codecs_build_cache))" % __pyx_checksum
 *     __pyx_result = CodecsRegistry.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CodecsRegistry__set_state(<CodecsRegistry> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = CodecsRegistry.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CodecsRegistry__set_state(<CodecsRegistry> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_CodecsRegistry__set_state(CodecsRegistry __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_CodecsRegistry__set_state(((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xd998748, 0x6ca3226, 0x324635c) = (base_codec_overrides, codecs, codecs_build_cache))" % __pyx_checksum
 *     __pyx_result = CodecsRegistry.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_CodecsRegistry__set_state(<CodecsRegistry> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_CodecsRegistry__set_state(<CodecsRegistry> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_CodecsRegistry__set_state(CodecsRegistry __pyx_result, tuple __pyx_state):
 *     __pyx_result.base_codec_overrides = __pyx_state[0]; __pyx_result.codecs = __pyx_state[1]; __pyx_result.codecs_build_cache = __pyx_state[2]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_CodecsRegistry(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_CodecsRegistry", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_CodecsRegistry__set_state(<CodecsRegistry> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CodecsRegistry__set_state(CodecsRegistry __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.base_codec_overrides = __pyx_state[0]; __pyx_result.codecs = __pyx_state[1]; __pyx_result.codecs_build_cache = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_CodecsRegistry__set_state(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_CodecsRegistry__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_CodecsRegistry__set_state(CodecsRegistry __pyx_result, tuple __pyx_state):
 *     __pyx_result.base_codec_overrides = __pyx_state[0]; __pyx_result.codecs = __pyx_state[1]; __pyx_result.codecs_build_cache = __pyx_state[2]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->base_codec_overrides);
  __Pyx_DECREF(__pyx_v___pyx_result->base_codec_overrides);
  __pyx_v___pyx_result->base_codec_overrides = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_LRUMapping))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->codecs);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->codecs);
  __pyx_v___pyx_result->codecs = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_LRUMapping))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->codecs_build_cache);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->codecs_build_cache);
  __pyx_v___pyx_result->codecs_build_cache = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_CodecsRegistry__set_state(CodecsRegistry __pyx_result, tuple __pyx_state):
 *     __pyx_result.base_codec_overrides = __pyx_state[0]; __pyx_result.codecs = __pyx_state[1]; __pyx_result.codecs_build_cache = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_4 = (__pyx_t_3 > 3);
  if (__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_4;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.base_codec_overrides = __pyx_state[0]; __pyx_result.codecs = __pyx_state[1]; __pyx_result.codecs_build_cache = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])             # <<<<<<<<<<<<<<
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_8 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_CodecsRegistry__set_state(CodecsRegistry __pyx_result, tuple __pyx_state):
 *     __pyx_result.base_codec_overrides = __pyx_state[0]; __pyx_result.codecs = __pyx_state[1]; __pyx_result.codecs_build_cache = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_CodecsRegistry__set_state(<CodecsRegistry> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_CodecsRegistry__set_state(CodecsRegistry __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.base_codec_overrides = __pyx_state[0]; __pyx_result.codecs = __pyx_state[1]; __pyx_result.codecs_build_cache = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_CodecsRegistry__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_ExecuteContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_5__pyx_unpickle_ExecuteContext(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_5__pyx_unpickle_ExecuteContext = {"__pyx_unpickle_ExecuteContext", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_5__pyx_unpickle_ExecuteContext, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_5__pyx_unpickle_ExecuteContext(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_ExecuteContext (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ExecuteContext", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ExecuteContext", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_ExecuteContext") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_ExecuteContext", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_ExecuteContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_4__pyx_unpickle_ExecuteContext(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_4__pyx_unpickle_ExecuteContext(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ExecuteContext", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x3eeaf27, 0x20daed4, 0x7646152):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x3eeaf27, 0x20daed4, 0x7646152) = (allow_capabilities, annotations, args, capabilities, cardinality, expect_one, implicit_limit, in_dc, inline_typeids, inline_typenames, input_language, kwargs, out_dc, output_format, qc, query, reg, required_one, state, warnings))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__94, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x3eeaf27, 0x20daed4, 0x7646152):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x3eeaf27, 0x20daed4, 0x7646152) = (allow_capabilities, annotations, args, capabilities, cardinality, expect_one, implicit_limit, in_dc, inline_typeids, inline_typenames, input_language, kwargs, out_dc, output_format, qc, query, reg, required_one, state, warnings))" % __pyx_checksum
 *     __pyx_result = ExecuteContext.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x3eeaf27, 0x20daed4, 0x7646152):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x3eeaf27, 0x20daed4, 0x7646152) = (allow_capabilities, annotations, args, capabilities, cardinality, expect_one, implicit_limit, in_dc, inline_typeids, inline_typenames, input_language, kwargs, out_dc, output_format, qc, query, reg, required_one, state, warnings))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = ExecuteContext.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x3eeaf27, 0x20daed4, 0x7646152):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x3eeaf27, 0x20daed4, 0x7646152) = (allow_capabilities, annotations, args, capabilities, cardinality, expect_one, implicit_limit, in_dc, inline_typeids, inline_typenames, input_language, kwargs, out_dc, output_format, qc, query, reg, required_one, state, warnings))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x3eeaf27, 0x20daed4, 0x7646152) = (allow_capabilities, annotations, args, capabilities, cardinality, expect_one, implicit_limit, in_dc, inline_typeids, inline_typenames, input_language, kwargs, out_dc, output_format, qc, query, reg, required_one, state, warnings))" % __pyx_checksum
 *     __pyx_result = ExecuteContext.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ExecuteContext__set_state(<ExecuteContext> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x3eeaf27, 0x20daed4, 0x7646152) = (allow_capabilities, annotations, args, capabilities, cardinality, expect_one, implicit_limit, in_dc, inline_typeids, inline_typenames, input_language, kwargs, out_dc, output_format, qc, query, reg, required_one, state, warnings))" % __pyx_checksum
 *     __pyx_result = ExecuteContext.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ExecuteContext__set_state(<ExecuteContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = ExecuteContext.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ExecuteContext__set_state(<ExecuteContext> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_ExecuteContext__set_state(ExecuteContext __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_ExecuteContext__set_state(((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x3eeaf27, 0x20daed4, 0x7646152) = (allow_capabilities, annotations, args, capabilities, cardinality, expect_one, implicit_limit, in_dc, inline_typeids, inline_typenames, input_language, kwargs, out_dc, output_format, qc, query, reg, required_one, state, warnings))" % __pyx_checksum
 *     __pyx_result = ExecuteContext.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_ExecuteContext__set_state(<ExecuteContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_ExecuteContext__set_state(<ExecuteContext> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_ExecuteContext__set_state(ExecuteContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.allow_capabilities = __pyx_state[0]; __pyx_result.annotations = __pyx_state[1]; __pyx_result.args = __pyx_state[2]; __pyx_result.capabilities = __pyx_state[3]; __pyx_result.cardinality = __pyx_state[4]; __pyx_result.expect_one = __pyx_state[5]; __pyx_result.implicit_limit = __pyx_state[6]; __pyx_result.in_dc = __pyx_state[7]; __pyx_result.inline_typeids = __pyx_state[8]; __pyx_result.inline_typenames = __pyx_state[9]; __pyx_result.input_language = __pyx_state[10]; __pyx_result.kwargs = __pyx_state[11]; __pyx_result.out_dc = __pyx_state[12]; __pyx_result.output_format = __pyx_state[13]; __pyx_result.qc = __pyx_state[14]; __pyx_result.query = __pyx_state[15]; __pyx_result.reg = __pyx_state[16]; __pyx_result.required_one = __pyx_state[17]; __pyx_result.state = __pyx_state[18]; __pyx_result.warnings = __pyx_state[19]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ExecuteContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_ExecuteContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_ExecuteContext__set_state(<ExecuteContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ExecuteContext__set_state(ExecuteContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.allow_capabilities = __pyx_state[0]; __pyx_result.annotations = __pyx_state[1]; __pyx_result.args = __pyx_state[2]; __pyx_result.capabilities = __pyx_state[3]; __pyx_result.cardinality = __pyx_state[4]; __pyx_result.expect_one = __pyx_state[5]; __pyx_result.implicit_limit = __pyx_state[6]; __pyx_result.in_dc = __pyx_state[7]; __pyx_result.inline_typeids = __pyx_state[8]; __pyx_result.inline_typenames = __pyx_state[9]; __pyx_result.input_language = __pyx_state[10]; __pyx_result.kwargs = __pyx_state[11]; __pyx_result.out_dc = __pyx_state[12]; __pyx_result.output_format = __pyx_state[13]; __pyx_result.qc = __pyx_state[14]; __pyx_result.query = __pyx_state[15]; __pyx_result.reg = __pyx_state[16]; __pyx_result.required_one = __pyx_state[17]; __pyx_result.state = __pyx_state[18]; __pyx_result.warnings = __pyx_state[19]
 *     if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_ExecuteContext__set_state(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint64_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  enum __pyx_t_3gel_8protocol_8protocol_InputLanguage __pyx_t_5;
  enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  unsigned int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_ExecuteContext__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_ExecuteContext__set_state(ExecuteContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.allow_capabilities = __pyx_state[0]; __pyx_result.annotations = __pyx_state[1]; __pyx_result.args = __pyx_state[2]; __pyx_result.capabilities = __pyx_state[3]; __pyx_result.cardinality = __pyx_state[4]; __pyx_result.expect_one = __pyx_state[5]; __pyx_result.implicit_limit = __pyx_state[6]; __pyx_result.in_dc = __pyx_state[7]; __pyx_result.inline_typeids = __pyx_state[8]; __pyx_result.inline_typenames = __pyx_state[9]; __pyx_result.input_language = __pyx_state[10]; __pyx_result.kwargs = __pyx_state[11]; __pyx_result.out_dc = __pyx_state[12]; __pyx_result.output_format = __pyx_state[13]; __pyx_result.qc = __pyx_state[14]; __pyx_result.query = __pyx_state[15]; __pyx_result.reg = __pyx_state[16]; __pyx_result.required_one = __pyx_state[17]; __pyx_result.state = __pyx_state[18]; __pyx_result.warnings = __pyx_state[19]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[20])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->allow_capabilities = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->annotations);
  __Pyx_DECREF(__pyx_v___pyx_result->annotations);
  __pyx_v___pyx_result->annotations = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->args);
  __Pyx_DECREF(__pyx_v___pyx_result->args);
  __pyx_v___pyx_result->args = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->capabilities = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->cardinality);
  __Pyx_DECREF(__pyx_v___pyx_result->cardinality);
  __pyx_v___pyx_result->cardinality = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->expect_one = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->implicit_limit = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->in_dc);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->in_dc);
  __pyx_v___pyx_result->in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->inline_typeids = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->inline_typenames = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = ((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)__Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->input_language = __pyx_t_5;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->kwargs);
  __Pyx_DECREF(__pyx_v___pyx_result->kwargs);
  __pyx_v___pyx_result->kwargs = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->out_dc);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->out_dc);
  __pyx_v___pyx_result->out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = ((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)__Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->output_format = __pyx_t_6;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_LRUMapping))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->qc);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->qc);
  __pyx_v___pyx_result->qc = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->query);
  __Pyx_DECREF(__pyx_v___pyx_result->query);
  __pyx_v___pyx_result->query = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->reg);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->reg);
  __pyx_v___pyx_result->reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->required_one = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->state);
  __Pyx_DECREF(__pyx_v___pyx_result->state);
  __pyx_v___pyx_result->state = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->warnings);
  __Pyx_DECREF(__pyx_v___pyx_result->warnings);
  __pyx_v___pyx_result->warnings = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_ExecuteContext__set_state(ExecuteContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.allow_capabilities = __pyx_state[0]; __pyx_result.annotations = __pyx_state[1]; __pyx_result.args = __pyx_state[2]; __pyx_result.capabilities = __pyx_state[3]; __pyx_result.cardinality = __pyx_state[4]; __pyx_result.expect_one = __pyx_state[5]; __pyx_result.implicit_limit = __pyx_state[6]; __pyx_result.in_dc = __pyx_state[7]; __pyx_result.inline_typeids = __pyx_state[8]; __pyx_result.inline_typenames = __pyx_state[9]; __pyx_result.input_language = __pyx_state[10]; __pyx_result.kwargs = __pyx_state[11]; __pyx_result.out_dc = __pyx_state[12]; __pyx_result.output_format = __pyx_state[13]; __pyx_result.qc = __pyx_state[14]; __pyx_result.query = __pyx_state[15]; __pyx_result.reg = __pyx_state[16]; __pyx_result.required_one = __pyx_state[17]; __pyx_result.state = __pyx_state[18]; __pyx_result.warnings = __pyx_state[19]
 *     if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[20])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 > 20);
  if (__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_3 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __pyx_result.allow_capabilities = __pyx_state[0]; __pyx_result.annotations = __pyx_state[1]; __pyx_result.args = __pyx_state[2]; __pyx_result.capabilities = __pyx_state[3]; __pyx_result.cardinality = __pyx_state[4]; __pyx_result.expect_one = __pyx_state[5]; __pyx_result.implicit_limit = __pyx_state[6]; __pyx_result.in_dc = __pyx_state[7]; __pyx_result.inline_typeids = __pyx_state[8]; __pyx_result.inline_typenames = __pyx_state[9]; __pyx_result.input_language = __pyx_state[10]; __pyx_result.kwargs = __pyx_state[11]; __pyx_result.out_dc = __pyx_state[12]; __pyx_result.output_format = __pyx_state[13]; __pyx_result.qc = __pyx_state[14]; __pyx_result.query = __pyx_state[15]; __pyx_result.reg = __pyx_state[16]; __pyx_result.required_one = __pyx_state[17]; __pyx_result.state = __pyx_state[18]; __pyx_result.warnings = __pyx_state[19]
 *     if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[20])             # <<<<<<<<<<<<<<
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = NULL;
    __pyx_t_12 = 0;
    #if CYTHON_UNPACK_METHODS
    if (likely(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_12 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_ExecuteContext__set_state(ExecuteContext __pyx_result, tuple __pyx_state):
 *     __pyx_result.allow_capabilities = __pyx_state[0]; __pyx_result.annotations = __pyx_state[1]; __pyx_result.args = __pyx_state[2]; __pyx_result.capabilities = __pyx_state[3]; __pyx_result.cardinality = __pyx_state[4]; __pyx_result.expect_one = __pyx_state[5]; __pyx_result.implicit_limit = __pyx_state[6]; __pyx_result.in_dc = __pyx_state[7]; __pyx_result.inline_typeids = __pyx_state[8]; __pyx_result.inline_typenames = __pyx_state[9]; __pyx_result.input_language = __pyx_state[10]; __pyx_result.kwargs = __pyx_state[11]; __pyx_result.out_dc = __pyx_state[12]; __pyx_result.output_format = __pyx_state[13]; __pyx_result.qc = __pyx_state[14]; __pyx_result.query = __pyx_state[15]; __pyx_result.reg = __pyx_state[16]; __pyx_result.required_one = __pyx_state[17]; __pyx_result.state = __pyx_state[18]; __pyx_result.warnings = __pyx_state[19]
 *     if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[20])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_ExecuteContext__set_state(<ExecuteContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ExecuteContext__set_state(ExecuteContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.allow_capabilities = __pyx_state[0]; __pyx_result.annotations = __pyx_state[1]; __pyx_result.args = __pyx_state[2]; __pyx_result.capabilities = __pyx_state[3]; __pyx_result.cardinality = __pyx_state[4]; __pyx_result.expect_one = __pyx_state[5]; __pyx_result.implicit_limit = __pyx_state[6]; __pyx_result.in_dc = __pyx_state[7]; __pyx_result.inline_typeids = __pyx_state[8]; __pyx_result.inline_typenames = __pyx_state[9]; __pyx_result.input_language = __pyx_state[10]; __pyx_result.kwargs = __pyx_state[11]; __pyx_result.out_dc = __pyx_state[12]; __pyx_result.output_format = __pyx_state[13]; __pyx_result.qc = __pyx_state[14]; __pyx_result.query = __pyx_state[15]; __pyx_result.reg = __pyx_state[16]; __pyx_result.required_one = __pyx_state[17]; __pyx_result.state = __pyx_state[18]; __pyx_result.warnings = __pyx_state[19]
 *     if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_ExecuteContext__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_SansIOProtocol(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_7__pyx_unpickle_SansIOProtocol(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_7__pyx_unpickle_SansIOProtocol = {"__pyx_unpickle_SansIOProtocol", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_7__pyx_unpickle_SansIOProtocol, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_7__pyx_unpickle_SansIOProtocol(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_SansIOProtocol (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SansIOProtocol", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SansIOProtocol", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_SansIOProtocol") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SansIOProtocol", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_SansIOProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_6__pyx_unpickle_SansIOProtocol(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_6__pyx_unpickle_SansIOProtocol(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SansIOProtocol", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59f3fd8, 0xfa99196, 0xaca005c):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__95, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59f3fd8, 0xfa99196, 0xaca005c):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 *     __pyx_result = SansIOProtocol.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x59f3fd8, 0xfa99196, 0xaca005c):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = SansIOProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59f3fd8, 0xfa99196, 0xaca005c):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 *     __pyx_result = SansIOProtocol.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SansIOProtocol__set_state(<SansIOProtocol> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 *     __pyx_result = SansIOProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SansIOProtocol__set_state(<SansIOProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = SansIOProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SansIOProtocol__set_state(<SansIOProtocol> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_SansIOProtocol__set_state(SansIOProtocol __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_SansIOProtocol__set_state(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 *     __pyx_result = SansIOProtocol.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SansIOProtocol__set_state(<SansIOProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SansIOProtocol__set_state(<SansIOProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_SansIOProtocol__set_state(SansIOProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SansIOProtocol(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_SansIOProtocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_SansIOProtocol__set_state(<SansIOProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SansIOProtocol__set_state(SansIOProtocol __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_SansIOProtocol__set_state(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SansIOProtocol__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_SansIOProtocol__set_state(SansIOProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->backend_secret);
  __Pyx_DECREF(__pyx_v___pyx_result->backend_secret);
  __pyx_v___pyx_result->backend_secret = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->buffer);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->buffer);
  __pyx_v___pyx_result->buffer = ((struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cancelled = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->con);
  __Pyx_DECREF(__pyx_v___pyx_result->con);
  __pyx_v___pyx_result->con = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->con_params);
  __Pyx_DECREF(__pyx_v___pyx_result->con_params);
  __pyx_v___pyx_result->con_params = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->connected = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->internal_reg);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->internal_reg);
  __pyx_v___pyx_result->internal_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->is_legacy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->last_capabilities);
  __Pyx_DECREF(__pyx_v___pyx_result->last_capabilities);
  __pyx_v___pyx_result->last_capabilities = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->last_details);
  __Pyx_DECREF(__pyx_v___pyx_result->last_details);
  __pyx_v___pyx_result->last_details = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->last_status);
  __Pyx_DECREF(__pyx_v___pyx_result->last_status);
  __pyx_v___pyx_result->last_status = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->protocol_version);
  __Pyx_DECREF(__pyx_v___pyx_result->protocol_version);
  __pyx_v___pyx_result->protocol_version = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->server_settings);
  __Pyx_DECREF(__pyx_v___pyx_result->server_settings);
  __pyx_v___pyx_result->server_settings = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->state_cache);
  __Pyx_DECREF(__pyx_v___pyx_result->state_cache);
  __pyx_v___pyx_result->state_cache = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->state_codec);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->state_codec);
  __pyx_v___pyx_result->state_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->state_type_id);
  __Pyx_DECREF(__pyx_v___pyx_result->state_type_id);
  __pyx_v___pyx_result->state_type_id = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)__Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->xact_status = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_SansIOProtocol__set_state(SansIOProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 > 17);
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[17])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_SansIOProtocol__set_state(SansIOProtocol __pyx_result, tuple __pyx_state):
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_SansIOProtocol__set_state(<SansIOProtocol> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SansIOProtocol__set_state(SansIOProtocol __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_SansIOProtocol__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_SansIOProtocolBackwardsCompatible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9__pyx_unpickle_SansIOProtocolBackwardsCompatible(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_3gel_8protocol_8protocol_9__pyx_unpickle_SansIOProtocolBackwardsCompatible = {"__pyx_unpickle_SansIOProtocolBackwardsCompatible", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9__pyx_unpickle_SansIOProtocolBackwardsCompatible, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_3gel_8protocol_8protocol_9__pyx_unpickle_SansIOProtocolBackwardsCompatible(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_SansIOProtocolBackwardsCompatible (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_MACROS
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SansIOProtocolBackwardsCompatible", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
          (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
          kw_args--;
        }
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SansIOProtocolBackwardsCompatible", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_SansIOProtocolBackwardsCompatible") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SansIOProtocolBackwardsCompatible", 1, 3, 3, __pyx_nargs); __PYX_ERR(2, 1, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_SansIOProtocolBackwardsCompatible", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_3gel_8protocol_8protocol_8__pyx_unpickle_SansIOProtocolBackwardsCompatible(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  {
    Py_ssize_t __pyx_temp;
    for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
      __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
    }
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_3gel_8protocol_8protocol_8__pyx_unpickle_SansIOProtocolBackwardsCompatible(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  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;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SansIOProtocolBackwardsCompatible", 1);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59f3fd8, 0xfa99196, 0xaca005c):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 */
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__95, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59f3fd8, 0xfa99196, 0xaca005c):
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 *     __pyx_result = SansIOProtocolBackwardsCompatible.__new__(__pyx_type)
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(2, 5, __pyx_L1_error);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_v___pyx_PickleError = __pyx_t_1;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum not in (0x59f3fd8, 0xfa99196, 0xaca005c):
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = SansIOProtocolBackwardsCompatible.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x59f3fd8, 0xfa99196, 0xaca005c):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 *     __pyx_result = SansIOProtocolBackwardsCompatible.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(<SansIOProtocolBackwardsCompatible> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  #if CYTHON_UNPACK_METHODS
  if (likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 *     __pyx_result = SansIOProtocolBackwardsCompatible.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(<SansIOProtocolBackwardsCompatible> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
  if (__pyx_t_2) {

    /* "(tree fragment)":9
 *     __pyx_result = SansIOProtocolBackwardsCompatible.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(<SansIOProtocolBackwardsCompatible> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(SansIOProtocolBackwardsCompatible __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(2, 9, __pyx_L1_error)
    __pyx_t_1 = __pyx_f_3gel_8protocol_8protocol___pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x59f3fd8, 0xfa99196, 0xaca005c) = (backend_secret, buffer, cancelled, con, con_params, connected, internal_reg, is_legacy, last_capabilities, last_details, last_status, protocol_version, server_settings, state_cache, state_codec, state_type_id, xact_status))" % __pyx_checksum
 *     __pyx_result = SansIOProtocolBackwardsCompatible.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(<SansIOProtocolBackwardsCompatible> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(<SansIOProtocolBackwardsCompatible> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(SansIOProtocolBackwardsCompatible __pyx_result, tuple __pyx_state):
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SansIOProtocolBackwardsCompatible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_SansIOProtocolBackwardsCompatible", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(<SansIOProtocolBackwardsCompatible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(SansIOProtocolBackwardsCompatible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_3gel_8protocol_8protocol___pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  unsigned int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state", 1);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(SansIOProtocolBackwardsCompatible __pyx_result, tuple __pyx_state):
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.backend_secret);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.backend_secret);
  __pyx_v___pyx_result->__pyx_base.backend_secret = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.buffer);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.buffer);
  __pyx_v___pyx_result->__pyx_base.buffer = ((struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.cancelled = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.con);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.con);
  __pyx_v___pyx_result->__pyx_base.con = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.con_params);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.con_params);
  __pyx_v___pyx_result->__pyx_base.con_params = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.connected = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.internal_reg);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.internal_reg);
  __pyx_v___pyx_result->__pyx_base.internal_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.is_legacy = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.last_capabilities);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.last_capabilities);
  __pyx_v___pyx_result->__pyx_base.last_capabilities = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.last_details);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.last_details);
  __pyx_v___pyx_result->__pyx_base.last_details = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.last_status);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.last_status);
  __pyx_v___pyx_result->__pyx_base.last_status = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.protocol_version);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.protocol_version);
  __pyx_v___pyx_result->__pyx_base.protocol_version = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.server_settings);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.server_settings);
  __pyx_v___pyx_result->__pyx_base.server_settings = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.state_cache);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.state_cache);
  __pyx_v___pyx_result->__pyx_base.state_cache = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec))))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF((PyObject *)__pyx_v___pyx_result->__pyx_base.state_codec);
  __Pyx_DECREF((PyObject *)__pyx_v___pyx_result->__pyx_base.state_codec);
  __pyx_v___pyx_result->__pyx_base.state_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_1))) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.state_type_id);
  __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.state_type_id);
  __pyx_v___pyx_result->__pyx_base.state_type_id = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(2, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)__Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->__pyx_base.xact_status = __pyx_t_3;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(SansIOProtocolBackwardsCompatible __pyx_result, tuple __pyx_state):
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(2, 13, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_4 > 17);
  if (__pyx_t_5) {
  } else {
    __pyx_t_2 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(2, 13, __pyx_L1_error)
  __pyx_t_2 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "(tree fragment)":14
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[17])             # <<<<<<<<<<<<<<
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 14, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_9 = 0;
    #if CYTHON_UNPACK_METHODS
    if (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_9 = 1;
      }
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(SansIOProtocolBackwardsCompatible __pyx_result, tuple __pyx_state):
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[17])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(<SansIOProtocolBackwardsCompatible> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(SansIOProtocolBackwardsCompatible __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.backend_secret = __pyx_state[0]; __pyx_result.buffer = __pyx_state[1]; __pyx_result.cancelled = __pyx_state[2]; __pyx_result.con = __pyx_state[3]; __pyx_result.con_params = __pyx_state[4]; __pyx_result.connected = __pyx_state[5]; __pyx_result.internal_reg = __pyx_state[6]; __pyx_result.is_legacy = __pyx_state[7]; __pyx_result.last_capabilities = __pyx_state[8]; __pyx_result.last_details = __pyx_state[9]; __pyx_result.last_status = __pyx_state[10]; __pyx_result.protocol_version = __pyx_state[11]; __pyx_result.server_settings = __pyx_state[12]; __pyx_result.state_cache = __pyx_state[13]; __pyx_result.state_codec = __pyx_state[14]; __pyx_result.state_type_id = __pyx_state[15]; __pyx_result.xact_status = __pyx_state[16]
 *     if len(__pyx_state) > 17 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gel.protocol.protocol.__pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_LRUMapping __pyx_vtable_3gel_8protocol_8protocol_LRUMapping;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_LRUMapping(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)o);
  p->__pyx_vtab = __pyx_vtabptr_3gel_8protocol_8protocol_LRUMapping;
  p->_dict = Py_None; Py_INCREF(Py_None);
  p->_dict_move_to_end = Py_None; Py_INCREF(Py_None);
  p->_dict_get = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_LRUMapping(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *p = (struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_LRUMapping) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_dict);
  Py_CLEAR(p->_dict_move_to_end);
  Py_CLEAR(p->_dict_get);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_LRUMapping(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *p = (struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)o;
  if (p->_dict) {
    e = (*v)(p->_dict, a); if (e) return e;
  }
  if (p->_dict_move_to_end) {
    e = (*v)(p->_dict_move_to_end, a); if (e) return e;
  }
  if (p->_dict_get) {
    e = (*v)(p->_dict_get, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_LRUMapping(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *p = (struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)o;
  tmp = ((PyObject*)p->_dict);
  p->_dict = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_dict_move_to_end);
  p->_dict_move_to_end = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_dict_get);
  p->_dict_get = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_3gel_8protocol_8protocol_LRUMapping(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_3gel_8protocol_8protocol_LRUMapping(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_5__setitem__(o, i, v);
  }
  else {
    return __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_7__delitem__(o, i);
  }
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_LRUMapping[] = {
  {"clear", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_15clear, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_LRUMapping_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_LRUMapping},
  {Py_sq_length, (void *)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_11__len__},
  {Py_sq_item, (void *)__pyx_sq_item_3gel_8protocol_8protocol_LRUMapping},
  {Py_sq_contains, (void *)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_9__contains__},
  {Py_mp_length, (void *)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_11__len__},
  {Py_mp_subscript, (void *)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_3__getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_3gel_8protocol_8protocol_LRUMapping},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_LRUMapping},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_LRUMapping},
  {Py_tp_iter, (void *)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_13__iter__},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_LRUMapping},
  {Py_tp_init, (void *)__pyx_pw_3gel_8protocol_8protocol_10LRUMapping_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_LRUMapping},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_LRUMapping_spec = {
  "gel.protocol.protocol.LRUMapping",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_LRUMapping_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_LRUMapping = {
  __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_11__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_3gel_8protocol_8protocol_LRUMapping, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_9__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_LRUMapping = {
  __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_11__len__, /*mp_length*/
  __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_3__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_3gel_8protocol_8protocol_LRUMapping, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_LRUMapping = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""LRUMapping", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_LRUMapping, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_LRUMapping, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_LRUMapping, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_LRUMapping, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_LRUMapping, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_13__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_LRUMapping, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_3gel_8protocol_8protocol_10LRUMapping_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_LRUMapping, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec __pyx_vtable_3gel_8protocol_8protocol_BaseCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)o);
  p->__pyx_vtab = __pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  p->tid = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->type_name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_3__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  Py_CLEAR(p->tid);
  Py_CLEAR(p->name);
  Py_CLEAR(p->type_name);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_BaseCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_5make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_BaseCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_BaseCodec},
  {Py_tp_init, (void *)__pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_BaseCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_BaseCodec_spec = {
  "gel.protocol.protocol.BaseCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_3gel_8protocol_8protocol_BaseCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_BaseCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""BaseCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_BaseCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecPythonOverride __pyx_vtable_3gel_8protocol_8protocol_CodecPythonOverride;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_CodecPythonOverride(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_CodecPythonOverride;
  p->codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  p->encoder = Py_None; Py_INCREF(Py_None);
  p->decoder = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_CodecPythonOverride(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *p = (struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_CodecPythonOverride) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->codec);
  Py_CLEAR(p->encoder);
  Py_CLEAR(p->decoder);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_CodecPythonOverride(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *p = (struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)o;
  e = ((likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) ? ((__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse) ? __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_CodecPythonOverride)); if (e) return e;
  if (p->codec) {
    e = (*v)(((PyObject *)p->codec), a); if (e) return e;
  }
  if (p->encoder) {
    e = (*v)(p->encoder, a); if (e) return e;
  }
  if (p->decoder) {
    e = (*v)(p->decoder, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_CodecPythonOverride(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *p = (struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride *)o;
  if (likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) { if (__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_CodecPythonOverride);
  tmp = ((PyObject*)p->codec);
  p->codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->encoder);
  p->encoder = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->decoder);
  p->decoder = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_CodecPythonOverride[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_19CodecPythonOverride_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_CodecPythonOverride_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_CodecPythonOverride},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_CodecPythonOverride},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_CodecPythonOverride},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_CodecPythonOverride},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_CodecPythonOverride},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_CodecPythonOverride_spec = {
  "gel.protocol.protocol.CodecPythonOverride",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_CodecPythonOverride_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_CodecPythonOverride = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""CodecPythonOverride", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_CodecPythonOverride), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_CodecPythonOverride, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_CodecPythonOverride, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_CodecPythonOverride, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_CodecPythonOverride, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_CodecPythonOverride, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseRecordCodec __pyx_vtable_3gel_8protocol_8protocol_BaseRecordCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_BaseRecordCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_BaseRecordCodec;
  p->fields_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseRecordCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseRecordCodec) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->fields_codecs);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_BaseRecordCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)o;
  e = ((likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) ? ((__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse) ? __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_BaseRecordCodec)); if (e) return e;
  if (p->fields_codecs) {
    e = (*v)(p->fields_codecs, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_BaseRecordCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *)o;
  if (likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) { if (__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_BaseRecordCodec);
  tmp = ((PyObject*)p->fields_codecs);
  p->fields_codecs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_BaseRecordCodec[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15BaseRecordCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_BaseRecordCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_BaseRecordCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_BaseRecordCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_BaseRecordCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_BaseRecordCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_BaseRecordCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_BaseRecordCodec_spec = {
  "gel.protocol.protocol.BaseRecordCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_BaseRecordCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_BaseRecordCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""BaseRecordCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseRecordCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_BaseRecordCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseRecordCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_BaseRecordCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_BaseRecordCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_EmptyTupleCodec __pyx_vtable_3gel_8protocol_8protocol_EmptyTupleCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_EmptyTupleCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_EmptyTupleCodec;
  p->empty_tup = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_EmptyTupleCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_EmptyTupleCodec) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->empty_tup);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_EmptyTupleCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *)o;
  e = ((likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) ? ((__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse) ? __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_EmptyTupleCodec)); if (e) return e;
  if (p->empty_tup) {
    e = (*v)(p->empty_tup, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_EmptyTupleCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec *)o;
  if (likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) { if (__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_EmptyTupleCodec);
  tmp = ((PyObject*)p->empty_tup);
  p->empty_tup = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_EmptyTupleCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15EmptyTupleCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_EmptyTupleCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_EmptyTupleCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_EmptyTupleCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_EmptyTupleCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_EmptyTupleCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec_spec = {
  "gel.protocol.protocol.EmptyTupleCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""EmptyTupleCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_EmptyTupleCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_EmptyTupleCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_EmptyTupleCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_EmptyTupleCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_EmptyTupleCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_EmptyTupleCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_NullCodec __pyx_vtable_3gel_8protocol_8protocol_NullCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_NullCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_NullCodec *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_NullCodec;
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_9NullCodec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_NullCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9NullCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9NullCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9NullCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_NullCodec_slots[] = {
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_NullCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_NullCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_NullCodec_spec = {
  "gel.protocol.protocol.NullCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_NullCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_3gel_8protocol_8protocol_NullCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_NullCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""NullCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_NullCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_NullCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_NullCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseNamedRecordCodec __pyx_vtable_3gel_8protocol_8protocol_BaseNamedRecordCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_BaseNamedRecordCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseRecordCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  p->descriptor = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseNamedRecordCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseNamedRecordCodec) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->descriptor);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseRecordCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_BaseNamedRecordCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)o;
  e = __pyx_tp_traverse_3gel_8protocol_8protocol_BaseRecordCodec(o, v, a); if (e) return e;
  if (p->descriptor) {
    e = (*v)(p->descriptor, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_BaseNamedRecordCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec *)o;
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseRecordCodec(o);
  tmp = ((PyObject*)p->descriptor);
  p->descriptor = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_BaseNamedRecordCodec[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_20BaseNamedRecordCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_BaseNamedRecordCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_BaseNamedRecordCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_BaseNamedRecordCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_BaseNamedRecordCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_BaseNamedRecordCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec_spec = {
  "gel.protocol.protocol.BaseNamedRecordCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""BaseNamedRecordCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_BaseNamedRecordCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseNamedRecordCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_BaseNamedRecordCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseNamedRecordCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_BaseNamedRecordCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_BaseNamedRecordCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_EdegDBCodecContext __pyx_vtable_3gel_8protocol_8protocol_EdegDBCodecContext;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_EdegDBCodecContext(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *p;
  PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext, tp_new, newfunc)(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_CodecContext*)__pyx_vtabptr_3gel_8protocol_8protocol_EdegDBCodecContext;
  p->_codec = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_EdegDBCodecContext(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *p = (struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_EdegDBCodecContext) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_codec);
  #if PY_MAJOR_VERSION < 3
  if (!(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext) || PyType_IS_GC(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext)) PyObject_GC_Track(o);
  #else
  if (PyType_IS_GC(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext)) PyObject_GC_Track(o);
  #endif
  if (likely(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext)) __Pyx_PyType_GetSlot(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext, tp_dealloc, destructor)(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_3gel_8protocol_8protocol_EdegDBCodecContext);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_EdegDBCodecContext(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *p = (struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)o;
  e = ((likely(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext)) ? ((__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext->tp_traverse) ? __pyx_ptype_3gel_7pgproto_7pgproto_CodecContext->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_EdegDBCodecContext)); if (e) return e;
  if (p->_codec) {
    e = (*v)(p->_codec, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_EdegDBCodecContext(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *p = (struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)o;
  if (likely(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext)) { if (__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext->tp_clear) __pyx_ptype_3gel_7pgproto_7pgproto_CodecContext->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_EdegDBCodecContext);
  tmp = ((PyObject*)p->_codec);
  p->_codec = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_EdegDBCodecContext[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_18EdegDBCodecContext_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_EdegDBCodecContext},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_EdegDBCodecContext},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_EdegDBCodecContext},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_EdegDBCodecContext},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_EdegDBCodecContext},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext_spec = {
  "gel.protocol.protocol.EdegDBCodecContext",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""EdegDBCodecContext", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_EdegDBCodecContext, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_EdegDBCodecContext, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_EdegDBCodecContext, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_EdegDBCodecContext, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_EdegDBCodecContext, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_ScalarCodec __pyx_vtable_3gel_8protocol_8protocol_ScalarCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_ScalarCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_ScalarCodec;
  p->base_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_ScalarCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->base_codec);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_ScalarCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)o;
  e = ((likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) ? ((__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse) ? __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_ScalarCodec)); if (e) return e;
  if (p->base_codec) {
    e = (*v)(((PyObject *)p->base_codec), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_ScalarCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)o;
  if (likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) { if (__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_ScalarCodec);
  tmp = ((PyObject*)p->base_codec);
  p->base_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_ScalarCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ScalarCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_ScalarCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_ScalarCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_ScalarCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_ScalarCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_ScalarCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_ScalarCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_ScalarCodec_spec = {
  "gel.protocol.protocol.ScalarCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_ScalarCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_ScalarCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""ScalarCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_ScalarCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_ScalarCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_ScalarCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_ScalarCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_ScalarCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_TupleCodec __pyx_vtable_3gel_8protocol_8protocol_TupleCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_TupleCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseRecordCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_TupleCodec;
  return o;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_TupleCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10TupleCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_TupleCodec_slots[] = {
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_BaseRecordCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_BaseRecordCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_TupleCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_TupleCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_TupleCodec_spec = {
  "gel.protocol.protocol.TupleCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_TupleCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_TupleCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""TupleCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_TupleCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseRecordCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_BaseRecordCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseRecordCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_TupleCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_TupleCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_NamedTupleCodec __pyx_vtable_3gel_8protocol_8protocol_NamedTupleCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_NamedTupleCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseNamedRecordCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_NamedTupleCodec;
  p->namedtuple_type = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_NamedTupleCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->namedtuple_type);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseNamedRecordCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_NamedTupleCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *)o;
  e = __pyx_tp_traverse_3gel_8protocol_8protocol_BaseNamedRecordCodec(o, v, a); if (e) return e;
  if (p->namedtuple_type) {
    e = (*v)(p->namedtuple_type, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_NamedTupleCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec *)o;
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseNamedRecordCodec(o);
  tmp = ((PyObject*)p->namedtuple_type);
  p->namedtuple_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_NamedTupleCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15NamedTupleCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_NamedTupleCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_NamedTupleCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_NamedTupleCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_NamedTupleCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_NamedTupleCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_NamedTupleCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_NamedTupleCodec_spec = {
  "gel.protocol.protocol.NamedTupleCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_NamedTupleCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_NamedTupleCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""NamedTupleCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_NamedTupleCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_NamedTupleCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_NamedTupleCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_NamedTupleCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_NamedTupleCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_NamedTupleCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_ObjectCodec __pyx_vtable_3gel_8protocol_8protocol_ObjectCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_ObjectCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseNamedRecordCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_ObjectCodec;
  p->cached_dataclass_fields = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_ObjectCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->cached_dataclass_fields);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseNamedRecordCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_ObjectCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)o;
  e = __pyx_tp_traverse_3gel_8protocol_8protocol_BaseNamedRecordCodec(o, v, a); if (e) return e;
  if (p->cached_dataclass_fields) {
    e = (*v)(p->cached_dataclass_fields, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_ObjectCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *)o;
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseNamedRecordCodec(o);
  tmp = ((PyObject*)p->cached_dataclass_fields);
  p->cached_dataclass_fields = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_ObjectCodec[] = {
  {"_make_missing_args_error_message", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_1_make_missing_args_error_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"get_dataclass_fields", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_3get_dataclass_fields, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_5make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11ObjectCodec_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_ObjectCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_ObjectCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_ObjectCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_ObjectCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_ObjectCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_ObjectCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_ObjectCodec_spec = {
  "gel.protocol.protocol.ObjectCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_ObjectCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_ObjectCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""ObjectCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_ObjectCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_ObjectCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_ObjectCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_ObjectCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_ObjectCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseArrayCodec __pyx_vtable_3gel_8protocol_8protocol_BaseArrayCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_BaseArrayCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_BaseArrayCodec;
  p->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseArrayCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseArrayCodec) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->sub_codec);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_BaseArrayCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *)o;
  e = ((likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) ? ((__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse) ? __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_BaseArrayCodec)); if (e) return e;
  if (p->sub_codec) {
    e = (*v)(((PyObject *)p->sub_codec), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_BaseArrayCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *)o;
  if (likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) { if (__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_BaseArrayCodec);
  tmp = ((PyObject*)p->sub_codec);
  p->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_BaseArrayCodec[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14BaseArrayCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_BaseArrayCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_BaseArrayCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_BaseArrayCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_BaseArrayCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_BaseArrayCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_BaseArrayCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_BaseArrayCodec_spec = {
  "gel.protocol.protocol.BaseArrayCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_BaseArrayCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_BaseArrayCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""BaseArrayCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_ArrayCodec __pyx_vtable_3gel_8protocol_8protocol_ArrayCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_ArrayCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseArrayCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_ArrayCodec;
  return o;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_ArrayCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10ArrayCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_ArrayCodec_slots[] = {
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_BaseArrayCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_BaseArrayCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_ArrayCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_ArrayCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_ArrayCodec_spec = {
  "gel.protocol.protocol.ArrayCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_ArrayCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_ArrayCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""ArrayCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_ArrayCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_ArrayCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_ArrayCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_RangeCodec __pyx_vtable_3gel_8protocol_8protocol_RangeCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_RangeCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_RangeCodec;
  p->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_RangeCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->sub_codec);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_RangeCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)o;
  e = ((likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) ? ((__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse) ? __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_RangeCodec)); if (e) return e;
  if (p->sub_codec) {
    e = (*v)(((PyObject *)p->sub_codec), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_RangeCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec *)o;
  if (likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) { if (__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_RangeCodec);
  tmp = ((PyObject*)p->sub_codec);
  p->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_RangeCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_10RangeCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_RangeCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_RangeCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_RangeCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_RangeCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_RangeCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_RangeCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_RangeCodec_spec = {
  "gel.protocol.protocol.RangeCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_RangeCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_RangeCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""RangeCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_RangeCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_RangeCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_RangeCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_RangeCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_RangeCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_RangeCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_MultiRangeCodec __pyx_vtable_3gel_8protocol_8protocol_MultiRangeCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_MultiRangeCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_MultiRangeCodec;
  p->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_MultiRangeCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->sub_codec);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_MultiRangeCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)o;
  e = ((likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) ? ((__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse) ? __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_MultiRangeCodec)); if (e) return e;
  if (p->sub_codec) {
    e = (*v)(((PyObject *)p->sub_codec), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_MultiRangeCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec *)o;
  if (likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) { if (__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_MultiRangeCodec);
  tmp = ((PyObject*)p->sub_codec);
  p->sub_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_MultiRangeCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_3make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_5__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_15MultiRangeCodec_7__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_MultiRangeCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_MultiRangeCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_MultiRangeCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_MultiRangeCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_MultiRangeCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_MultiRangeCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_MultiRangeCodec_spec = {
  "gel.protocol.protocol.MultiRangeCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_MultiRangeCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_MultiRangeCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""MultiRangeCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_MultiRangeCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_MultiRangeCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_MultiRangeCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_MultiRangeCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_MultiRangeCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_MultiRangeCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_SetCodec __pyx_vtable_3gel_8protocol_8protocol_SetCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_SetCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseArrayCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_SetCodec;
  return o;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_SetCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_8SetCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_8SetCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_8SetCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_SetCodec_slots[] = {
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_BaseArrayCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_BaseArrayCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_SetCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_SetCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_SetCodec_spec = {
  "gel.protocol.protocol.SetCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_SetCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_SetCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""SetCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseArrayCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_SetCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_SetCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_EnumCodec __pyx_vtable_3gel_8protocol_8protocol_EnumCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_EnumCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_EnumCodec;
  p->cls = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_EnumCodec(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->cls);
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseCodec(o);
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_EnumCodec(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *)o;
  e = ((likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) ? ((__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse) ? __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3gel_8protocol_8protocol_EnumCodec)); if (e) return e;
  if (p->cls) {
    e = (*v)(p->cls, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_EnumCodec(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *p = (struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec *)o;
  if (likely(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) { if (__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3gel_8protocol_8protocol_EnumCodec);
  tmp = ((PyObject*)p->cls);
  p->cls = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_EnumCodec[] = {
  {"make_type", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_1make_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_9EnumCodec_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_EnumCodec_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_EnumCodec},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_EnumCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_EnumCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_EnumCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_EnumCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_EnumCodec_spec = {
  "gel.protocol.protocol.EnumCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_EnumCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_EnumCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""EnumCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_EnumCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_EnumCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_EnumCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_EnumCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_EnumCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_EnumCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_RecordCodec __pyx_vtable_3gel_8protocol_8protocol_RecordCodec;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_RecordCodec(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_BaseNamedRecordCodec(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec *)o);
  p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_BaseCodec*)__pyx_vtabptr_3gel_8protocol_8protocol_RecordCodec;
  return o;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_RecordCodec[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11RecordCodec_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_11RecordCodec_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_RecordCodec_slots[] = {
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_BaseNamedRecordCodec},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_BaseNamedRecordCodec},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_RecordCodec},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_RecordCodec},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_RecordCodec_spec = {
  "gel.protocol.protocol.RecordCodec",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_RecordCodec_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_RecordCodec = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""RecordCodec", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_RecordCodec), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_BaseNamedRecordCodec, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_BaseNamedRecordCodec, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_BaseNamedRecordCodec, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_RecordCodec, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_9BaseCodec_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_RecordCodec, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_CodecsRegistry __pyx_vtable_3gel_8protocol_8protocol_CodecsRegistry;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_CodecsRegistry(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)o);
  p->__pyx_vtab = __pyx_vtabptr_3gel_8protocol_8protocol_CodecsRegistry;
  p->codecs_build_cache = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)Py_None); Py_INCREF(Py_None);
  p->codecs = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)Py_None); Py_INCREF(Py_None);
  p->base_codec_overrides = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_CodecsRegistry(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *p = (struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_CodecsRegistry) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->codecs_build_cache);
  Py_CLEAR(p->codecs);
  Py_CLEAR(p->base_codec_overrides);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_CodecsRegistry(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *p = (struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)o;
  if (p->codecs_build_cache) {
    e = (*v)(((PyObject *)p->codecs_build_cache), a); if (e) return e;
  }
  if (p->codecs) {
    e = (*v)(((PyObject *)p->codecs), a); if (e) return e;
  }
  if (p->base_codec_overrides) {
    e = (*v)(p->base_codec_overrides, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_CodecsRegistry(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *p = (struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)o;
  tmp = ((PyObject*)p->codecs_build_cache);
  p->codecs_build_cache = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->codecs);
  p->codecs = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->base_codec_overrides);
  p->base_codec_overrides = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_CodecsRegistry[] = {
  {"clear_cache", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_3clear_cache, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"set_type_codec", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_5set_type_codec, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_CodecsRegistry_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_CodecsRegistry},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_CodecsRegistry},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_CodecsRegistry},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_CodecsRegistry},
  {Py_tp_init, (void *)__pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_CodecsRegistry},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_CodecsRegistry_spec = {
  "gel.protocol.protocol.CodecsRegistry",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_CodecsRegistry_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_CodecsRegistry = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""CodecsRegistry", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_CodecsRegistry, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_CodecsRegistry, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_CodecsRegistry, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_CodecsRegistry, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_3gel_8protocol_8protocol_14CodecsRegistry_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_CodecsRegistry, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_ExecuteContext __pyx_vtable_3gel_8protocol_8protocol_ExecuteContext;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_ExecuteContext(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)o);
  p->__pyx_vtab = __pyx_vtabptr_3gel_8protocol_8protocol_ExecuteContext;
  p->query = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->args = Py_None; Py_INCREF(Py_None);
  p->kwargs = Py_None; Py_INCREF(Py_None);
  p->reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)Py_None); Py_INCREF(Py_None);
  p->qc = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)Py_None); Py_INCREF(Py_None);
  p->state = Py_None; Py_INCREF(Py_None);
  p->annotations = Py_None; Py_INCREF(Py_None);
  p->cardinality = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  p->out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  p->warnings = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_ExecuteContext(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *p = (struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_ExecuteContext) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->query);
  Py_CLEAR(p->args);
  Py_CLEAR(p->kwargs);
  Py_CLEAR(p->reg);
  Py_CLEAR(p->qc);
  Py_CLEAR(p->state);
  Py_CLEAR(p->annotations);
  Py_CLEAR(p->cardinality);
  Py_CLEAR(p->in_dc);
  Py_CLEAR(p->out_dc);
  Py_CLEAR(p->warnings);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_ExecuteContext(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *p = (struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)o;
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  if (p->kwargs) {
    e = (*v)(p->kwargs, a); if (e) return e;
  }
  if (p->reg) {
    e = (*v)(((PyObject *)p->reg), a); if (e) return e;
  }
  if (p->qc) {
    e = (*v)(((PyObject *)p->qc), a); if (e) return e;
  }
  if (p->state) {
    e = (*v)(p->state, a); if (e) return e;
  }
  if (p->annotations) {
    e = (*v)(p->annotations, a); if (e) return e;
  }
  if (p->in_dc) {
    e = (*v)(((PyObject *)p->in_dc), a); if (e) return e;
  }
  if (p->out_dc) {
    e = (*v)(((PyObject *)p->out_dc), a); if (e) return e;
  }
  if (p->warnings) {
    e = (*v)(p->warnings, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_ExecuteContext(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *p = (struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *)o;
  tmp = ((PyObject*)p->args);
  p->args = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->kwargs);
  p->kwargs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->reg);
  p->reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->qc);
  p->qc = ((struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->state);
  p->state = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->annotations);
  p->annotations = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->in_dc);
  p->in_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->out_dc);
  p->out_dc = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->warnings);
  p->warnings = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_cardinality(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_11cardinality_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_in_dc(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_5in_dc_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_out_dc(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_6out_dc_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_capabilities(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_12capabilities_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_warnings(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_8warnings_1__get__(o);
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_ExecuteContext[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3gel_8protocol_8protocol_ExecuteContext[] = {
  {(char *)"cardinality", __pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_cardinality, 0, (char *)0, 0},
  {(char *)"in_dc", __pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_in_dc, 0, (char *)0, 0},
  {(char *)"out_dc", __pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_out_dc, 0, (char *)0, 0},
  {(char *)"capabilities", __pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_capabilities, 0, (char *)0, 0},
  {(char *)"warnings", __pyx_getprop_3gel_8protocol_8protocol_14ExecuteContext_warnings, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_ExecuteContext_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_ExecuteContext},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_ExecuteContext},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_ExecuteContext},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_ExecuteContext},
  {Py_tp_getset, (void *)__pyx_getsets_3gel_8protocol_8protocol_ExecuteContext},
  {Py_tp_init, (void *)__pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_ExecuteContext},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_ExecuteContext_spec = {
  "gel.protocol.protocol.ExecuteContext",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_ExecuteContext_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_ExecuteContext = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""ExecuteContext", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_ExecuteContext, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_ExecuteContext, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_ExecuteContext, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_ExecuteContext, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3gel_8protocol_8protocol_ExecuteContext, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_3gel_8protocol_8protocol_14ExecuteContext_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_ExecuteContext, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocol(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)o);
  p->__pyx_vtab = __pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocol;
  p->buffer = ((struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *)Py_None); Py_INCREF(Py_None);
  p->con = Py_None; Py_INCREF(Py_None);
  p->con_params = Py_None; Py_INCREF(Py_None);
  p->backend_secret = Py_None; Py_INCREF(Py_None);
  p->internal_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)Py_None); Py_INCREF(Py_None);
  p->server_settings = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->last_status = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->last_details = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->last_capabilities = Py_None; Py_INCREF(Py_None);
  p->protocol_version = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->state_type_id = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->state_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  p->state_cache = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol_SansIOProtocol(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *p = (struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol_SansIOProtocol) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->buffer);
  Py_CLEAR(p->con);
  Py_CLEAR(p->con_params);
  Py_CLEAR(p->backend_secret);
  Py_CLEAR(p->internal_reg);
  Py_CLEAR(p->server_settings);
  Py_CLEAR(p->last_status);
  Py_CLEAR(p->last_details);
  Py_CLEAR(p->last_capabilities);
  Py_CLEAR(p->protocol_version);
  Py_CLEAR(p->state_type_id);
  Py_CLEAR(p->state_codec);
  Py_CLEAR(p->state_cache);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol_SansIOProtocol(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *p = (struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)o;
  if (p->buffer) {
    e = (*v)(((PyObject *)p->buffer), a); if (e) return e;
  }
  if (p->con) {
    e = (*v)(p->con, a); if (e) return e;
  }
  if (p->con_params) {
    e = (*v)(p->con_params, a); if (e) return e;
  }
  if (p->backend_secret) {
    e = (*v)(p->backend_secret, a); if (e) return e;
  }
  if (p->internal_reg) {
    e = (*v)(((PyObject *)p->internal_reg), a); if (e) return e;
  }
  if (p->server_settings) {
    e = (*v)(p->server_settings, a); if (e) return e;
  }
  if (p->last_capabilities) {
    e = (*v)(p->last_capabilities, a); if (e) return e;
  }
  if (p->protocol_version) {
    e = (*v)(p->protocol_version, a); if (e) return e;
  }
  if (p->state_codec) {
    e = (*v)(((PyObject *)p->state_codec), a); if (e) return e;
  }
  if (p->state_cache) {
    e = (*v)(p->state_cache, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol_SansIOProtocol(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *p = (struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *)o;
  tmp = ((PyObject*)p->buffer);
  p->buffer = ((struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->con);
  p->con = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->con_params);
  p->con_params = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->backend_secret);
  p->backend_secret = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->internal_reg);
  p->internal_reg = ((struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->server_settings);
  p->server_settings = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->last_capabilities);
  p->last_capabilities = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->protocol_version);
  p->protocol_version = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->state_codec);
  p->state_codec = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->state_cache);
  p->state_cache = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_connected(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9connected_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_cancelled(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9cancelled_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_con_params(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_10con_params_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_last_status(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_11last_status_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_last_details(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_12last_details_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_last_capabilities(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_17last_capabilities_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_protocol_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_16protocol_version_1__get__(o);
}

static PyObject *__pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_is_legacy(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_9is_legacy_1__get__(o);
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_SansIOProtocol[] = {
  {"get_settings", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_3get_settings, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"is_in_transaction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_5is_in_transaction, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"set_connection", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_7set_connection, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"wait_for_message", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_11wait_for_message, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"try_recv_eagerly", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_14try_recv_eagerly, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"wait_for_connect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_17wait_for_connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"wait_for_disconnect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_20wait_for_disconnect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_parse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_23_parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_26_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_29execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_32query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"dump", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_35dump, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_sync", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_38_sync, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"ping", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_41ping, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"restore", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_44restore, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"terminate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_47terminate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"connect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_49connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_auth_sasl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_52_auth_sasl, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_55__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_57__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_3gel_8protocol_8protocol_SansIOProtocol[] = {
  {(char *)"connected", __pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_connected, 0, (char *)0, 0},
  {(char *)"cancelled", __pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_cancelled, 0, (char *)0, 0},
  {(char *)"con_params", __pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_con_params, 0, (char *)0, 0},
  {(char *)"last_status", __pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_last_status, 0, (char *)0, 0},
  {(char *)"last_details", __pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_last_details, 0, (char *)0, 0},
  {(char *)"last_capabilities", __pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_last_capabilities, 0, (char *)0, 0},
  {(char *)"protocol_version", __pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_protocol_version, 0, (char *)0, 0},
  {(char *)"is_legacy", __pyx_getprop_3gel_8protocol_8protocol_14SansIOProtocol_is_legacy, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_SansIOProtocol_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol_SansIOProtocol},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_SansIOProtocol},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_SansIOProtocol},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_SansIOProtocol},
  {Py_tp_getset, (void *)__pyx_getsets_3gel_8protocol_8protocol_SansIOProtocol},
  {Py_tp_init, (void *)__pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocol},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_SansIOProtocol_spec = {
  "gel.protocol.protocol.SansIOProtocol",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_SansIOProtocol_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_SansIOProtocol = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""SansIOProtocol", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_SansIOProtocol, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_SansIOProtocol, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_SansIOProtocol, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_SansIOProtocol, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_3gel_8protocol_8protocol_SansIOProtocol, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocol, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible;

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *p;
  PyObject *o = __pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocol(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3gel_8protocol_8protocol_SansIOProtocol*)__pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible;
  return o;
}

static PyMethodDef __pyx_methods_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible[] = {
  {"_legacy_parse", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_1_legacy_parse, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_legacy_execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_4_legacy_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_legacy_optimistic_execute", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_7_legacy_optimistic_execute, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"legacy_execute_anonymous", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_10legacy_execute_anonymous, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"legacy_simple_query", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_13legacy_simple_query, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_16__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_18__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible_slots[] = {
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol_SansIOProtocol},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol_SansIOProtocol},
  {Py_tp_methods, (void *)__pyx_methods_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible_spec = {
  "gel.protocol.protocol.SansIOProtocolBackwardsCompatible",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""SansIOProtocolBackwardsCompatible", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol_SansIOProtocol, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol_SansIOProtocol, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol_SansIOProtocol, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_3gel_8protocol_8protocol_14SansIOProtocol_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct__make_type[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct__make_type = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct__make_type(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct__make_type > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct__make_type[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct__make_type];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct__make_type(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct__make_type) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_describe_context);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct__make_type < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct__make_type[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct__make_type++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct__make_type(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *)o;
  if (p->__pyx_v_describe_context) {
    e = (*v)(p->__pyx_v_describe_context, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_3gel_8protocol_8protocol___pyx_scope_struct__make_type(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type *)o;
  tmp = ((PyObject*)p->__pyx_v_describe_context);
  p->__pyx_v_describe_context = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct__make_type},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct__make_type},
  {Py_tp_clear, (void *)__pyx_tp_clear_3gel_8protocol_8protocol___pyx_scope_struct__make_type},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct__make_type},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type_spec = {
  "gel.protocol.protocol.__pyx_scope_struct__make_type",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct__make_type", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct__make_type), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct__make_type, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct__make_type, /*tp_traverse*/
  __pyx_tp_clear_3gel_8protocol_8protocol___pyx_scope_struct__make_type, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct__make_type, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_codec);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_codec) {
    e = (*v)(p->__pyx_v_codec, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_1_genexpr",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_genexpr_arg_0);
  Py_CLEAR(p->__pyx_v_x);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr *)o;
  if (p->__pyx_genexpr_arg_0) {
    e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e;
  }
  if (p->__pyx_v_x) {
    e = (*v)(p->__pyx_v_x, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_2_genexpr",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_3_wait_for_message",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_3_wait_for_message", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_4_try_recv_eagerly",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_4_try_recv_eagerly", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_5_wait_for_connect",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_5_wait_for_connect", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_6_wait_for_disconnect",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_6_wait_for_disconnect", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_7__parse[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_7__parse = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_7__parse(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_7__parse > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_7__parse[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_7__parse];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_7__parse(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_7__parse) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_ctx);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_in_type_id);
  Py_CLEAR(p->__pyx_v_methname);
  Py_CLEAR(p->__pyx_v_out_type_id);
  Py_CLEAR(p->__pyx_v_params);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_7__parse < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_7__parse[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_7__parse++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_7__parse(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse *)o;
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_ctx) {
    e = (*v)(((PyObject *)p->__pyx_v_ctx), a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_methname) {
    e = (*v)(p->__pyx_v_methname, a); if (e) return e;
  }
  if (p->__pyx_v_params) {
    e = (*v)(((PyObject *)p->__pyx_v_params), a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_7__parse},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_7__parse},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_7__parse},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_7__parse",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_7__parse", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_7__parse), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_7__parse, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_7__parse, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_7__parse, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_8__execute[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_8__execute = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_8__execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_8__execute > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_8__execute[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_8__execute];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_8__execute(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_8__execute) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_ctx);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_packet);
  Py_CLEAR(p->__pyx_v_params);
  Py_CLEAR(p->__pyx_v_result);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_8__execute < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_8__execute[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_8__execute++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_8__execute(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute *)o;
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_ctx) {
    e = (*v)(((PyObject *)p->__pyx_v_ctx), a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_packet) {
    e = (*v)(((PyObject *)p->__pyx_v_packet), a); if (e) return e;
  }
  if (p->__pyx_v_params) {
    e = (*v)(((PyObject *)p->__pyx_v_params), a); if (e) return e;
  }
  if (p->__pyx_v_result) {
    e = (*v)(p->__pyx_v_result, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_8__execute},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_8__execute},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_8__execute},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_8__execute",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_8__execute", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_8__execute), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_8__execute, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_8__execute, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_8__execute, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_9_execute[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_9_execute = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_9_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_9_execute > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_9_execute[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_9_execute];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_9_execute(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_9_execute) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ctx);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_9_execute < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_9_execute[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_9_execute++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_9_execute(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute *)o;
  if (p->__pyx_v_ctx) {
    e = (*v)(((PyObject *)p->__pyx_v_ctx), a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_9_execute},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_9_execute},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_9_execute},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_9_execute",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_9_execute", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_9_execute), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_9_execute, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_9_execute, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_9_execute, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_10_query[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_10_query = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_10_query(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_10_query > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_10_query[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_10_query];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_10_query(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_10_query) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_ctx);
  Py_CLEAR(p->__pyx_v_methname);
  Py_CLEAR(p->__pyx_v_ret);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_10_query < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_10_query[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_10_query++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_10_query(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query *)o;
  if (p->__pyx_v_ctx) {
    e = (*v)(((PyObject *)p->__pyx_v_ctx), a); if (e) return e;
  }
  if (p->__pyx_v_methname) {
    e = (*v)(p->__pyx_v_methname, a); if (e) return e;
  }
  if (p->__pyx_v_ret) {
    e = (*v)(p->__pyx_v_ret, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_10_query},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_10_query},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_10_query},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_10_query",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_10_query", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_10_query), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_10_query, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_10_query, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_10_query, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_11_dump[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_11_dump = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_11_dump(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_11_dump > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_11_dump[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_11_dump];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_11_dump(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_11_dump) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_block_callback);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_header_callback);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_11_dump < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_11_dump[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_11_dump++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_11_dump(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump *)o;
  if (p->__pyx_v_block_callback) {
    e = (*v)(p->__pyx_v_block_callback, a); if (e) return e;
  }
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_header_callback) {
    e = (*v)(p->__pyx_v_header_callback, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_11_dump},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_11_dump},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_11_dump},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_11_dump",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_11_dump", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_11_dump), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_11_dump, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_11_dump, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_11_dump, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_12__sync[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_12__sync = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_12__sync(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_12__sync > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_12__sync[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_12__sync];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_12__sync(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_12__sync) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_12__sync < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_12__sync[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_12__sync++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_12__sync(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_12__sync},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_12__sync},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_12__sync},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_12__sync",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_12__sync", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_12__sync), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_12__sync, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_12__sync, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_12__sync, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_13_ping[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_13_ping = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_13_ping(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_13_ping > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_13_ping[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_13_ping];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_13_ping(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_13_ping) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_13_ping < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_13_ping[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_13_ping++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_13_ping(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping *)o;
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_13_ping},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_13_ping},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_13_ping},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_13_ping",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_13_ping", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_13_ping), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_13_ping, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_13_ping, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_13_ping, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_14_restore[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_14_restore = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_14_restore(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_14_restore > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_14_restore[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_14_restore];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_14_restore(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_14_restore) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_data);
  Py_CLEAR(p->__pyx_v_data_gen);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_header);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_14_restore < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_14_restore[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_14_restore++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_14_restore(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore *)o;
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_data) {
    e = (*v)(p->__pyx_v_data, a); if (e) return e;
  }
  if (p->__pyx_v_data_gen) {
    e = (*v)(p->__pyx_v_data_gen, a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_14_restore},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_14_restore},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_14_restore},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_14_restore",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_14_restore", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_14_restore), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_14_restore, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_14_restore, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_14_restore, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_15_connect[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_15_connect = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_15_connect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_15_connect > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_15_connect[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_15_connect];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_15_connect(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_15_connect) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_handshake_buf);
  Py_CLEAR(p->__pyx_v_k);
  Py_CLEAR(p->__pyx_v_msg_buf);
  Py_CLEAR(p->__pyx_v_params);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_v);
  Py_CLEAR(p->__pyx_v_ver_buf);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_15_connect < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_15_connect[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_15_connect++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_15_connect(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect *)o;
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_handshake_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_handshake_buf), a); if (e) return e;
  }
  if (p->__pyx_v_k) {
    e = (*v)(p->__pyx_v_k, a); if (e) return e;
  }
  if (p->__pyx_v_msg_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_msg_buf), a); if (e) return e;
  }
  if (p->__pyx_v_params) {
    e = (*v)(p->__pyx_v_params, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_v) {
    e = (*v)(p->__pyx_v_v, a); if (e) return e;
  }
  if (p->__pyx_v_ver_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_ver_buf), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_15_connect},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_15_connect},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_15_connect},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_15_connect",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_15_connect", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_15_connect), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_15_connect, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_15_connect, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_15_connect, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_client_final);
  Py_CLEAR(p->__pyx_v_client_first);
  Py_CLEAR(p->__pyx_v_client_first_bare);
  Py_CLEAR(p->__pyx_v_client_nonce);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_expected_server_sig);
  Py_CLEAR(p->__pyx_v_itercount);
  Py_CLEAR(p->__pyx_v_method);
  Py_CLEAR(p->__pyx_v_methods);
  Py_CLEAR(p->__pyx_v_msg_buf);
  Py_CLEAR(p->__pyx_v_salt);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_v_server_final);
  Py_CLEAR(p->__pyx_v_server_first);
  Py_CLEAR(p->__pyx_v_server_nonce);
  Py_CLEAR(p->__pyx_v_server_sig);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl *)o;
  if (p->__pyx_v_client_final) {
    e = (*v)(p->__pyx_v_client_final, a); if (e) return e;
  }
  if (p->__pyx_v_client_first) {
    e = (*v)(p->__pyx_v_client_first, a); if (e) return e;
  }
  if (p->__pyx_v_client_first_bare) {
    e = (*v)(p->__pyx_v_client_first_bare, a); if (e) return e;
  }
  if (p->__pyx_v_client_nonce) {
    e = (*v)(p->__pyx_v_client_nonce, a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_expected_server_sig) {
    e = (*v)(p->__pyx_v_expected_server_sig, a); if (e) return e;
  }
  if (p->__pyx_v_itercount) {
    e = (*v)(p->__pyx_v_itercount, a); if (e) return e;
  }
  if (p->__pyx_v_method) {
    e = (*v)(p->__pyx_v_method, a); if (e) return e;
  }
  if (p->__pyx_v_methods) {
    e = (*v)(p->__pyx_v_methods, a); if (e) return e;
  }
  if (p->__pyx_v_msg_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_msg_buf), a); if (e) return e;
  }
  if (p->__pyx_v_salt) {
    e = (*v)(p->__pyx_v_salt, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  if (p->__pyx_v_server_nonce) {
    e = (*v)(p->__pyx_v_server_nonce, a); if (e) return e;
  }
  if (p->__pyx_v_server_sig) {
    e = (*v)(p->__pyx_v_server_sig, a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_16__auth_sasl",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_16__auth_sasl", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v__);
  Py_CLEAR(p->__pyx_v_allow_capabilities);
  Py_CLEAR(p->__pyx_v_attrs);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_cardinality);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_expect_one);
  Py_CLEAR(p->__pyx_v_implicit_limit);
  Py_CLEAR(p->__pyx_v_in_dc);
  Py_CLEAR(p->__pyx_v_in_type_id);
  Py_CLEAR(p->__pyx_v_inline_typeids);
  Py_CLEAR(p->__pyx_v_inline_typenames);
  Py_CLEAR(p->__pyx_v_methname);
  Py_CLEAR(p->__pyx_v_out_dc);
  Py_CLEAR(p->__pyx_v_out_type_id);
  Py_CLEAR(p->__pyx_v_query);
  Py_CLEAR(p->__pyx_v_reg);
  Py_CLEAR(p->__pyx_v_required_one);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse *)o;
  if (p->__pyx_v__) {
    e = (*v)(p->__pyx_v__, a); if (e) return e;
  }
  if (p->__pyx_v_attrs) {
    e = (*v)(p->__pyx_v_attrs, a); if (e) return e;
  }
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_expect_one) {
    e = (*v)(p->__pyx_v_expect_one, a); if (e) return e;
  }
  if (p->__pyx_v_in_dc) {
    e = (*v)(((PyObject *)p->__pyx_v_in_dc), a); if (e) return e;
  }
  if (p->__pyx_v_inline_typeids) {
    e = (*v)(p->__pyx_v_inline_typeids, a); if (e) return e;
  }
  if (p->__pyx_v_inline_typenames) {
    e = (*v)(p->__pyx_v_inline_typenames, a); if (e) return e;
  }
  if (p->__pyx_v_methname) {
    e = (*v)(p->__pyx_v_methname, a); if (e) return e;
  }
  if (p->__pyx_v_out_dc) {
    e = (*v)(((PyObject *)p->__pyx_v_out_dc), a); if (e) return e;
  }
  if (p->__pyx_v_reg) {
    e = (*v)(((PyObject *)p->__pyx_v_reg), a); if (e) return e;
  }
  if (p->__pyx_v_required_one) {
    e = (*v)(p->__pyx_v_required_one, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_17__legacy_parse",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_17__legacy_parse", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_in_dc);
  Py_CLEAR(p->__pyx_v_kwargs);
  Py_CLEAR(p->__pyx_v_out_dc);
  Py_CLEAR(p->__pyx_v_packet);
  Py_CLEAR(p->__pyx_v_result);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_in_dc) {
    e = (*v)(((PyObject *)p->__pyx_v_in_dc), a); if (e) return e;
  }
  if (p->__pyx_v_kwargs) {
    e = (*v)(p->__pyx_v_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_out_dc) {
    e = (*v)(((PyObject *)p->__pyx_v_out_dc), a); if (e) return e;
  }
  if (p->__pyx_v_packet) {
    e = (*v)(((PyObject *)p->__pyx_v_packet), a); if (e) return e;
  }
  if (p->__pyx_v_result) {
    e = (*v)(p->__pyx_v_result, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_18__legacy_execute",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_18__legacy_execute", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_capabilities);
  Py_CLEAR(p->__pyx_v_ctx);
  Py_CLEAR(p->__pyx_v_ex);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_headers);
  Py_CLEAR(p->__pyx_v_in_dc);
  Py_CLEAR(p->__pyx_v_kwargs);
  Py_CLEAR(p->__pyx_v_methname);
  Py_CLEAR(p->__pyx_v_new_cardinality);
  Py_CLEAR(p->__pyx_v_out_dc);
  Py_CLEAR(p->__pyx_v_packet);
  Py_CLEAR(p->__pyx_v_query);
  Py_CLEAR(p->__pyx_v_reg);
  Py_CLEAR(p->__pyx_v_result);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_capabilities) {
    e = (*v)(p->__pyx_v_capabilities, a); if (e) return e;
  }
  if (p->__pyx_v_ctx) {
    e = (*v)(((PyObject *)p->__pyx_v_ctx), a); if (e) return e;
  }
  if (p->__pyx_v_ex) {
    e = (*v)(p->__pyx_v_ex, a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_headers) {
    e = (*v)(p->__pyx_v_headers, a); if (e) return e;
  }
  if (p->__pyx_v_in_dc) {
    e = (*v)(((PyObject *)p->__pyx_v_in_dc), a); if (e) return e;
  }
  if (p->__pyx_v_kwargs) {
    e = (*v)(p->__pyx_v_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_methname) {
    e = (*v)(p->__pyx_v_methname, a); if (e) return e;
  }
  if (p->__pyx_v_out_dc) {
    e = (*v)(((PyObject *)p->__pyx_v_out_dc), a); if (e) return e;
  }
  if (p->__pyx_v_packet) {
    e = (*v)(((PyObject *)p->__pyx_v_packet), a); if (e) return e;
  }
  if (p->__pyx_v_reg) {
    e = (*v)(((PyObject *)p->__pyx_v_reg), a); if (e) return e;
  }
  if (p->__pyx_v_result) {
    e = (*v)(p->__pyx_v_result, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_19__legacy_optimistic_execute",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_19__legacy_optimistic_execute", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_capabilities);
  Py_CLEAR(p->__pyx_v_cardinality);
  Py_CLEAR(p->__pyx_v_codecs);
  Py_CLEAR(p->__pyx_v_ctx);
  Py_CLEAR(p->__pyx_v_headers);
  Py_CLEAR(p->__pyx_v_in_dc);
  Py_CLEAR(p->__pyx_v_kwargs);
  Py_CLEAR(p->__pyx_v_methname);
  Py_CLEAR(p->__pyx_v_out_dc);
  Py_CLEAR(p->__pyx_v_query);
  Py_CLEAR(p->__pyx_v_reg);
  Py_CLEAR(p->__pyx_v_ret);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_capabilities) {
    e = (*v)(p->__pyx_v_capabilities, a); if (e) return e;
  }
  if (p->__pyx_v_cardinality) {
    e = (*v)(p->__pyx_v_cardinality, a); if (e) return e;
  }
  if (p->__pyx_v_codecs) {
    e = (*v)(p->__pyx_v_codecs, a); if (e) return e;
  }
  if (p->__pyx_v_ctx) {
    e = (*v)(((PyObject *)p->__pyx_v_ctx), a); if (e) return e;
  }
  if (p->__pyx_v_headers) {
    e = (*v)(((PyObject *)p->__pyx_v_headers), a); if (e) return e;
  }
  if (p->__pyx_v_in_dc) {
    e = (*v)(((PyObject *)p->__pyx_v_in_dc), a); if (e) return e;
  }
  if (p->__pyx_v_kwargs) {
    e = (*v)(p->__pyx_v_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_methname) {
    e = (*v)(p->__pyx_v_methname, a); if (e) return e;
  }
  if (p->__pyx_v_out_dc) {
    e = (*v)(((PyObject *)p->__pyx_v_out_dc), a); if (e) return e;
  }
  if (p->__pyx_v_reg) {
    e = (*v)(((PyObject *)p->__pyx_v_reg), a); if (e) return e;
  }
  if (p->__pyx_v_ret) {
    e = (*v)(p->__pyx_v_ret, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_20_legacy_execute_anonymous",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_20_legacy_execute_anonymous", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

#if CYTHON_USE_FREELISTS
static struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query[8];
static int __pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query = 0;
#endif

static PyObject *__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  #if CYTHON_USE_FREELISTS
  if (likely((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query)))) {
    o = (PyObject*)__pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query[--__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query];
    memset(o, 0, sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else
  #endif
  {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  #endif
  return o;
}

static void __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query(PyObject *o) {
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_buf);
  Py_CLEAR(p->__pyx_v_cap_bytes);
  Py_CLEAR(p->__pyx_v_capabilities);
  Py_CLEAR(p->__pyx_v_exc);
  Py_CLEAR(p->__pyx_v_query);
  Py_CLEAR(p->__pyx_v_self);
  #if CYTHON_USE_FREELISTS
  if (((int)(__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query)))) {
    __pyx_freelist_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query[__pyx_freecount_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query++] = ((struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *)o);
  } else
  #endif
  {
    #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
    (*Py_TYPE(o)->tp_free)(o);
    #else
    {
      freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
      if (tp_free) tp_free(o);
    }
    #endif
  }
}

static int __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *p = (struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query *)o;
  if (p->__pyx_v_buf) {
    e = (*v)(((PyObject *)p->__pyx_v_buf), a); if (e) return e;
  }
  if (p->__pyx_v_capabilities) {
    e = (*v)(p->__pyx_v_capabilities, a); if (e) return e;
  }
  if (p->__pyx_v_exc) {
    e = (*v)(p->__pyx_v_exc, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query},
  {Py_tp_new, (void *)__pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query},
  {0, 0},
};
static PyType_Spec __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query_spec = {
  "gel.protocol.protocol.__pyx_scope_struct_21_legacy_simple_query",
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query_slots,
};
#else

static PyTypeObject __pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__pyx_scope_struct_21_legacy_simple_query", /*tp_name*/
  sizeof(struct __pyx_obj_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static int __pyx_tp_traverse___Pyx_EnumMeta(PyObject *o, visitproc v, void *a) {
  int e;
  if (!(&PyType_Type)->tp_traverse); else { e = (&PyType_Type)->tp_traverse(o,v,a); if (e) return e; }
  return 0;
}

static int __pyx_tp_clear___Pyx_EnumMeta(PyObject *o) {
  if (!(&PyType_Type)->tp_clear); else (&PyType_Type)->tp_clear(o);
  return 0;
}
static PyObject *__pyx_sq_item___Pyx_EnumMeta(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods___Pyx_EnumMeta[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __Pyx_EnumMeta_slots[] = {
  {Py_sq_item, (void *)__pyx_sq_item___Pyx_EnumMeta},
  {Py_mp_subscript, (void *)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse___Pyx_EnumMeta},
  {Py_tp_clear, (void *)__pyx_tp_clear___Pyx_EnumMeta},
  {Py_tp_iter, (void *)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__},
  {Py_tp_methods, (void *)__pyx_methods___Pyx_EnumMeta},
  {Py_tp_init, (void *)__pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__},
  {0, 0},
};
static PyType_Spec __Pyx_EnumMeta_spec = {
  "gel.protocol.protocol.__Pyx_EnumMeta",
  sizeof(struct __pyx_obj___Pyx_EnumMeta),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
  __Pyx_EnumMeta_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence___Pyx_EnumMeta = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item___Pyx_EnumMeta, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___Pyx_EnumMeta = {
  0, /*mp_length*/
  __pyx_pw_8EnumBase_14__Pyx_EnumMeta_5__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __Pyx_EnumMeta = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""__Pyx_EnumMeta", /*tp_name*/
  sizeof(struct __pyx_obj___Pyx_EnumMeta), /*tp_basicsize*/
  0, /*tp_itemsize*/
  0, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___Pyx_EnumMeta, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___Pyx_EnumMeta, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse___Pyx_EnumMeta, /*tp_traverse*/
  __pyx_tp_clear___Pyx_EnumMeta, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_8EnumBase_14__Pyx_EnumMeta_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods___Pyx_EnumMeta, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_8EnumBase_14__Pyx_EnumMeta_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  0, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_array __pyx_vtable_array;

static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_array_obj *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_array_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_array;
  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_array(PyObject *o) {
  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_array___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->mode);
  Py_CLEAR(p->_format);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}
static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_array___setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_array___getattr__(o, n);
  }
  return v;
}

static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}

static PyMethodDef __pyx_methods_array[] = {
  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_array[] = {
  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_array = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type___pyx_array_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
  {Py_sq_length, (void *)__pyx_array___len__},
  {Py_sq_item, (void *)__pyx_sq_item_array},
  {Py_mp_length, (void *)__pyx_array___len__},
  {Py_mp_subscript, (void *)__pyx_array___getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
  {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
  #endif
  {Py_tp_methods, (void *)__pyx_methods_array},
  {Py_tp_getset, (void *)__pyx_getsets_array},
  {Py_tp_new, (void *)__pyx_tp_new_array},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_array_spec = {
  "gel.protocol.protocol.array",
  sizeof(struct __pyx_array_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
  __pyx_type___pyx_array_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_array = {
  __pyx_array___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_array, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_array = {
  __pyx_array___len__, /*mp_length*/
  __pyx_array___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_array = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_array_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_array = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""array", /*tp_name*/
  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_array, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_array, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_array, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_array, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_array, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_MemviewEnum_obj *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_MemviewEnum_obj *)o);
  p->name = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_Enum(PyObject *o) {
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->name);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_Enum(PyObject *o) {
  PyObject* tmp;
  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
  tmp = ((PyObject*)p->name);
  p->name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  return __pyx_MemviewEnum___repr__(self);
}

static PyMethodDef __pyx_methods_Enum[] = {
  {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
  {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
  {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
  {Py_tp_methods, (void *)__pyx_methods_Enum},
  {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
  {Py_tp_new, (void *)__pyx_tp_new_Enum},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
  "gel.protocol.protocol.Enum",
  sizeof(struct __pyx_MemviewEnum_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type___pyx_MemviewEnum_slots,
};
#else

static PyTypeObject __pyx_type___pyx_MemviewEnum = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""Enum", /*tp_name*/
  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_MemviewEnum___repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_Enum, /*tp_traverse*/
  __pyx_tp_clear_Enum, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_Enum, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_MemviewEnum___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_Enum, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;

static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryview_obj *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_memoryview_obj *)o);
  p->__pyx_vtab = __pyx_vtabptr_memoryview;
  p->obj = Py_None; Py_INCREF(Py_None);
  p->_size = Py_None; Py_INCREF(Py_None);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  p->view.obj = NULL;
  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_memoryview(PyObject *o) {
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_memoryview___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->obj);
  Py_CLEAR(p->_size);
  Py_CLEAR(p->_array_interface);
  #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  if (p->obj) {
    e = (*v)(p->obj, a); if (e) return e;
  }
  if (p->_size) {
    e = (*v)(p->_size, a); if (e) return e;
  }
  if (p->_array_interface) {
    e = (*v)(p->_array_interface, a); if (e) return e;
  }
  if (p->view.obj) {
    e = (*v)(p->view.obj, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_memoryview(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
  tmp = ((PyObject*)p->obj);
  p->obj = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_size);
  p->_size = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_array_interface);
  p->_array_interface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  Py_CLEAR(p->view.obj);
  return 0;
}
static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_memoryview___setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}

static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}

static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  return __pyx_memoryview___repr__(self);
}

static PyMethodDef __pyx_methods_memoryview[] = {
  {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0},
  {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_memoryview[] = {
  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
#if !CYTHON_COMPILING_IN_LIMITED_API

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};
#endif
static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
  {Py_tp_repr, (void *)__pyx_memoryview___repr__},
  {Py_sq_length, (void *)__pyx_memoryview___len__},
  {Py_sq_item, (void *)__pyx_sq_item_memoryview},
  {Py_mp_length, (void *)__pyx_memoryview___len__},
  {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
  {Py_tp_str, (void *)__pyx_memoryview___str__},
  #if defined(Py_bf_getbuffer)
  {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
  #endif
  {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
  {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
  {Py_tp_methods, (void *)__pyx_methods_memoryview},
  {Py_tp_getset, (void *)__pyx_getsets_memoryview},
  {Py_tp_new, (void *)__pyx_tp_new_memoryview},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_memoryview_spec = {
  "gel.protocol.protocol.memoryview",
  sizeof(struct __pyx_memoryview_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type___pyx_memoryview_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
  __pyx_memoryview___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_memoryview, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
  __pyx_memoryview___len__, /*mp_length*/
  __pyx_memoryview___getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
  0, /*bf_releasebuffer*/
};

static PyTypeObject __pyx_type___pyx_memoryview = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""memoryview", /*tp_name*/
  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_memoryview___repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_memoryview___str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_memoryview, /*tp_traverse*/
  __pyx_tp_clear_memoryview, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_memoryview, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_memoryview, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_memoryview, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;

static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_memoryviewslice_obj *p;
  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_memoryviewslice_obj *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
  p->from_object = Py_None; Py_INCREF(Py_None);
  p->from_slice.memview = NULL;
  return o;
}

static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
    __pyx_memoryviewslice___dealloc__(o);
    __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->from_object);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_memoryview(o);
}

static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
  if (p->from_object) {
    e = (*v)(p->from_object, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
  PyObject* tmp;
  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
  __pyx_tp_clear_memoryview(o);
  tmp = ((PyObject*)p->from_object);
  p->from_object = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
  return 0;
}

static PyMethodDef __pyx_methods__memoryviewslice[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
  {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
  {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
  {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
  {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
  {0, 0},
};
static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
  "gel.protocol.protocol._memoryviewslice",
  sizeof(struct __pyx_memoryviewslice_obj),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
  __pyx_type___pyx_memoryviewslice_slots,
};
#else

static PyTypeObject __pyx_type___pyx_memoryviewslice = {
  PyVarObject_HEAD_INIT(0, 0)
  "gel.protocol.protocol.""_memoryviewslice", /*tp_name*/
  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_memoryview___repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_memoryview___str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
  PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods__memoryviewslice, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new__memoryviewslice, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#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
/* #### Code section: pystring_table ### */

static int __Pyx_CreateStringTabAndInitStrings(void) {
  __Pyx_StringTabEntry __pyx_string_tab[] = {
    {&__pyx_kp_b_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 0, 0},
    {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
    {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
    {&__pyx_kp_u_0000, __pyx_k_0000, sizeof(__pyx_k_0000), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000, __pyx_k_00000000_0000_0000_0000_00000000, sizeof(__pyx_k_00000000_0000_0000_0000_00000000), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_10, __pyx_k_00000000_0000_0000_0000_00000000_10, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_10), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_11, __pyx_k_00000000_0000_0000_0000_00000000_11, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_11), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_12, __pyx_k_00000000_0000_0000_0000_00000000_12, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_12), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_13, __pyx_k_00000000_0000_0000_0000_00000000_13, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_13), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_14, __pyx_k_00000000_0000_0000_0000_00000000_14, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_14), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_15, __pyx_k_00000000_0000_0000_0000_00000000_15, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_15), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_16, __pyx_k_00000000_0000_0000_0000_00000000_16, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_16), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_17, __pyx_k_00000000_0000_0000_0000_00000000_17, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_17), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_18, __pyx_k_00000000_0000_0000_0000_00000000_18, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_18), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_19, __pyx_k_00000000_0000_0000_0000_00000000_19, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_19), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_2, __pyx_k_00000000_0000_0000_0000_00000000_2, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_2), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_20, __pyx_k_00000000_0000_0000_0000_00000000_20, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_20), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_21, __pyx_k_00000000_0000_0000_0000_00000000_21, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_21), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_22, __pyx_k_00000000_0000_0000_0000_00000000_22, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_22), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_23, __pyx_k_00000000_0000_0000_0000_00000000_23, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_23), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_24, __pyx_k_00000000_0000_0000_0000_00000000_24, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_24), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_25, __pyx_k_00000000_0000_0000_0000_00000000_25, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_25), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_3, __pyx_k_00000000_0000_0000_0000_00000000_3, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_3), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_4, __pyx_k_00000000_0000_0000_0000_00000000_4, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_4), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_5, __pyx_k_00000000_0000_0000_0000_00000000_5, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_5), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_6, __pyx_k_00000000_0000_0000_0000_00000000_6, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_6), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_7, __pyx_k_00000000_0000_0000_0000_00000000_7, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_7), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_8, __pyx_k_00000000_0000_0000_0000_00000000_8, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_8), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000000_9, __pyx_k_00000000_0000_0000_0000_00000000_9, sizeof(__pyx_k_00000000_0000_0000_0000_00000000_9), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000100, __pyx_k_00000000_0000_0000_0000_00000100, sizeof(__pyx_k_00000000_0000_0000_0000_00000100), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000100_2, __pyx_k_00000000_0000_0000_0000_00000100_2, sizeof(__pyx_k_00000000_0000_0000_0000_00000100_2), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000100_3, __pyx_k_00000000_0000_0000_0000_00000100_3, sizeof(__pyx_k_00000000_0000_0000_0000_00000100_3), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000100_4, __pyx_k_00000000_0000_0000_0000_00000100_4, sizeof(__pyx_k_00000000_0000_0000_0000_00000100_4), 0, 1, 0, 0},
    {&__pyx_kp_u_00000000_0000_0000_0000_00000100_5, __pyx_k_00000000_0000_0000_0000_00000100_5, sizeof(__pyx_k_00000000_0000_0000_0000_00000100_5), 0, 1, 0, 0},
    {&__pyx_kp_u_003e434d_cac2_430a_b238_fb39d734, __pyx_k_003e434d_cac2_430a_b238_fb39d734, sizeof(__pyx_k_003e434d_cac2_430a_b238_fb39d734), 0, 1, 0, 0},
    {&__pyx_kp_u_44c901c0_d922_4894_83c8_061bd05e, __pyx_k_44c901c0_d922_4894_83c8_061bd05e, sizeof(__pyx_k_44c901c0_d922_4894_83c8_061bd05e), 0, 1, 0, 0},
    {&__pyx_kp_u_4ba84534_188e_43b4_a7ce_cea2af0f, __pyx_k_4ba84534_188e_43b4_a7ce_cea2af0f, sizeof(__pyx_k_4ba84534_188e_43b4_a7ce_cea2af0f), 0, 1, 0, 0},
    {&__pyx_kp_u_4d738878_3a5f_4821_ab76_9d8e7d6b, __pyx_k_4d738878_3a5f_4821_ab76_9d8e7d6b, sizeof(__pyx_k_4d738878_3a5f_4821_ab76_9d8e7d6b), 0, 1, 0, 0},
    {&__pyx_kp_u_7fae5536_6311_4f60_8eb9_096a5d97, __pyx_k_7fae5536_6311_4f60_8eb9_096a5d97, sizeof(__pyx_k_7fae5536_6311_4f60_8eb9_096a5d97), 0, 1, 0, 0},
    {&__pyx_kp_u_9565dd88_04f5_11ee_a691_0b6ebe17, __pyx_k_9565dd88_04f5_11ee_a691_0b6ebe17, sizeof(__pyx_k_9565dd88_04f5_11ee_a691_0b6ebe17), 0, 1, 0, 0},
    {&__pyx_n_s_ALL, __pyx_k_ALL, sizeof(__pyx_k_ALL), 0, 0, 1, 1},
    {&__pyx_n_s_ALL_CAPABILITIES, __pyx_k_ALL_CAPABILITIES, sizeof(__pyx_k_ALL_CAPABILITIES), 0, 0, 1, 1},
    {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
    {&__pyx_n_s_AT_LEAST_ONE, __pyx_k_AT_LEAST_ONE, sizeof(__pyx_k_AT_LEAST_ONE), 0, 0, 1, 1},
    {&__pyx_n_s_AT_MOST_ONE, __pyx_k_AT_MOST_ONE, sizeof(__pyx_k_AT_MOST_ONE), 0, 0, 1, 1},
    {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0},
    {&__pyx_n_u_Array, __pyx_k_Array, sizeof(__pyx_k_Array), 0, 1, 0, 1},
    {&__pyx_n_s_ArrayCodec, __pyx_k_ArrayCodec, sizeof(__pyx_k_ArrayCodec), 0, 0, 1, 1},
    {&__pyx_n_s_ArrayCodec___reduce_cython, __pyx_k_ArrayCodec___reduce_cython, sizeof(__pyx_k_ArrayCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ArrayCodec___setstate_cython, __pyx_k_ArrayCodec___setstate_cython, sizeof(__pyx_k_ArrayCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ArrayCodec_make_type, __pyx_k_ArrayCodec_make_type, sizeof(__pyx_k_ArrayCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_ArrayType, __pyx_k_ArrayType, sizeof(__pyx_k_ArrayType), 0, 0, 1, 1},
    {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
    {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
    {&__pyx_n_s_BINARY, __pyx_k_BINARY, sizeof(__pyx_k_BINARY), 0, 0, 1, 1},
    {&__pyx_n_s_BaseArrayCodec, __pyx_k_BaseArrayCodec, sizeof(__pyx_k_BaseArrayCodec), 0, 0, 1, 1},
    {&__pyx_n_s_BaseArrayCodec___reduce_cython, __pyx_k_BaseArrayCodec___reduce_cython, sizeof(__pyx_k_BaseArrayCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_BaseArrayCodec___setstate_cython, __pyx_k_BaseArrayCodec___setstate_cython, sizeof(__pyx_k_BaseArrayCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_BaseCodec, __pyx_k_BaseCodec, sizeof(__pyx_k_BaseCodec), 0, 0, 1, 1},
    {&__pyx_n_s_BaseCodec___reduce_cython, __pyx_k_BaseCodec___reduce_cython, sizeof(__pyx_k_BaseCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_BaseCodec___setstate_cython, __pyx_k_BaseCodec___setstate_cython, sizeof(__pyx_k_BaseCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_BaseCodec_make_type, __pyx_k_BaseCodec_make_type, sizeof(__pyx_k_BaseCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_BaseNamedRecordCodec, __pyx_k_BaseNamedRecordCodec, sizeof(__pyx_k_BaseNamedRecordCodec), 0, 0, 1, 1},
    {&__pyx_n_s_BaseNamedRecordCodec___reduce_cy, __pyx_k_BaseNamedRecordCodec___reduce_cy, sizeof(__pyx_k_BaseNamedRecordCodec___reduce_cy), 0, 0, 1, 1},
    {&__pyx_n_s_BaseNamedRecordCodec___setstate, __pyx_k_BaseNamedRecordCodec___setstate, sizeof(__pyx_k_BaseNamedRecordCodec___setstate), 0, 0, 1, 1},
    {&__pyx_n_s_BaseRecordCodec, __pyx_k_BaseRecordCodec, sizeof(__pyx_k_BaseRecordCodec), 0, 0, 1, 1},
    {&__pyx_n_s_BaseRecordCodec___reduce_cython, __pyx_k_BaseRecordCodec___reduce_cython, sizeof(__pyx_k_BaseRecordCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_BaseRecordCodec___setstate_cytho, __pyx_k_BaseRecordCodec___setstate_cytho, sizeof(__pyx_k_BaseRecordCodec___setstate_cytho), 0, 0, 1, 1},
    {&__pyx_n_s_BaseScalarType, __pyx_k_BaseScalarType, sizeof(__pyx_k_BaseScalarType), 0, 0, 1, 1},
    {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
    {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
    {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
    {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
    {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0},
    {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0},
    {&__pyx_n_s_Capability, __pyx_k_Capability, sizeof(__pyx_k_Capability), 0, 0, 1, 1},
    {&__pyx_n_s_Cardinality, __pyx_k_Cardinality, sizeof(__pyx_k_Cardinality), 0, 0, 1, 1},
    {&__pyx_n_s_ClientConnectionClosedError, __pyx_k_ClientConnectionClosedError, sizeof(__pyx_k_ClientConnectionClosedError), 0, 0, 1, 1},
    {&__pyx_n_s_ClientConnectionError, __pyx_k_ClientConnectionError, sizeof(__pyx_k_ClientConnectionError), 0, 0, 1, 1},
    {&__pyx_n_s_ClientError, __pyx_k_ClientError, sizeof(__pyx_k_ClientError), 0, 0, 1, 1},
    {&__pyx_n_s_CodecPythonOverride, __pyx_k_CodecPythonOverride, sizeof(__pyx_k_CodecPythonOverride), 0, 0, 1, 1},
    {&__pyx_n_s_CodecPythonOverride___reduce_cyt, __pyx_k_CodecPythonOverride___reduce_cyt, sizeof(__pyx_k_CodecPythonOverride___reduce_cyt), 0, 0, 1, 1},
    {&__pyx_n_s_CodecPythonOverride___setstate_c, __pyx_k_CodecPythonOverride___setstate_c, sizeof(__pyx_k_CodecPythonOverride___setstate_c), 0, 0, 1, 1},
    {&__pyx_n_s_CodecPythonOverride_make_type, __pyx_k_CodecPythonOverride_make_type, sizeof(__pyx_k_CodecPythonOverride_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_CodecsRegistry, __pyx_k_CodecsRegistry, sizeof(__pyx_k_CodecsRegistry), 0, 0, 1, 1},
    {&__pyx_n_s_CodecsRegistry___reduce_cython, __pyx_k_CodecsRegistry___reduce_cython, sizeof(__pyx_k_CodecsRegistry___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_CodecsRegistry___setstate_cython, __pyx_k_CodecsRegistry___setstate_cython, sizeof(__pyx_k_CodecsRegistry___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_CodecsRegistry_clear_cache, __pyx_k_CodecsRegistry_clear_cache, sizeof(__pyx_k_CodecsRegistry_clear_cache), 0, 0, 1, 1},
    {&__pyx_n_s_CodecsRegistry_set_type_codec, __pyx_k_CodecsRegistry_set_type_codec, sizeof(__pyx_k_CodecsRegistry_set_type_codec), 0, 0, 1, 1},
    {&__pyx_n_s_CompilationFlag, __pyx_k_CompilationFlag, sizeof(__pyx_k_CompilationFlag), 0, 0, 1, 1},
    {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1},
    {&__pyx_n_u_DerivedEnumValue, __pyx_k_DerivedEnumValue, sizeof(__pyx_k_DerivedEnumValue), 0, 1, 0, 1},
    {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0},
    {&__pyx_n_s_EDGEQL, __pyx_k_EDGEQL, sizeof(__pyx_k_EDGEQL), 0, 0, 1, 1},
    {&__pyx_n_s_EDGE_POINTER_IS_LINKPROP, __pyx_k_EDGE_POINTER_IS_LINKPROP, sizeof(__pyx_k_EDGE_POINTER_IS_LINKPROP), 0, 0, 1, 1},
    {&__pyx_n_s_EMPTY_NULL_DATA, __pyx_k_EMPTY_NULL_DATA, sizeof(__pyx_k_EMPTY_NULL_DATA), 0, 0, 1, 1},
    {&__pyx_n_s_EMPTY_RECORD_DATA, __pyx_k_EMPTY_RECORD_DATA, sizeof(__pyx_k_EMPTY_RECORD_DATA), 0, 0, 1, 1},
    {&__pyx_n_s_EdegDBCodecContext, __pyx_k_EdegDBCodecContext, sizeof(__pyx_k_EdegDBCodecContext), 0, 0, 1, 1},
    {&__pyx_n_s_EdegDBCodecContext___reduce_cyth, __pyx_k_EdegDBCodecContext___reduce_cyth, sizeof(__pyx_k_EdegDBCodecContext___reduce_cyth), 0, 0, 1, 1},
    {&__pyx_n_s_EdegDBCodecContext___setstate_cy, __pyx_k_EdegDBCodecContext___setstate_cy, sizeof(__pyx_k_EdegDBCodecContext___setstate_cy), 0, 0, 1, 1},
    {&__pyx_n_s_EdegDBCodecContext_get_text_code, __pyx_k_EdegDBCodecContext_get_text_code, sizeof(__pyx_k_EdegDBCodecContext_get_text_code), 0, 0, 1, 1},
    {&__pyx_n_s_EdgeDBError, __pyx_k_EdgeDBError, sizeof(__pyx_k_EdgeDBError), 0, 0, 1, 1},
    {&__pyx_n_s_EdgeDBMessage, __pyx_k_EdgeDBMessage, sizeof(__pyx_k_EdgeDBMessage), 0, 0, 1, 1},
    {&__pyx_n_s_Element, __pyx_k_Element, sizeof(__pyx_k_Element), 0, 0, 1, 1},
    {&__pyx_n_s_ElementKind, __pyx_k_ElementKind, sizeof(__pyx_k_ElementKind), 0, 0, 1, 1},
    {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
    {&__pyx_n_s_EmptyTupleCodec, __pyx_k_EmptyTupleCodec, sizeof(__pyx_k_EmptyTupleCodec), 0, 0, 1, 1},
    {&__pyx_n_s_EmptyTupleCodec___reduce_cython, __pyx_k_EmptyTupleCodec___reduce_cython, sizeof(__pyx_k_EmptyTupleCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_EmptyTupleCodec___setstate_cytho, __pyx_k_EmptyTupleCodec___setstate_cytho, sizeof(__pyx_k_EmptyTupleCodec___setstate_cytho), 0, 0, 1, 1},
    {&__pyx_n_s_EmptyTupleCodec_make_type, __pyx_k_EmptyTupleCodec_make_type, sizeof(__pyx_k_EmptyTupleCodec_make_type), 0, 0, 1, 1},
    {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
    {&__pyx_n_u_Enum, __pyx_k_Enum, sizeof(__pyx_k_Enum), 0, 1, 0, 1},
    {&__pyx_n_s_EnumBase, __pyx_k_EnumBase, sizeof(__pyx_k_EnumBase), 0, 0, 1, 1},
    {&__pyx_n_s_EnumCodec, __pyx_k_EnumCodec, sizeof(__pyx_k_EnumCodec), 0, 0, 1, 1},
    {&__pyx_n_s_EnumCodec___reduce_cython, __pyx_k_EnumCodec___reduce_cython, sizeof(__pyx_k_EnumCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_EnumCodec___setstate_cython, __pyx_k_EnumCodec___setstate_cython, sizeof(__pyx_k_EnumCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_EnumCodec_make_type, __pyx_k_EnumCodec_make_type, sizeof(__pyx_k_EnumCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_EnumMeta, __pyx_k_EnumMeta, sizeof(__pyx_k_EnumMeta), 0, 0, 1, 1},
    {&__pyx_n_s_EnumType, __pyx_k_EnumType, sizeof(__pyx_k_EnumType), 0, 0, 1, 1},
    {&__pyx_n_s_EnumValue, __pyx_k_EnumValue, sizeof(__pyx_k_EnumValue), 0, 0, 1, 1},
    {&__pyx_n_s_ExecuteContext, __pyx_k_ExecuteContext, sizeof(__pyx_k_ExecuteContext), 0, 0, 1, 1},
    {&__pyx_n_s_ExecuteContext___reduce_cython, __pyx_k_ExecuteContext___reduce_cython, sizeof(__pyx_k_ExecuteContext___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ExecuteContext___setstate_cython, __pyx_k_ExecuteContext___setstate_cython, sizeof(__pyx_k_ExecuteContext___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_FIELD, __pyx_k_FIELD, sizeof(__pyx_k_FIELD), 0, 0, 1, 1},
    {&__pyx_n_u_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 1, 0, 1},
    {&__pyx_n_s_INJECT_OUTPUT_OBJECT_IDS, __pyx_k_INJECT_OUTPUT_OBJECT_IDS, sizeof(__pyx_k_INJECT_OUTPUT_OBJECT_IDS), 0, 0, 1, 1},
    {&__pyx_n_s_INJECT_OUTPUT_TYPE_IDS, __pyx_k_INJECT_OUTPUT_TYPE_IDS, sizeof(__pyx_k_INJECT_OUTPUT_TYPE_IDS), 0, 0, 1, 1},
    {&__pyx_n_s_INJECT_OUTPUT_TYPE_NAMES, __pyx_k_INJECT_OUTPUT_TYPE_NAMES, sizeof(__pyx_k_INJECT_OUTPUT_TYPE_NAMES), 0, 0, 1, 1},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_k_Incompatible_checksums_0x_x_vs_0_2, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 0, 1, 0},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_3, __pyx_k_Incompatible_checksums_0x_x_vs_0_3, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_3), 0, 0, 1, 0},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_4, __pyx_k_Incompatible_checksums_0x_x_vs_0_4, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_4), 0, 0, 1, 0},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_5, __pyx_k_Incompatible_checksums_0x_x_vs_0_5, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_5), 0, 0, 1, 0},
    {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_6, __pyx_k_Incompatible_checksums_0x_x_vs_0_6, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_6), 0, 0, 1, 0},
    {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
    {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0},
    {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
    {&__pyx_n_s_InputLanguage, __pyx_k_InputLanguage, sizeof(__pyx_k_InputLanguage), 0, 0, 1, 1},
    {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1},
    {&__pyx_n_s_IntFlag, __pyx_k_IntFlag, sizeof(__pyx_k_IntFlag), 0, 0, 1, 1},
    {&__pyx_n_s_InterfaceError, __pyx_k_InterfaceError, sizeof(__pyx_k_InterfaceError), 0, 0, 1, 1},
    {&__pyx_n_s_InvalidArgumentError, __pyx_k_InvalidArgumentError, sizeof(__pyx_k_InvalidArgumentError), 0, 0, 1, 1},
    {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0},
    {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0},
    {&__pyx_n_s_Iterable, __pyx_k_Iterable, sizeof(__pyx_k_Iterable), 0, 0, 1, 1},
    {&__pyx_n_s_IterableABC, __pyx_k_IterableABC, sizeof(__pyx_k_IterableABC), 0, 0, 1, 1},
    {&__pyx_n_s_JSON, __pyx_k_JSON, sizeof(__pyx_k_JSON), 0, 0, 1, 1},
    {&__pyx_n_s_JSON_ELEMENTS, __pyx_k_JSON_ELEMENTS, sizeof(__pyx_k_JSON_ELEMENTS), 0, 0, 1, 1},
    {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
    {&__pyx_n_s_LINK, __pyx_k_LINK, sizeof(__pyx_k_LINK), 0, 0, 1, 1},
    {&__pyx_n_s_LINK_PROPERTY, __pyx_k_LINK_PROPERTY, sizeof(__pyx_k_LINK_PROPERTY), 0, 0, 1, 1},
    {&__pyx_n_s_LRUMapping, __pyx_k_LRUMapping, sizeof(__pyx_k_LRUMapping), 0, 0, 1, 1},
    {&__pyx_n_s_LRUMapping___reduce_cython, __pyx_k_LRUMapping___reduce_cython, sizeof(__pyx_k_LRUMapping___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_LRUMapping___setstate_cython, __pyx_k_LRUMapping___setstate_cython, sizeof(__pyx_k_LRUMapping___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_LRUMapping_clear, __pyx_k_LRUMapping_clear, sizeof(__pyx_k_LRUMapping_clear), 0, 0, 1, 1},
    {&__pyx_n_s_LookupError, __pyx_k_LookupError, sizeof(__pyx_k_LookupError), 0, 0, 1, 1},
    {&__pyx_n_s_MANY, __pyx_k_MANY, sizeof(__pyx_k_MANY), 0, 0, 1, 1},
    {&__pyx_n_s_Mapping, __pyx_k_Mapping, sizeof(__pyx_k_Mapping), 0, 0, 1, 1},
    {&__pyx_n_s_MappingABC, __pyx_k_MappingABC, sizeof(__pyx_k_MappingABC), 0, 0, 1, 1},
    {&__pyx_n_s_MappingProxyType, __pyx_k_MappingProxyType, sizeof(__pyx_k_MappingProxyType), 0, 0, 1, 1},
    {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
    {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
    {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
    {&__pyx_n_s_MultiRange, __pyx_k_MultiRange, sizeof(__pyx_k_MultiRange), 0, 0, 1, 1},
    {&__pyx_n_u_MultiRange, __pyx_k_MultiRange, sizeof(__pyx_k_MultiRange), 0, 1, 0, 1},
    {&__pyx_n_s_MultiRangeCodec, __pyx_k_MultiRangeCodec, sizeof(__pyx_k_MultiRangeCodec), 0, 0, 1, 1},
    {&__pyx_n_s_MultiRangeCodec___reduce_cython, __pyx_k_MultiRangeCodec___reduce_cython, sizeof(__pyx_k_MultiRangeCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_MultiRangeCodec___setstate_cytho, __pyx_k_MultiRangeCodec___setstate_cytho, sizeof(__pyx_k_MultiRangeCodec___setstate_cytho), 0, 0, 1, 1},
    {&__pyx_n_s_MultiRangeCodec_make_type, __pyx_k_MultiRangeCodec_make_type, sizeof(__pyx_k_MultiRangeCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_MultiRangeType, __pyx_k_MultiRangeType, sizeof(__pyx_k_MultiRangeType), 0, 0, 1, 1},
    {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1},
    {&__pyx_n_s_NO_RESULT, __pyx_k_NO_RESULT, sizeof(__pyx_k_NO_RESULT), 0, 0, 1, 1},
    {&__pyx_n_u_NamedTuple, __pyx_k_NamedTuple, sizeof(__pyx_k_NamedTuple), 0, 1, 0, 1},
    {&__pyx_n_s_NamedTupleCodec, __pyx_k_NamedTupleCodec, sizeof(__pyx_k_NamedTupleCodec), 0, 0, 1, 1},
    {&__pyx_n_s_NamedTupleCodec___reduce_cython, __pyx_k_NamedTupleCodec___reduce_cython, sizeof(__pyx_k_NamedTupleCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_NamedTupleCodec___setstate_cytho, __pyx_k_NamedTupleCodec___setstate_cytho, sizeof(__pyx_k_NamedTupleCodec___setstate_cytho), 0, 0, 1, 1},
    {&__pyx_n_s_NamedTupleCodec_make_type, __pyx_k_NamedTupleCodec_make_type, sizeof(__pyx_k_NamedTupleCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_NamedTupleType, __pyx_k_NamedTupleType, sizeof(__pyx_k_NamedTupleType), 0, 0, 1, 1},
    {&__pyx_n_s_NoDataError, __pyx_k_NoDataError, sizeof(__pyx_k_NoDataError), 0, 0, 1, 1},
    {&__pyx_kp_u_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 1, 0, 0},
    {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
    {&__pyx_n_s_NullCodec, __pyx_k_NullCodec, sizeof(__pyx_k_NullCodec), 0, 0, 1, 1},
    {&__pyx_n_s_NullCodec___reduce_cython, __pyx_k_NullCodec___reduce_cython, sizeof(__pyx_k_NullCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_NullCodec___setstate_cython, __pyx_k_NullCodec___setstate_cython, sizeof(__pyx_k_NullCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_NullCodec_make_type, __pyx_k_NullCodec_make_type, sizeof(__pyx_k_NullCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
    {&__pyx_n_s_ONE, __pyx_k_ONE, sizeof(__pyx_k_ONE), 0, 0, 1, 1},
    {&__pyx_n_u_Object, __pyx_k_Object, sizeof(__pyx_k_Object), 0, 1, 0, 1},
    {&__pyx_n_s_ObjectCodec, __pyx_k_ObjectCodec, sizeof(__pyx_k_ObjectCodec), 0, 0, 1, 1},
    {&__pyx_n_s_ObjectCodec___reduce_cython, __pyx_k_ObjectCodec___reduce_cython, sizeof(__pyx_k_ObjectCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ObjectCodec___setstate_cython, __pyx_k_ObjectCodec___setstate_cython, sizeof(__pyx_k_ObjectCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ObjectCodec__make_missing_args_e, __pyx_k_ObjectCodec__make_missing_args_e, sizeof(__pyx_k_ObjectCodec__make_missing_args_e), 0, 0, 1, 1},
    {&__pyx_n_s_ObjectCodec_get_dataclass_fields, __pyx_k_ObjectCodec_get_dataclass_fields, sizeof(__pyx_k_ObjectCodec_get_dataclass_fields), 0, 0, 1, 1},
    {&__pyx_n_s_ObjectCodec_make_type, __pyx_k_ObjectCodec_make_type, sizeof(__pyx_k_ObjectCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_ObjectType, __pyx_k_ObjectType, sizeof(__pyx_k_ObjectType), 0, 0, 1, 1},
    {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1},
    {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0},
    {&__pyx_n_s_OutputFormat, __pyx_k_OutputFormat, sizeof(__pyx_k_OutputFormat), 0, 0, 1, 1},
    {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
    {&__pyx_n_s_PROPERTY, __pyx_k_PROPERTY, sizeof(__pyx_k_PROPERTY), 0, 0, 1, 1},
    {&__pyx_n_s_ParameterTypeMismatchError, __pyx_k_ParameterTypeMismatchError, sizeof(__pyx_k_ParameterTypeMismatchError), 0, 0, 1, 1},
    {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
    {&__pyx_n_s_ProtocolError, __pyx_k_ProtocolError, sizeof(__pyx_k_ProtocolError), 0, 0, 1, 1},
    {&__pyx_kp_u_Python_override, __pyx_k_Python_override, sizeof(__pyx_k_Python_override), 0, 1, 0, 0},
    {&__pyx_n_s_Pyx_EnumBase, __pyx_k_Pyx_EnumBase, sizeof(__pyx_k_Pyx_EnumBase), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_EnumBase___new, __pyx_k_Pyx_EnumBase___new, sizeof(__pyx_k_Pyx_EnumBase___new), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_EnumBase___repr, __pyx_k_Pyx_EnumBase___repr, sizeof(__pyx_k_Pyx_EnumBase___repr), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_EnumBase___str, __pyx_k_Pyx_EnumBase___str, sizeof(__pyx_k_Pyx_EnumBase___str), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_EnumMeta___reduce_cython, __pyx_k_Pyx_EnumMeta___reduce_cython, sizeof(__pyx_k_Pyx_EnumMeta___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_EnumMeta___setstate_cython, __pyx_k_Pyx_EnumMeta___setstate_cython, sizeof(__pyx_k_Pyx_EnumMeta___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_FlagBase, __pyx_k_Pyx_FlagBase, sizeof(__pyx_k_Pyx_FlagBase), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_FlagBase___new, __pyx_k_Pyx_FlagBase___new, sizeof(__pyx_k_Pyx_FlagBase___new), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_FlagBase___repr, __pyx_k_Pyx_FlagBase___repr, sizeof(__pyx_k_Pyx_FlagBase___repr), 0, 0, 1, 1},
    {&__pyx_n_s_Pyx_FlagBase___str, __pyx_k_Pyx_FlagBase___str, sizeof(__pyx_k_Pyx_FlagBase___str), 0, 0, 1, 1},
    {&__pyx_n_s_QUERY_SINGLE_METHOD, __pyx_k_QUERY_SINGLE_METHOD, sizeof(__pyx_k_QUERY_SINGLE_METHOD), 0, 0, 1, 1},
    {&__pyx_n_s_QueryArgumentError, __pyx_k_QueryArgumentError, sizeof(__pyx_k_QueryArgumentError), 0, 0, 1, 1},
    {&__pyx_n_s_Range, __pyx_k_Range, sizeof(__pyx_k_Range), 0, 0, 1, 1},
    {&__pyx_n_u_Range, __pyx_k_Range, sizeof(__pyx_k_Range), 0, 1, 0, 1},
    {&__pyx_n_s_RangeCodec, __pyx_k_RangeCodec, sizeof(__pyx_k_RangeCodec), 0, 0, 1, 1},
    {&__pyx_n_s_RangeCodec___reduce_cython, __pyx_k_RangeCodec___reduce_cython, sizeof(__pyx_k_RangeCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_RangeCodec___setstate_cython, __pyx_k_RangeCodec___setstate_cython, sizeof(__pyx_k_RangeCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_RangeCodec_make_type, __pyx_k_RangeCodec_make_type, sizeof(__pyx_k_RangeCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_RangeType, __pyx_k_RangeType, sizeof(__pyx_k_RangeType), 0, 0, 1, 1},
    {&__pyx_n_u_Record, __pyx_k_Record, sizeof(__pyx_k_Record), 0, 1, 0, 1},
    {&__pyx_n_s_RecordCodec, __pyx_k_RecordCodec, sizeof(__pyx_k_RecordCodec), 0, 0, 1, 1},
    {&__pyx_n_s_RecordCodec___reduce_cython, __pyx_k_RecordCodec___reduce_cython, sizeof(__pyx_k_RecordCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_RecordCodec___setstate_cython, __pyx_k_RecordCodec___setstate_cython, sizeof(__pyx_k_RecordCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ResultCardinalityMismatchError, __pyx_k_ResultCardinalityMismatchError, sizeof(__pyx_k_ResultCardinalityMismatchError), 0, 0, 1, 1},
    {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
    {&__pyx_kp_b_SCRAM_SHA_256, __pyx_k_SCRAM_SHA_256, sizeof(__pyx_k_SCRAM_SHA_256), 0, 0, 0, 0},
    {&__pyx_n_s_SQL, __pyx_k_SQL, sizeof(__pyx_k_SQL), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol, __pyx_k_SansIOProtocol, sizeof(__pyx_k_SansIOProtocol), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocolBackwardsCompatibl, __pyx_k_SansIOProtocolBackwardsCompatibl, sizeof(__pyx_k_SansIOProtocolBackwardsCompatibl), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocolBackwardsCompatibl_2, __pyx_k_SansIOProtocolBackwardsCompatibl_2, sizeof(__pyx_k_SansIOProtocolBackwardsCompatibl_2), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocolBackwardsCompatibl_3, __pyx_k_SansIOProtocolBackwardsCompatibl_3, sizeof(__pyx_k_SansIOProtocolBackwardsCompatibl_3), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocolBackwardsCompatibl_4, __pyx_k_SansIOProtocolBackwardsCompatibl_4, sizeof(__pyx_k_SansIOProtocolBackwardsCompatibl_4), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocolBackwardsCompatibl_5, __pyx_k_SansIOProtocolBackwardsCompatibl_5, sizeof(__pyx_k_SansIOProtocolBackwardsCompatibl_5), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocolBackwardsCompatibl_6, __pyx_k_SansIOProtocolBackwardsCompatibl_6, sizeof(__pyx_k_SansIOProtocolBackwardsCompatibl_6), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocolBackwardsCompatibl_7, __pyx_k_SansIOProtocolBackwardsCompatibl_7, sizeof(__pyx_k_SansIOProtocolBackwardsCompatibl_7), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocolBackwardsCompatibl_8, __pyx_k_SansIOProtocolBackwardsCompatibl_8, sizeof(__pyx_k_SansIOProtocolBackwardsCompatibl_8), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol___reduce_cython, __pyx_k_SansIOProtocol___reduce_cython, sizeof(__pyx_k_SansIOProtocol___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol___setstate_cython, __pyx_k_SansIOProtocol___setstate_cython, sizeof(__pyx_k_SansIOProtocol___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol__auth_sasl, __pyx_k_SansIOProtocol__auth_sasl, sizeof(__pyx_k_SansIOProtocol__auth_sasl), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol__execute, __pyx_k_SansIOProtocol__execute, sizeof(__pyx_k_SansIOProtocol__execute), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol__parse, __pyx_k_SansIOProtocol__parse, sizeof(__pyx_k_SansIOProtocol__parse), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol__sync, __pyx_k_SansIOProtocol__sync, sizeof(__pyx_k_SansIOProtocol__sync), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_abort, __pyx_k_SansIOProtocol_abort, sizeof(__pyx_k_SansIOProtocol_abort), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_connect, __pyx_k_SansIOProtocol_connect, sizeof(__pyx_k_SansIOProtocol_connect), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_dump, __pyx_k_SansIOProtocol_dump, sizeof(__pyx_k_SansIOProtocol_dump), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_execute, __pyx_k_SansIOProtocol_execute, sizeof(__pyx_k_SansIOProtocol_execute), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_get_settings, __pyx_k_SansIOProtocol_get_settings, sizeof(__pyx_k_SansIOProtocol_get_settings), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_is_in_transaction, __pyx_k_SansIOProtocol_is_in_transaction, sizeof(__pyx_k_SansIOProtocol_is_in_transaction), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_ping, __pyx_k_SansIOProtocol_ping, sizeof(__pyx_k_SansIOProtocol_ping), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_query, __pyx_k_SansIOProtocol_query, sizeof(__pyx_k_SansIOProtocol_query), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_restore, __pyx_k_SansIOProtocol_restore, sizeof(__pyx_k_SansIOProtocol_restore), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_set_connection, __pyx_k_SansIOProtocol_set_connection, sizeof(__pyx_k_SansIOProtocol_set_connection), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_terminate, __pyx_k_SansIOProtocol_terminate, sizeof(__pyx_k_SansIOProtocol_terminate), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_try_recv_eagerly, __pyx_k_SansIOProtocol_try_recv_eagerly, sizeof(__pyx_k_SansIOProtocol_try_recv_eagerly), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_wait_for_connect, __pyx_k_SansIOProtocol_wait_for_connect, sizeof(__pyx_k_SansIOProtocol_wait_for_connect), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_wait_for_disconne, __pyx_k_SansIOProtocol_wait_for_disconne, sizeof(__pyx_k_SansIOProtocol_wait_for_disconne), 0, 0, 1, 1},
    {&__pyx_n_s_SansIOProtocol_wait_for_message, __pyx_k_SansIOProtocol_wait_for_message, sizeof(__pyx_k_SansIOProtocol_wait_for_message), 0, 0, 1, 1},
    {&__pyx_n_s_ScalarCodec, __pyx_k_ScalarCodec, sizeof(__pyx_k_ScalarCodec), 0, 0, 1, 1},
    {&__pyx_n_s_ScalarCodec___reduce_cython, __pyx_k_ScalarCodec___reduce_cython, sizeof(__pyx_k_ScalarCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ScalarCodec___setstate_cython, __pyx_k_ScalarCodec___setstate_cython, sizeof(__pyx_k_ScalarCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_ScalarCodec_make_type, __pyx_k_ScalarCodec_make_type, sizeof(__pyx_k_ScalarCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_ScalarType, __pyx_k_ScalarType, sizeof(__pyx_k_ScalarType), 0, 0, 1, 1},
    {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
    {&__pyx_n_u_Set, __pyx_k_Set, sizeof(__pyx_k_Set), 0, 1, 0, 1},
    {&__pyx_n_s_SetCodec, __pyx_k_SetCodec, sizeof(__pyx_k_SetCodec), 0, 0, 1, 1},
    {&__pyx_n_s_SetCodec___reduce_cython, __pyx_k_SetCodec___reduce_cython, sizeof(__pyx_k_SetCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_SetCodec___setstate_cython, __pyx_k_SetCodec___setstate_cython, sizeof(__pyx_k_SetCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_SetCodec_make_type, __pyx_k_SetCodec_make_type, sizeof(__pyx_k_SetCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_Sized, __pyx_k_Sized, sizeof(__pyx_k_Sized), 0, 0, 1, 1},
    {&__pyx_n_s_SizedABC, __pyx_k_SizedABC, sizeof(__pyx_k_SizedABC), 0, 0, 1, 1},
    {&__pyx_n_u_SparseObject, __pyx_k_SparseObject, sizeof(__pyx_k_SparseObject), 0, 1, 0, 1},
    {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0},
    {&__pyx_n_s_TYPE_IDS, __pyx_k_TYPE_IDS, sizeof(__pyx_k_TYPE_IDS), 0, 0, 1, 1},
    {&__pyx_kp_u_Time_zones_are_not_available_fro, __pyx_k_Time_zones_are_not_available_fro, sizeof(__pyx_k_Time_zones_are_not_available_fro), 0, 1, 0, 0},
    {&__pyx_n_u_Tuple, __pyx_k_Tuple, sizeof(__pyx_k_Tuple), 0, 1, 0, 1},
    {&__pyx_n_s_TupleCodec, __pyx_k_TupleCodec, sizeof(__pyx_k_TupleCodec), 0, 0, 1, 1},
    {&__pyx_n_s_TupleCodec___reduce_cython, __pyx_k_TupleCodec___reduce_cython, sizeof(__pyx_k_TupleCodec___reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_TupleCodec___setstate_cython, __pyx_k_TupleCodec___setstate_cython, sizeof(__pyx_k_TupleCodec___setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_TupleCodec_make_type, __pyx_k_TupleCodec_make_type, sizeof(__pyx_k_TupleCodec_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_TupleType, __pyx_k_TupleType, sizeof(__pyx_k_TupleType), 0, 0, 1, 1},
    {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
    {&__pyx_n_s_UUID, __pyx_k_UUID, sizeof(__pyx_k_UUID), 0, 0, 1, 1},
    {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
    {&__pyx_kp_s_Unknown_enum_value_s, __pyx_k_Unknown_enum_value_s, sizeof(__pyx_k_Unknown_enum_value_s), 0, 0, 1, 0},
    {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
    {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
    {&__pyx_kp_u__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 1, 0, 0},
    {&__pyx_kp_b__154, __pyx_k__154, sizeof(__pyx_k__154), 0, 0, 0, 0},
    {&__pyx_kp_b__156, __pyx_k__156, sizeof(__pyx_k__156), 0, 0, 0, 0},
    {&__pyx_kp_b__157, __pyx_k__157, sizeof(__pyx_k__157), 0, 0, 0, 0},
    {&__pyx_kp_u__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 1, 0, 0},
    {&__pyx_kp_u__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 1, 0, 0},
    {&__pyx_kp_u__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 1, 0, 0},
    {&__pyx_kp_u__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 1, 0, 0},
    {&__pyx_kp_u__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 1, 0, 0},
    {&__pyx_n_s__241, __pyx_k__241, sizeof(__pyx_k__241), 0, 0, 1, 1},
    {&__pyx_n_s__254, __pyx_k__254, sizeof(__pyx_k__254), 0, 0, 1, 1},
    {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
    {&__pyx_kp_u__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 1, 0, 0},
    {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
    {&__pyx_kp_u__48, __pyx_k__48, sizeof(__pyx_k__48), 0, 1, 0, 0},
    {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1},
    {&__pyx_kp_u__65, __pyx_k__65, sizeof(__pyx_k__65), 0, 1, 0, 0},
    {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
    {&__pyx_kp_u__80, __pyx_k__80, sizeof(__pyx_k__80), 0, 1, 0, 0},
    {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
    {&__pyx_kp_u_a_datetime_datetime_object_was_e, __pyx_k_a_datetime_datetime_object_was_e, sizeof(__pyx_k_a_datetime_datetime_object_was_e), 0, 1, 0, 0},
    {&__pyx_kp_u_a_datetime_datetime_object_was_e_2, __pyx_k_a_datetime_datetime_object_was_e_2, sizeof(__pyx_k_a_datetime_datetime_object_was_e_2), 0, 1, 0, 0},
    {&__pyx_kp_u_a_dict_or_Mapping_expected_got_t, __pyx_k_a_dict_or_Mapping_expected_got_t, sizeof(__pyx_k_a_dict_or_Mapping_expected_got_t), 0, 1, 0, 0},
    {&__pyx_kp_u_a_naive_date_object_tzinfo_is_No, __pyx_k_a_naive_date_object_tzinfo_is_No, sizeof(__pyx_k_a_naive_date_object_tzinfo_is_No), 0, 1, 0, 0},
    {&__pyx_kp_u_a_naive_datetime_object_tzinfo_i, __pyx_k_a_naive_datetime_object_tzinfo_i, sizeof(__pyx_k_a_naive_datetime_object_tzinfo_i), 0, 1, 0, 0},
    {&__pyx_kp_u_a_naive_time_object_tzinfo_is_No, __pyx_k_a_naive_time_object_tzinfo_is_No, sizeof(__pyx_k_a_naive_time_object_tzinfo_is_No), 0, 1, 0, 0},
    {&__pyx_kp_u_a_scalar_codec_expected_for_base, __pyx_k_a_scalar_codec_expected_for_base, sizeof(__pyx_k_a_scalar_codec_expected_for_base), 0, 1, 0, 0},
    {&__pyx_kp_u_a_sized_iterable_container_expec, __pyx_k_a_sized_iterable_container_expec, sizeof(__pyx_k_a_sized_iterable_container_expec), 0, 1, 0, 0},
    {&__pyx_kp_u_a_sized_iterable_container_expec_2, __pyx_k_a_sized_iterable_container_expec_2, sizeof(__pyx_k_a_sized_iterable_container_expec_2), 0, 1, 0, 0},
    {&__pyx_kp_u_a_sized_iterable_container_or_ma, __pyx_k_a_sized_iterable_container_or_ma, sizeof(__pyx_k_a_sized_iterable_container_or_ma), 0, 1, 0, 0},
    {&__pyx_kp_u_a_str_or_gel_EnumValue___tid, __pyx_k_a_str_or_gel_EnumValue___tid, sizeof(__pyx_k_a_str_or_gel_EnumValue___tid), 0, 1, 0, 0},
    {&__pyx_kp_u_a_timezone_aware_datetime_object, __pyx_k_a_timezone_aware_datetime_object, sizeof(__pyx_k_a_timezone_aware_datetime_object), 0, 1, 0, 0},
    {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
    {&__pyx_n_s_abort, __pyx_k_abort, sizeof(__pyx_k_abort), 0, 0, 1, 1},
    {&__pyx_n_u_acceptable, __pyx_k_acceptable, sizeof(__pyx_k_acceptable), 0, 1, 0, 1},
    {&__pyx_n_s_aiter, __pyx_k_aiter, sizeof(__pyx_k_aiter), 0, 0, 1, 1},
    {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
    {&__pyx_n_s_allow_capabilities, __pyx_k_allow_capabilities, sizeof(__pyx_k_allow_capabilities), 0, 0, 1, 1},
    {&__pyx_kp_u_already_connected, __pyx_k_already_connected, sizeof(__pyx_k_already_connected), 0, 1, 0, 0},
    {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0},
    {&__pyx_n_s_anext, __pyx_k_anext, sizeof(__pyx_k_anext), 0, 0, 1, 1},
    {&__pyx_n_s_annotations, __pyx_k_annotations, sizeof(__pyx_k_annotations), 0, 0, 1, 1},
    {&__pyx_n_u_anytuple, __pyx_k_anytuple, sizeof(__pyx_k_anytuple), 0, 1, 0, 1},
    {&__pyx_n_u_anytype, __pyx_k_anytype, sizeof(__pyx_k_anytype), 0, 1, 0, 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_kp_u_argument, __pyx_k_argument, sizeof(__pyx_k_argument), 0, 1, 0, 0},
    {&__pyx_kp_u_argument_tuples_do_not_support_o, __pyx_k_argument_tuples_do_not_support_o, sizeof(__pyx_k_argument_tuples_do_not_support_o), 0, 1, 0, 0},
    {&__pyx_kp_u_arguments, __pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 1, 0, 0},
    {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
    {&__pyx_kp_u_as_it_does_not_return_any_data, __pyx_k_as_it_does_not_return_any_data, sizeof(__pyx_k_as_it_does_not_return_any_data), 0, 1, 0, 0},
    {&__pyx_kp_u_as_it_may_return_more_than_one, __pyx_k_as_it_may_return_more_than_one, sizeof(__pyx_k_as_it_may_return_more_than_one), 0, 1, 0, 0},
    {&__pyx_n_s_asyncio, __pyx_k_asyncio, sizeof(__pyx_k_asyncio), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
    {&__pyx_n_s_asyncio_tasks, __pyx_k_asyncio_tasks, sizeof(__pyx_k_asyncio_tasks), 0, 0, 1, 1},
    {&__pyx_kp_u_attribute, __pyx_k_attribute, sizeof(__pyx_k_attribute), 0, 1, 0, 0},
    {&__pyx_n_s_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1},
    {&__pyx_n_s_attrs_2, __pyx_k_attrs_2, sizeof(__pyx_k_attrs_2), 0, 0, 1, 1},
    {&__pyx_n_s_auth_sasl, __pyx_k_auth_sasl, sizeof(__pyx_k_auth_sasl), 0, 0, 1, 1},
    {&__pyx_n_s_await, __pyx_k_await, sizeof(__pyx_k_await), 0, 0, 1, 1},
    {&__pyx_kp_u_bad_bigint_sign_data, __pyx_k_bad_bigint_sign_data, sizeof(__pyx_k_bad_bigint_sign_data), 0, 1, 0, 0},
    {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
    {&__pyx_kp_u_base_scalar_codec_for, __pyx_k_base_scalar_codec_for, sizeof(__pyx_k_base_scalar_codec_for), 0, 1, 0, 0},
    {&__pyx_n_s_base_type, __pyx_k_base_type, sizeof(__pyx_k_base_type), 0, 0, 1, 1},
    {&__pyx_n_s_basecodec, __pyx_k_basecodec, sizeof(__pyx_k_basecodec), 0, 0, 1, 1},
    {&__pyx_n_u_big, __pyx_k_big, sizeof(__pyx_k_big), 0, 1, 0, 1},
    {&__pyx_kp_u_bigint_data_has_fractional_part, __pyx_k_bigint_data_has_fractional_part, sizeof(__pyx_k_bigint_data_has_fractional_part), 0, 1, 0, 0},
    {&__pyx_n_s_bint, __pyx_k_bint, sizeof(__pyx_k_bint), 0, 0, 1, 1},
    {&__pyx_n_s_block_callback, __pyx_k_block_callback, sizeof(__pyx_k_block_callback), 0, 0, 1, 1},
    {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
    {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1},
    {&__pyx_n_s_build_client_final_message, __pyx_k_build_client_final_message, sizeof(__pyx_k_build_client_final_message), 0, 0, 1, 1},
    {&__pyx_n_s_build_client_first_message, __pyx_k_build_client_first_message, sizeof(__pyx_k_build_client_first_message), 0, 0, 1, 1},
    {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
    {&__pyx_kp_u_bytes_2, __pyx_k_bytes_2, sizeof(__pyx_k_bytes_2), 0, 1, 0, 0},
    {&__pyx_n_s_bytes_3, __pyx_k_bytes_3, sizeof(__pyx_k_bytes_3), 0, 0, 1, 1},
    {&__pyx_n_s_byteswap, __pyx_k_byteswap, sizeof(__pyx_k_byteswap), 0, 0, 1, 1},
    {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
    {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
    {&__pyx_kp_u_c1a50ff8_fded_48b0_85c2_4905a848, __pyx_k_c1a50ff8_fded_48b0_85c2_4905a848, sizeof(__pyx_k_c1a50ff8_fded_48b0_85c2_4905a848), 0, 1, 0, 0},
    {&__pyx_n_s_cache_size, __pyx_k_cache_size, sizeof(__pyx_k_cache_size), 0, 0, 1, 1},
    {&__pyx_kp_u_cal_date_duration, __pyx_k_cal_date_duration, sizeof(__pyx_k_cal_date_duration), 0, 1, 0, 0},
    {&__pyx_kp_u_cal_local_date, __pyx_k_cal_local_date, sizeof(__pyx_k_cal_local_date), 0, 1, 0, 0},
    {&__pyx_kp_u_cal_local_datetime, __pyx_k_cal_local_datetime, sizeof(__pyx_k_cal_local_datetime), 0, 1, 0, 0},
    {&__pyx_kp_u_cal_local_time, __pyx_k_cal_local_time, sizeof(__pyx_k_cal_local_time), 0, 1, 0, 0},
    {&__pyx_kp_u_cal_relative_duration, __pyx_k_cal_relative_duration, sizeof(__pyx_k_cal_relative_duration), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_decode_NamedTuple_expecte, __pyx_k_cannot_decode_NamedTuple_expecte, sizeof(__pyx_k_cannot_decode_NamedTuple_expecte), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_decode_Object_expected, __pyx_k_cannot_decode_Object_expected, sizeof(__pyx_k_cannot_decode_Object_expected), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_decode_Record_expected, __pyx_k_cannot_decode_Record_expected, sizeof(__pyx_k_cannot_decode_Record_expected), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_decode_Tuple_expected, __pyx_k_cannot_decode_Tuple_expected, sizeof(__pyx_k_cannot_decode_Tuple_expected), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_decode_empty_Tuple_expect, __pyx_k_cannot_decode_empty_Tuple_expect, sizeof(__pyx_k_cannot_decode_empty_Tuple_expect), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_encode_empty_Tuple_expect, __pyx_k_cannot_encode_empty_Tuple_expect, sizeof(__pyx_k_cannot_encode_empty_Tuple_expect), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_encode_empty_Tuple_expect_2, __pyx_k_cannot_encode_empty_Tuple_expect_2, sizeof(__pyx_k_cannot_encode_empty_Tuple_expect_2), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_find_known_ID_for_type, __pyx_k_cannot_find_known_ID_for_type, sizeof(__pyx_k_cannot_find_known_ID_for_type), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_handle_arrays_with_more_t, __pyx_k_cannot_handle_arrays_with_more_t, sizeof(__pyx_k_cannot_handle_arrays_with_more_t), 0, 1, 0, 0},
    {&__pyx_kp_u_cannot_not_build_codec_empty_typ, __pyx_k_cannot_not_build_codec_empty_typ, sizeof(__pyx_k_cannot_not_build_codec_empty_typ), 0, 1, 0, 0},
    {&__pyx_n_s_cap_bytes, __pyx_k_cap_bytes, sizeof(__pyx_k_cap_bytes), 0, 0, 1, 1},
    {&__pyx_n_s_capabilities, __pyx_k_capabilities, sizeof(__pyx_k_capabilities), 0, 0, 1, 1},
    {&__pyx_n_s_cardinality, __pyx_k_cardinality, sizeof(__pyx_k_cardinality), 0, 0, 1, 1},
    {&__pyx_n_s_cause, __pyx_k_cause, sizeof(__pyx_k_cause), 0, 0, 1, 1},
    {&__pyx_kp_u_cfg_memory, __pyx_k_cfg_memory, sizeof(__pyx_k_cfg_memory), 0, 1, 0, 0},
    {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
    {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
    {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
    {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
    {&__pyx_n_s_clear_cache, __pyx_k_clear_cache, sizeof(__pyx_k_clear_cache), 0, 0, 1, 1},
    {&__pyx_n_s_client_final, __pyx_k_client_final, sizeof(__pyx_k_client_final), 0, 0, 1, 1},
    {&__pyx_n_s_client_first, __pyx_k_client_first, sizeof(__pyx_k_client_first), 0, 0, 1, 1},
    {&__pyx_n_s_client_first_bare, __pyx_k_client_first_bare, sizeof(__pyx_k_client_first_bare), 0, 0, 1, 1},
    {&__pyx_n_s_client_nonce, __pyx_k_client_nonce, sizeof(__pyx_k_client_nonce), 0, 0, 1, 1},
    {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
    {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
    {&__pyx_n_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
    {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
    {&__pyx_n_s_codec, __pyx_k_codec, sizeof(__pyx_k_codec), 0, 0, 1, 1},
    {&__pyx_n_s_codecs, __pyx_k_codecs, sizeof(__pyx_k_codecs), 0, 0, 1, 1},
    {&__pyx_kp_u_codecs_are_not_supposed_to_be_in, __pyx_k_codecs_are_not_supposed_to_be_in, sizeof(__pyx_k_codecs_are_not_supposed_to_be_in), 0, 1, 0, 0},
    {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
    {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0},
    {&__pyx_n_s_con, __pyx_k_con, sizeof(__pyx_k_con), 0, 0, 1, 1},
    {&__pyx_n_s_con_params, __pyx_k_con_params, sizeof(__pyx_k_con_params), 0, 0, 1, 1},
    {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
    {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
    {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
    {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
    {&__pyx_n_s_ctx, __pyx_k_ctx, sizeof(__pyx_k_ctx), 0, 0, 1, 1},
    {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
    {&__pyx_kp_u_data_block_before_header_block, __pyx_k_data_block_before_header_block, sizeof(__pyx_k_data_block_before_header_block), 0, 1, 0, 0},
    {&__pyx_n_s_data_gen, __pyx_k_data_gen, sizeof(__pyx_k_data_gen), 0, 0, 1, 1},
    {&__pyx_n_s_data_received, __pyx_k_data_received, sizeof(__pyx_k_data_received), 0, 0, 1, 1},
    {&__pyx_n_s_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 0, 1, 1},
    {&__pyx_n_u_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 1, 0, 1},
    {&__pyx_n_s_dataclasses, __pyx_k_dataclasses, sizeof(__pyx_k_dataclasses), 0, 0, 1, 1},
    {&__pyx_n_s_datatypes, __pyx_k_datatypes, sizeof(__pyx_k_datatypes), 0, 0, 1, 1},
    {&__pyx_kp_u_date_duration_has_non_zero_micro, __pyx_k_date_duration_has_non_zero_micro, sizeof(__pyx_k_date_duration_has_non_zero_micro), 0, 1, 0, 0},
    {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
    {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1},
    {&__pyx_n_s_dct, __pyx_k_dct, sizeof(__pyx_k_dct), 0, 0, 1, 1},
    {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1},
    {&__pyx_n_s_decoder, __pyx_k_decoder, sizeof(__pyx_k_decoder), 0, 0, 1, 1},
    {&__pyx_n_s_desc_id, __pyx_k_desc_id, sizeof(__pyx_k_desc_id), 0, 0, 1, 1},
    {&__pyx_n_s_describe, __pyx_k_describe, sizeof(__pyx_k_describe), 0, 0, 1, 1},
    {&__pyx_n_s_describe_context, __pyx_k_describe_context, sizeof(__pyx_k_describe_context), 0, 0, 1, 1},
    {&__pyx_n_s_descriptor, __pyx_k_descriptor, sizeof(__pyx_k_descriptor), 0, 0, 1, 1},
    {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
    {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
    {&__pyx_n_u_dim, __pyx_k_dim, sizeof(__pyx_k_dim), 0, 1, 0, 1},
    {&__pyx_kp_u_dim_key_is_missing, __pyx_k_dim_key_is_missing, sizeof(__pyx_k_dim_key_is_missing), 0, 1, 0, 0},
    {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
    {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
    {&__pyx_kp_u_does_not_correspond_to_any_know, __pyx_k_does_not_correspond_to_any_know, sizeof(__pyx_k_does_not_correspond_to_any_know), 0, 1, 0, 0},
    {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
    {&__pyx_n_s_dump, __pyx_k_dump, sizeof(__pyx_k_dump), 0, 0, 1, 1},
    {&__pyx_kp_u_either_positional_or_named_argum, __pyx_k_either_positional_or_named_argum, sizeof(__pyx_k_either_positional_or_named_argum), 0, 1, 0, 0},
    {&__pyx_n_s_element_type, __pyx_k_element_type, sizeof(__pyx_k_element_type), 0, 0, 1, 1},
    {&__pyx_n_s_element_types, __pyx_k_element_types, sizeof(__pyx_k_element_types), 0, 0, 1, 1},
    {&__pyx_n_s_elements, __pyx_k_elements, sizeof(__pyx_k_elements), 0, 0, 1, 1},
    {&__pyx_kp_u_elements_got, __pyx_k_elements_got, sizeof(__pyx_k_elements_got), 0, 1, 0, 0},
    {&__pyx_kp_u_elements_in_a_sparse_vector_cann, __pyx_k_elements_in_a_sparse_vector_cann, sizeof(__pyx_k_elements_in_a_sparse_vector_cann), 0, 1, 0, 0},
    {&__pyx_kp_u_elements_in_the_tuple_got, __pyx_k_elements_in_the_tuple_got, sizeof(__pyx_k_elements_in_the_tuple_got), 0, 1, 0, 0},
    {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
    {&__pyx_kp_u_empty_tuple, __pyx_k_empty_tuple, sizeof(__pyx_k_empty_tuple), 0, 1, 0, 0},
    {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
    {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
    {&__pyx_n_s_encoder, __pyx_k_encoder, sizeof(__pyx_k_encoder), 0, 0, 1, 1},
    {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
    {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
    {&__pyx_n_s_enums, __pyx_k_enums, sizeof(__pyx_k_enums), 0, 0, 1, 1},
    {&__pyx_kp_s_enums_Capability, __pyx_k_enums_Capability, sizeof(__pyx_k_enums_Capability), 0, 0, 1, 0},
    {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
    {&__pyx_n_s_error_message, __pyx_k_error_message, sizeof(__pyx_k_error_message), 0, 0, 1, 1},
    {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
    {&__pyx_n_s_ex, __pyx_k_ex, sizeof(__pyx_k_ex), 0, 0, 1, 1},
    {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1},
    {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1},
    {&__pyx_n_s_execute_2, __pyx_k_execute_2, sizeof(__pyx_k_execute_2), 0, 0, 1, 1},
    {&__pyx_n_s_expect_one, __pyx_k_expect_one, sizeof(__pyx_k_expect_one), 0, 0, 1, 1},
    {&__pyx_kp_u_expected, __pyx_k_expected, sizeof(__pyx_k_expected), 0, 1, 0, 0},
    {&__pyx_n_u_expected_2, __pyx_k_expected_2, sizeof(__pyx_k_expected_2), 0, 1, 0, 1},
    {&__pyx_kp_u_expected_3, __pyx_k_expected_3, sizeof(__pyx_k_expected_3), 0, 1, 0, 0},
    {&__pyx_kp_u_expected_SASLContinue_from_the_s, __pyx_k_expected_SASLContinue_from_the_s, sizeof(__pyx_k_expected_SASLContinue_from_the_s), 0, 1, 0, 0},
    {&__pyx_kp_u_expected_SASLFinal_from_the_serv, __pyx_k_expected_SASLFinal_from_the_serv, sizeof(__pyx_k_expected_SASLFinal_from_the_serv), 0, 1, 0, 0},
    {&__pyx_kp_u_expected_a_Decimal_or_an_int, __pyx_k_expected_a_Decimal_or_an_int, sizeof(__pyx_k_expected_a_Decimal_or_an_int), 0, 1, 0, 0},
    {&__pyx_kp_u_expected_a_record_with_a_single, __pyx_k_expected_a_record_with_a_single, sizeof(__pyx_k_expected_a_record_with_a_single), 0, 1, 0, 0},
    {&__pyx_kp_u_expected_a_two_dimensional_array, __pyx_k_expected_a_two_dimensional_array, sizeof(__pyx_k_expected_a_two_dimensional_array), 0, 1, 0, 0},
    {&__pyx_kp_u_expected_an_int, __pyx_k_expected_an_int, sizeof(__pyx_k_expected_an_int), 0, 1, 0, 0},
    {&__pyx_kp_u_expected_no_named_arguments, __pyx_k_expected_no_named_arguments, sizeof(__pyx_k_expected_no_named_arguments), 0, 1, 0, 0},
    {&__pyx_kp_u_expected_no_positional_arguments, __pyx_k_expected_no_positional_arguments, sizeof(__pyx_k_expected_no_positional_arguments), 0, 1, 0, 0},
    {&__pyx_n_s_expected_server_sig, __pyx_k_expected_server_sig, sizeof(__pyx_k_expected_server_sig), 0, 0, 1, 1},
    {&__pyx_kp_u_ext_pgvector_halfvec, __pyx_k_ext_pgvector_halfvec, sizeof(__pyx_k_ext_pgvector_halfvec), 0, 1, 0, 0},
    {&__pyx_kp_u_ext_pgvector_sparsevec, __pyx_k_ext_pgvector_sparsevec, sizeof(__pyx_k_ext_pgvector_sparsevec), 0, 1, 0, 0},
    {&__pyx_kp_u_ext_pgvector_vector, __pyx_k_ext_pgvector_vector, sizeof(__pyx_k_ext_pgvector_vector), 0, 1, 0, 0},
    {&__pyx_kp_u_ext_postgis_box2d, __pyx_k_ext_postgis_box2d, sizeof(__pyx_k_ext_postgis_box2d), 0, 1, 0, 0},
    {&__pyx_kp_u_ext_postgis_box3d, __pyx_k_ext_postgis_box3d, sizeof(__pyx_k_ext_postgis_box3d), 0, 1, 0, 0},
    {&__pyx_kp_u_ext_postgis_geography, __pyx_k_ext_postgis_geography, sizeof(__pyx_k_ext_postgis_geography), 0, 1, 0, 0},
    {&__pyx_kp_u_ext_postgis_geometry, __pyx_k_ext_postgis_geometry, sizeof(__pyx_k_ext_postgis_geometry), 0, 1, 0, 0},
    {&__pyx_kp_u_extra, __pyx_k_extra, sizeof(__pyx_k_extra), 0, 1, 0, 0},
    {&__pyx_n_s_extra_args, __pyx_k_extra_args, sizeof(__pyx_k_extra_args), 0, 0, 1, 1},
    {&__pyx_n_u_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 1, 0, 1},
    {&__pyx_n_s_field, __pyx_k_field, sizeof(__pyx_k_field), 0, 0, 1, 1},
    {&__pyx_n_s_field_type, __pyx_k_field_type, sizeof(__pyx_k_field_type), 0, 0, 1, 1},
    {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
    {&__pyx_n_u_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 1, 0, 1},
    {&__pyx_kp_u_first_message_is_not_DataMsg, __pyx_k_first_message_is_not_DataMsg, sizeof(__pyx_k_first_message_is_not_DataMsg), 0, 1, 0, 0},
    {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
    {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
    {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
    {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
    {&__pyx_n_s_from_bytes, __pyx_k_from_bytes, sizeof(__pyx_k_from_bytes), 0, 0, 1, 1},
    {&__pyx_n_s_from_code, __pyx_k_from_code, sizeof(__pyx_k_from_code), 0, 0, 1, 1},
    {&__pyx_n_s_from_json, __pyx_k_from_json, sizeof(__pyx_k_from_json), 0, 0, 1, 1},
    {&__pyx_kp_u_fts_language, __pyx_k_fts_language, sizeof(__pyx_k_fts_language), 0, 1, 0, 0},
    {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
    {&__pyx_n_s_gel, __pyx_k_gel, sizeof(__pyx_k_gel), 0, 0, 1, 1},
    {&__pyx_n_u_gel, __pyx_k_gel, sizeof(__pyx_k_gel), 0, 1, 0, 1},
    {&__pyx_kp_u_gel_DerivedEnumValue, __pyx_k_gel_DerivedEnumValue, sizeof(__pyx_k_gel_DerivedEnumValue), 0, 1, 0, 0},
    {&__pyx_n_s_gel_datatypes, __pyx_k_gel_datatypes, sizeof(__pyx_k_gel_datatypes), 0, 0, 1, 1},
    {&__pyx_n_s_gel_pgproto, __pyx_k_gel_pgproto, sizeof(__pyx_k_gel_pgproto), 0, 0, 1, 1},
    {&__pyx_n_s_gel_pgproto_pgproto, __pyx_k_gel_pgproto_pgproto, sizeof(__pyx_k_gel_pgproto_pgproto), 0, 0, 1, 1},
    {&__pyx_kp_s_gel_protocol_codecs_array_pyx, __pyx_k_gel_protocol_codecs_array_pyx, sizeof(__pyx_k_gel_protocol_codecs_array_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_base_pyx, __pyx_k_gel_protocol_codecs_base_pyx, sizeof(__pyx_k_gel_protocol_codecs_base_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_codecs_pyx, __pyx_k_gel_protocol_codecs_codecs_pyx, sizeof(__pyx_k_gel_protocol_codecs_codecs_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_enum_pyx, __pyx_k_gel_protocol_codecs_enum_pyx, sizeof(__pyx_k_gel_protocol_codecs_enum_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_namedtuple_p, __pyx_k_gel_protocol_codecs_namedtuple_p, sizeof(__pyx_k_gel_protocol_codecs_namedtuple_p), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_object_pyx, __pyx_k_gel_protocol_codecs_object_pyx, sizeof(__pyx_k_gel_protocol_codecs_object_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_range_pyx, __pyx_k_gel_protocol_codecs_range_pyx, sizeof(__pyx_k_gel_protocol_codecs_range_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_scalar_pyx, __pyx_k_gel_protocol_codecs_scalar_pyx, sizeof(__pyx_k_gel_protocol_codecs_scalar_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_set_pyx, __pyx_k_gel_protocol_codecs_set_pyx, sizeof(__pyx_k_gel_protocol_codecs_set_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_codecs_tuple_pyx, __pyx_k_gel_protocol_codecs_tuple_pyx, sizeof(__pyx_k_gel_protocol_codecs_tuple_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_lru_pyx, __pyx_k_gel_protocol_lru_pyx, sizeof(__pyx_k_gel_protocol_lru_pyx), 0, 0, 1, 0},
    {&__pyx_n_s_gel_protocol_protocol, __pyx_k_gel_protocol_protocol, sizeof(__pyx_k_gel_protocol_protocol), 0, 0, 1, 1},
    {&__pyx_kp_s_gel_protocol_protocol_pyx, __pyx_k_gel_protocol_protocol_pyx, sizeof(__pyx_k_gel_protocol_protocol_pyx), 0, 0, 1, 0},
    {&__pyx_kp_s_gel_protocol_protocol_v0_pyx, __pyx_k_gel_protocol_protocol_v0_pyx, sizeof(__pyx_k_gel_protocol_protocol_v0_pyx), 0, 0, 1, 0},
    {&__pyx_n_s_generate_nonce, __pyx_k_generate_nonce, sizeof(__pyx_k_generate_nonce), 0, 0, 1, 1},
    {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
    {&__pyx_n_s_get_code, __pyx_k_get_code, sizeof(__pyx_k_get_code), 0, 0, 1, 1},
    {&__pyx_n_s_get_dataclass_fields, __pyx_k_get_dataclass_fields, sizeof(__pyx_k_get_dataclass_fields), 0, 0, 1, 1},
    {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1},
    {&__pyx_n_s_get_settings, __pyx_k_get_settings, sizeof(__pyx_k_get_settings), 0, 0, 1, 1},
    {&__pyx_n_s_get_text_codec, __pyx_k_get_text_codec, sizeof(__pyx_k_get_text_codec), 0, 0, 1, 1},
    {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
    {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
    {&__pyx_kp_u_got_2, __pyx_k_got_2, sizeof(__pyx_k_got_2), 0, 1, 0, 0},
    {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0},
    {&__pyx_n_s_handshake_buf, __pyx_k_handshake_buf, sizeof(__pyx_k_handshake_buf), 0, 0, 1, 1},
    {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1},
    {&__pyx_kp_u_header_block_after_data_block, __pyx_k_header_block_after_data_block, sizeof(__pyx_k_header_block_after_data_block), 0, 1, 0, 0},
    {&__pyx_kp_u_header_block_was_not_received, __pyx_k_header_block_was_not_received, sizeof(__pyx_k_header_block_was_not_received), 0, 1, 0, 0},
    {&__pyx_n_s_header_callback, __pyx_k_header_callback, sizeof(__pyx_k_header_callback), 0, 0, 1, 1},
    {&__pyx_n_s_header_received, __pyx_k_header_received, sizeof(__pyx_k_header_received), 0, 0, 1, 1},
    {&__pyx_n_s_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 0, 1, 1},
    {&__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_s_implicit_limit, __pyx_k_implicit_limit, sizeof(__pyx_k_implicit_limit), 0, 0, 1, 1},
    {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
    {&__pyx_n_s_in_dc, __pyx_k_in_dc, sizeof(__pyx_k_in_dc), 0, 0, 1, 1},
    {&__pyx_n_s_in_type_id, __pyx_k_in_type_id, sizeof(__pyx_k_in_type_id), 0, 0, 1, 1},
    {&__pyx_n_s_inc_lower, __pyx_k_inc_lower, sizeof(__pyx_k_inc_lower), 0, 0, 1, 1},
    {&__pyx_n_s_inc_upper, __pyx_k_inc_upper, sizeof(__pyx_k_inc_upper), 0, 0, 1, 1},
    {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
    {&__pyx_n_s_index_2, __pyx_k_index_2, sizeof(__pyx_k_index_2), 0, 0, 1, 1},
    {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
    {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
    {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
    {&__pyx_n_s_inline_typeids, __pyx_k_inline_typeids, sizeof(__pyx_k_inline_typeids), 0, 0, 1, 1},
    {&__pyx_n_s_inline_typenames, __pyx_k_inline_typenames, sizeof(__pyx_k_inline_typenames), 0, 0, 1, 1},
    {&__pyx_n_s_input_language, __pyx_k_input_language, sizeof(__pyx_k_input_language), 0, 0, 1, 1},
    {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1},
    {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 0, 0, 1, 1},
    {&__pyx_kp_u_invalid_array_element, __pyx_k_invalid_array_element, sizeof(__pyx_k_invalid_array_element), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_array_element_at_index_N, __pyx_k_invalid_array_element_at_index_N, sizeof(__pyx_k_invalid_array_element_at_index_N), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_array_size_received, __pyx_k_invalid_array_size_received, sizeof(__pyx_k_invalid_array_size_received), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_buffer_length, __pyx_k_invalid_buffer_length, sizeof(__pyx_k_invalid_buffer_length), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_input_for_query_argument, __pyx_k_invalid_input_for_query_argument, sizeof(__pyx_k_invalid_input_for_query_argument), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_input_for_query_argument_2, __pyx_k_invalid_input_for_query_argument_2, sizeof(__pyx_k_invalid_input_for_query_argument_2), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_input_for_state_argument, __pyx_k_invalid_input_for_state_argument, sizeof(__pyx_k_invalid_input_for_state_argument), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_multirange_element, __pyx_k_invalid_multirange_element, sizeof(__pyx_k_invalid_multirange_element), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_number_of_columns_expect, __pyx_k_invalid_number_of_columns_expect, sizeof(__pyx_k_invalid_number_of_columns_expect), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_range_lower_bound, __pyx_k_invalid_range_lower_bound, sizeof(__pyx_k_invalid_range_lower_bound), 0, 1, 0, 0},
    {&__pyx_kp_u_invalid_range_upper_bound, __pyx_k_invalid_range_upper_bound, sizeof(__pyx_k_invalid_range_upper_bound), 0, 1, 0, 0},
    {&__pyx_kp_u_is_already_registered, __pyx_k_is_already_registered, sizeof(__pyx_k_is_already_registered), 0, 1, 0, 0},
    {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
    {&__pyx_n_s_is_empty, __pyx_k_is_empty, sizeof(__pyx_k_is_empty), 0, 0, 1, 1},
    {&__pyx_kp_u_is_expected_as_a_valid_enum_arg, __pyx_k_is_expected_as_a_valid_enum_arg, sizeof(__pyx_k_is_expected_as_a_valid_enum_arg), 0, 1, 0, 0},
    {&__pyx_n_s_is_implicit, __pyx_k_is_implicit, sizeof(__pyx_k_is_implicit), 0, 0, 1, 1},
    {&__pyx_n_s_is_in_transaction, __pyx_k_is_in_transaction, sizeof(__pyx_k_is_in_transaction), 0, 0, 1, 1},
    {&__pyx_kp_u_is_required_but_received_None, __pyx_k_is_required_but_received_None, sizeof(__pyx_k_is_required_but_received_None), 0, 1, 0, 0},
    {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
    {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
    {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
    {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
    {&__pyx_n_s_itercount, __pyx_k_itercount, sizeof(__pyx_k_itercount), 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_kp_u_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 1, 0, 0},
    {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
    {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
    {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
    {&__pyx_n_u_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 1, 0, 1},
    {&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1},
    {&__pyx_n_s_legacy_execute, __pyx_k_legacy_execute, sizeof(__pyx_k_legacy_execute), 0, 0, 1, 1},
    {&__pyx_n_s_legacy_execute_anonymous, __pyx_k_legacy_execute_anonymous, sizeof(__pyx_k_legacy_execute_anonymous), 0, 0, 1, 1},
    {&__pyx_n_s_legacy_optimistic_execute, __pyx_k_legacy_optimistic_execute, sizeof(__pyx_k_legacy_optimistic_execute), 0, 0, 1, 1},
    {&__pyx_n_s_legacy_parse, __pyx_k_legacy_parse, sizeof(__pyx_k_legacy_parse), 0, 0, 1, 1},
    {&__pyx_n_s_legacy_simple_query, __pyx_k_legacy_simple_query, sizeof(__pyx_k_legacy_simple_query), 0, 0, 1, 1},
    {&__pyx_n_s_loads, __pyx_k_loads, sizeof(__pyx_k_loads), 0, 0, 1, 1},
    {&__pyx_n_s_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 0, 0, 1, 1},
    {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
    {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
    {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1},
    {&__pyx_n_s_make_missing_args_error_message, __pyx_k_make_missing_args_error_message, sizeof(__pyx_k_make_missing_args_error_message), 0, 0, 1, 1},
    {&__pyx_n_s_make_type, __pyx_k_make_type, sizeof(__pyx_k_make_type), 0, 0, 1, 1},
    {&__pyx_n_s_make_type_locals_genexpr, __pyx_k_make_type_locals_genexpr, sizeof(__pyx_k_make_type_locals_genexpr), 0, 0, 1, 1},
    {&__pyx_n_s_maxsize, __pyx_k_maxsize, sizeof(__pyx_k_maxsize), 0, 0, 1, 1},
    {&__pyx_kp_u_maxsize_is_expected_to_be_greate, __pyx_k_maxsize_is_expected_to_be_greate, sizeof(__pyx_k_maxsize_is_expected_to_be_greate), 0, 1, 0, 0},
    {&__pyx_n_s_member_names, __pyx_k_member_names, sizeof(__pyx_k_member_names), 0, 0, 1, 1},
    {&__pyx_n_s_members, __pyx_k_members, sizeof(__pyx_k_members), 0, 0, 1, 1},
    {&__pyx_n_s_members_2, __pyx_k_members_2, sizeof(__pyx_k_members_2), 0, 0, 1, 1},
    {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
    {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
    {&__pyx_n_s_methname, __pyx_k_methname, sizeof(__pyx_k_methname), 0, 0, 1, 1},
    {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
    {&__pyx_n_s_methods, __pyx_k_methods, sizeof(__pyx_k_methods), 0, 0, 1, 1},
    {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
    {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1},
    {&__pyx_kp_u_missed, __pyx_k_missed, sizeof(__pyx_k_missed), 0, 1, 0, 0},
    {&__pyx_n_s_missed_args, __pyx_k_missed_args, sizeof(__pyx_k_missed_args), 0, 0, 1, 1},
    {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
    {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
    {&__pyx_n_u_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 1, 0, 1},
    {&__pyx_n_s_module_2, __pyx_k_module_2, sizeof(__pyx_k_module_2), 0, 0, 1, 1},
    {&__pyx_n_s_months, __pyx_k_months, sizeof(__pyx_k_months), 0, 0, 1, 1},
    {&__pyx_kp_u_more_than_one_header_block, __pyx_k_more_than_one_header_block, sizeof(__pyx_k_more_than_one_header_block), 0, 1, 0, 0},
    {&__pyx_n_s_move_to_end, __pyx_k_move_to_end, sizeof(__pyx_k_move_to_end), 0, 0, 1, 1},
    {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
    {&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
    {&__pyx_n_s_msg_buf, __pyx_k_msg_buf, sizeof(__pyx_k_msg_buf), 0, 0, 1, 1},
    {&__pyx_n_s_mtype, __pyx_k_mtype, sizeof(__pyx_k_mtype), 0, 0, 1, 1},
    {&__pyx_n_b_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 0, 1},
    {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
    {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
    {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
    {&__pyx_kp_u_named_tuple_dict_is_missing, __pyx_k_named_tuple_dict_is_missing, sizeof(__pyx_k_named_tuple_dict_is_missing), 0, 1, 0, 0},
    {&__pyx_kp_u_named_tuple_is_missing, __pyx_k_named_tuple_is_missing, sizeof(__pyx_k_named_tuple_is_missing), 0, 1, 0, 0},
    {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
    {&__pyx_kp_u_neither_are_supported, __pyx_k_neither_are_supported, sizeof(__pyx_k_neither_are_supported), 0, 1, 0, 0},
    {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
    {&__pyx_n_s_new_cardinality, __pyx_k_new_cardinality, sizeof(__pyx_k_new_cardinality), 0, 0, 1, 1},
    {&__pyx_kp_u_no_codec_implementation_for_Edge, __pyx_k_no_codec_implementation_for_Edge, sizeof(__pyx_k_no_codec_implementation_for_Edge), 0, 1, 0, 0},
    {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
    {&__pyx_kp_u_no_input, __pyx_k_no_input, sizeof(__pyx_k_no_input), 0, 1, 0, 0},
    {&__pyx_kp_u_non_idle_status_after_connect, __pyx_k_non_idle_status_after_connect, sizeof(__pyx_k_non_idle_status_after_connect), 0, 1, 0, 0},
    {&__pyx_kp_u_non_zero_reserved_bytes_in_durat, __pyx_k_non_zero_reserved_bytes_in_durat, sizeof(__pyx_k_non_zero_reserved_bytes_in_durat), 0, 1, 0, 0},
    {&__pyx_kp_u_not_connected, __pyx_k_not_connected, sizeof(__pyx_k_not_connected), 0, 1, 0, 0},
    {&__pyx_n_u_nothing, __pyx_k_nothing, sizeof(__pyx_k_nothing), 0, 1, 0, 1},
    {&__pyx_n_u_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 1, 0, 1},
    {&__pyx_kp_u_null_codec, __pyx_k_null_codec, sizeof(__pyx_k_null_codec), 0, 1, 0, 0},
    {&__pyx_n_s_num_methods, __pyx_k_num_methods, sizeof(__pyx_k_num_methods), 0, 0, 1, 1},
    {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
    {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
    {&__pyx_n_s_on_log_message, __pyx_k_on_log_message, sizeof(__pyx_k_on_log_message), 0, 0, 1, 1},
    {&__pyx_kp_u_only_1_dimensional_arrays_are_su, __pyx_k_only_1_dimensional_arrays_are_su, sizeof(__pyx_k_only_1_dimensional_arrays_are_su), 0, 1, 0, 0},
    {&__pyx_kp_u_only_arrays_of_scalars_are_suppo, __pyx_k_only_arrays_of_scalars_are_suppo, sizeof(__pyx_k_only_arrays_of_scalars_are_suppo), 0, 1, 0, 0},
    {&__pyx_kp_u_only_scalar_multiranges_are_supp, __pyx_k_only_scalar_multiranges_are_supp, sizeof(__pyx_k_only_scalar_multiranges_are_supp), 0, 1, 0, 0},
    {&__pyx_kp_u_only_scalar_ranges_are_supported, __pyx_k_only_scalar_ranges_are_supported, sizeof(__pyx_k_only_scalar_ranges_are_supported), 0, 1, 0, 0},
    {&__pyx_n_s_out_dc, __pyx_k_out_dc, sizeof(__pyx_k_out_dc), 0, 0, 1, 1},
    {&__pyx_n_s_out_type_id, __pyx_k_out_type_id, sizeof(__pyx_k_out_type_id), 0, 0, 1, 1},
    {&__pyx_n_s_output_format, __pyx_k_output_format, sizeof(__pyx_k_output_format), 0, 0, 1, 1},
    {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
    {&__pyx_n_s_packet, __pyx_k_packet, sizeof(__pyx_k_packet), 0, 0, 1, 1},
    {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1},
    {&__pyx_n_s_parents, __pyx_k_parents, sizeof(__pyx_k_parents), 0, 0, 1, 1},
    {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
    {&__pyx_n_s_parse_server_final_message, __pyx_k_parse_server_final_message, sizeof(__pyx_k_parse_server_final_message), 0, 0, 1, 1},
    {&__pyx_n_s_parse_server_first_message, __pyx_k_parse_server_first_message, sizeof(__pyx_k_parse_server_first_message), 0, 0, 1, 1},
    {&__pyx_n_s_passed_args, __pyx_k_passed_args, sizeof(__pyx_k_passed_args), 0, 0, 1, 1},
    {&__pyx_n_s_passed_args_repr, __pyx_k_passed_args_repr, sizeof(__pyx_k_passed_args_repr), 0, 0, 1, 1},
    {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1},
    {&__pyx_n_s_pgproto, __pyx_k_pgproto, sizeof(__pyx_k_pgproto), 0, 0, 1, 1},
    {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
    {&__pyx_n_s_ping, __pyx_k_ping, sizeof(__pyx_k_ping), 0, 0, 1, 1},
    {&__pyx_n_s_popitem, __pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 0, 1, 1},
    {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
    {&__pyx_n_u_python, __pyx_k_python, sizeof(__pyx_k_python), 0, 1, 0, 1},
    {&__pyx_kp_u_python_is_the_only_valid_format, __pyx_k_python_is_the_only_valid_format, sizeof(__pyx_k_python_is_the_only_valid_format), 0, 1, 0, 0},
    {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_CodecsRegistry, __pyx_k_pyx_unpickle_CodecsRegistry, sizeof(__pyx_k_pyx_unpickle_CodecsRegistry), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_ExecuteContext, __pyx_k_pyx_unpickle_ExecuteContext, sizeof(__pyx_k_pyx_unpickle_ExecuteContext), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_LRUMapping, __pyx_k_pyx_unpickle_LRUMapping, sizeof(__pyx_k_pyx_unpickle_LRUMapping), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_SansIOProtocol, __pyx_k_pyx_unpickle_SansIOProtocol, sizeof(__pyx_k_pyx_unpickle_SansIOProtocol), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle_SansIOProtocolBac, __pyx_k_pyx_unpickle_SansIOProtocolBac, sizeof(__pyx_k_pyx_unpickle_SansIOProtocolBac), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_unpickle___Pyx_EnumMeta, __pyx_k_pyx_unpickle___Pyx_EnumMeta, sizeof(__pyx_k_pyx_unpickle___Pyx_EnumMeta), 0, 0, 1, 1},
    {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
    {&__pyx_n_s_qc, __pyx_k_qc, sizeof(__pyx_k_qc), 0, 0, 1, 1},
    {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
    {&__pyx_n_u_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 0, 1},
    {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1},
    {&__pyx_n_s_query_2, __pyx_k_query_2, sizeof(__pyx_k_query_2), 0, 0, 1, 1},
    {&__pyx_kp_u_query_cannot_be_executed_with, __pyx_k_query_cannot_be_executed_with, sizeof(__pyx_k_query_cannot_be_executed_with), 0, 1, 0, 0},
    {&__pyx_kp_u_query_executed_via, __pyx_k_query_executed_via, sizeof(__pyx_k_query_executed_via), 0, 1, 0, 0},
    {&__pyx_n_u_query_required_single, __pyx_k_query_required_single, sizeof(__pyx_k_query_required_single), 0, 1, 0, 1},
    {&__pyx_n_u_query_required_single_json, __pyx_k_query_required_single_json, sizeof(__pyx_k_query_required_single_json), 0, 1, 0, 1},
    {&__pyx_n_u_query_single, __pyx_k_query_single, sizeof(__pyx_k_query_single), 0, 1, 0, 1},
    {&__pyx_n_u_query_single_json, __pyx_k_query_single_json, sizeof(__pyx_k_query_single_json), 0, 1, 0, 1},
    {&__pyx_kp_u_r_is_out_of_range_for_type_half, __pyx_k_r_is_out_of_range_for_type_half, sizeof(__pyx_k_r_is_out_of_range_for_type_half), 0, 1, 0, 0},
    {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
    {&__pyx_n_s_range_mod, __pyx_k_range_mod, sizeof(__pyx_k_range_mod), 0, 0, 1, 1},
    {&__pyx_n_u_raw_query, __pyx_k_raw_query, sizeof(__pyx_k_raw_query), 0, 1, 0, 1},
    {&__pyx_n_s_re_exec, __pyx_k_re_exec, sizeof(__pyx_k_re_exec), 0, 0, 1, 1},
    {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
    {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
    {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
    {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
    {&__pyx_n_s_reg, __pyx_k_reg, sizeof(__pyx_k_reg), 0, 0, 1, 1},
    {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
    {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
    {&__pyx_n_s_required, __pyx_k_required, sizeof(__pyx_k_required), 0, 0, 1, 1},
    {&__pyx_n_s_required_args, __pyx_k_required_args, sizeof(__pyx_k_required_args), 0, 0, 1, 1},
    {&__pyx_n_s_required_one, __pyx_k_required_one, sizeof(__pyx_k_required_one), 0, 0, 1, 1},
    {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
    {&__pyx_n_s_restore, __pyx_k_restore, sizeof(__pyx_k_restore), 0, 0, 1, 1},
    {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
    {&__pyx_kp_u_result_is_not_a_list_but, __pyx_k_result_is_not_a_list_but, sizeof(__pyx_k_result_is_not_a_list_but), 0, 1, 0, 0},
    {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
    {&__pyx_kp_u_returned_no_data, __pyx_k_returned_no_data, sizeof(__pyx_k_returned_no_data), 0, 1, 0, 0},
    {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1},
    {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1},
    {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0},
    {&__pyx_kp_s_s_s_d, __pyx_k_s_s_d, sizeof(__pyx_k_s_s_d), 0, 0, 1, 0},
    {&__pyx_n_s_salt, __pyx_k_salt, sizeof(__pyx_k_salt), 0, 0, 1, 1},
    {&__pyx_n_s_scram, __pyx_k_scram, sizeof(__pyx_k_scram), 0, 0, 1, 1},
    {&__pyx_n_s_secret_key, __pyx_k_secret_key, sizeof(__pyx_k_secret_key), 0, 0, 1, 1},
    {&__pyx_n_u_secret_key, __pyx_k_secret_key, sizeof(__pyx_k_secret_key), 0, 1, 0, 1},
    {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
    {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
    {&__pyx_kp_u_server_SCRAM_proof_does_not_matc, __pyx_k_server_SCRAM_proof_does_not_matc, sizeof(__pyx_k_server_SCRAM_proof_does_not_matc), 0, 1, 0, 0},
    {&__pyx_n_s_server_final, __pyx_k_server_final, sizeof(__pyx_k_server_final), 0, 0, 1, 1},
    {&__pyx_n_s_server_first, __pyx_k_server_first, sizeof(__pyx_k_server_first), 0, 0, 1, 1},
    {&__pyx_n_s_server_nonce, __pyx_k_server_nonce, sizeof(__pyx_k_server_nonce), 0, 0, 1, 1},
    {&__pyx_n_s_server_sig, __pyx_k_server_sig, sizeof(__pyx_k_server_sig), 0, 0, 1, 1},
    {&__pyx_n_s_set_connection, __pyx_k_set_connection, sizeof(__pyx_k_set_connection), 0, 0, 1, 1},
    {&__pyx_n_s_set_dataclass_fields_func, __pyx_k_set_dataclass_fields_func, sizeof(__pyx_k_set_dataclass_fields_func), 0, 0, 1, 1},
    {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
    {&__pyx_n_s_set_type_codec, __pyx_k_set_type_codec, sizeof(__pyx_k_set_type_codec), 0, 0, 1, 1},
    {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
    {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
    {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
    {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
    {&__pyx_kp_u_size_of_encoded_multirange_datum, __pyx_k_size_of_encoded_multirange_datum, sizeof(__pyx_k_size_of_encoded_multirange_datum), 0, 1, 0, 0},
    {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
    {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
    {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
    {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
    {&__pyx_n_u_std, __pyx_k_std, sizeof(__pyx_k_std), 0, 1, 0, 1},
    {&__pyx_kp_u_std_bigint, __pyx_k_std_bigint, sizeof(__pyx_k_std_bigint), 0, 1, 0, 0},
    {&__pyx_kp_u_std_bool, __pyx_k_std_bool, sizeof(__pyx_k_std_bool), 0, 1, 0, 0},
    {&__pyx_kp_u_std_bytes, __pyx_k_std_bytes, sizeof(__pyx_k_std_bytes), 0, 1, 0, 0},
    {&__pyx_kp_u_std_datetime, __pyx_k_std_datetime, sizeof(__pyx_k_std_datetime), 0, 1, 0, 0},
    {&__pyx_kp_u_std_decimal, __pyx_k_std_decimal, sizeof(__pyx_k_std_decimal), 0, 1, 0, 0},
    {&__pyx_kp_u_std_duration, __pyx_k_std_duration, sizeof(__pyx_k_std_duration), 0, 1, 0, 0},
    {&__pyx_kp_u_std_float32, __pyx_k_std_float32, sizeof(__pyx_k_std_float32), 0, 1, 0, 0},
    {&__pyx_kp_u_std_float64, __pyx_k_std_float64, sizeof(__pyx_k_std_float64), 0, 1, 0, 0},
    {&__pyx_kp_u_std_int16, __pyx_k_std_int16, sizeof(__pyx_k_std_int16), 0, 1, 0, 0},
    {&__pyx_kp_u_std_int32, __pyx_k_std_int32, sizeof(__pyx_k_std_int32), 0, 1, 0, 0},
    {&__pyx_kp_u_std_int64, __pyx_k_std_int64, sizeof(__pyx_k_std_int64), 0, 1, 0, 0},
    {&__pyx_kp_u_std_json, __pyx_k_std_json, sizeof(__pyx_k_std_json), 0, 1, 0, 0},
    {&__pyx_kp_u_std_pg_date, __pyx_k_std_pg_date, sizeof(__pyx_k_std_pg_date), 0, 1, 0, 0},
    {&__pyx_kp_u_std_pg_interval, __pyx_k_std_pg_interval, sizeof(__pyx_k_std_pg_interval), 0, 1, 0, 0},
    {&__pyx_kp_u_std_pg_json, __pyx_k_std_pg_json, sizeof(__pyx_k_std_pg_json), 0, 1, 0, 0},
    {&__pyx_kp_u_std_pg_timestamp, __pyx_k_std_pg_timestamp, sizeof(__pyx_k_std_pg_timestamp), 0, 1, 0, 0},
    {&__pyx_kp_u_std_pg_timestamptz, __pyx_k_std_pg_timestamptz, sizeof(__pyx_k_std_pg_timestamptz), 0, 1, 0, 0},
    {&__pyx_kp_u_std_str, __pyx_k_std_str, sizeof(__pyx_k_std_str), 0, 1, 0, 0},
    {&__pyx_kp_u_std_uuid, __pyx_k_std_uuid, sizeof(__pyx_k_std_uuid), 0, 1, 0, 0},
    {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
    {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
    {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
    {&__pyx_n_s_str_2, __pyx_k_str_2, sizeof(__pyx_k_str_2), 0, 0, 1, 1},
    {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
    {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
    {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
    {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
    {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
    {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
    {&__pyx_n_u_suggested_pool_concurrency, __pyx_k_suggested_pool_concurrency, sizeof(__pyx_k_suggested_pool_concurrency), 0, 1, 0, 1},
    {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
    {&__pyx_n_s_sync, __pyx_k_sync, sizeof(__pyx_k_sync), 0, 0, 1, 1},
    {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
    {&__pyx_n_u_system_config, __pyx_k_system_config, sizeof(__pyx_k_system_config), 0, 1, 0, 1},
    {&__pyx_n_s_terminate, __pyx_k_terminate, sizeof(__pyx_k_terminate), 0, 0, 1, 1},
    {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
    {&__pyx_kp_u_the_connection_has_been_closed, __pyx_k_the_connection_has_been_closed, sizeof(__pyx_k_the_connection_has_been_closed), 0, 1, 0, 0},
    {&__pyx_kp_u_the_connection_has_been_closed_b, __pyx_k_the_connection_has_been_closed_b, sizeof(__pyx_k_the_connection_has_been_closed_b), 0, 1, 0, 0},
    {&__pyx_kp_u_the_server_offered_the_following, __pyx_k_the_server_offered_the_following, sizeof(__pyx_k_the_server_offered_the_following), 0, 1, 0, 0},
    {&__pyx_kp_u_the_server_requested_SASL_authen, __pyx_k_the_server_requested_SASL_authen, sizeof(__pyx_k_the_server_requested_SASL_authen), 0, 1, 0, 0},
    {&__pyx_kp_u_the_server_requested_an_unsuppor, __pyx_k_the_server_requested_an_unsuppor, sizeof(__pyx_k_the_server_requested_an_unsuppor), 0, 1, 0, 0},
    {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
    {&__pyx_n_s_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 0, 1, 1},
    {&__pyx_n_u_tid, __pyx_k_tid, sizeof(__pyx_k_tid), 0, 1, 0, 1},
    {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
    {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
    {&__pyx_n_u_tname, __pyx_k_tname, sizeof(__pyx_k_tname), 0, 1, 0, 1},
    {&__pyx_kp_u_too_many_annotations, __pyx_k_too_many_annotations, sizeof(__pyx_k_too_many_annotations), 0, 1, 0, 0},
    {&__pyx_kp_u_too_many_elements_for_a_tuple, __pyx_k_too_many_elements_for_a_tuple, sizeof(__pyx_k_too_many_elements_for_a_tuple), 0, 1, 0, 0},
    {&__pyx_kp_u_too_many_elements_in_array_value, __pyx_k_too_many_elements_in_array_value, sizeof(__pyx_k_too_many_elements_in_array_value), 0, 1, 0, 0},
    {&__pyx_kp_u_too_many_elements_in_multirange, __pyx_k_too_many_elements_in_multirange, sizeof(__pyx_k_too_many_elements_in_multirange), 0, 1, 0, 0},
    {&__pyx_kp_u_too_many_elements_in_vector_valu, __pyx_k_too_many_elements_in_vector_valu, sizeof(__pyx_k_too_many_elements_in_vector_valu), 0, 1, 0, 0},
    {&__pyx_n_s_try_from, __pyx_k_try_from, sizeof(__pyx_k_try_from), 0, 0, 1, 1},
    {&__pyx_n_s_try_recv_eagerly, __pyx_k_try_recv_eagerly, sizeof(__pyx_k_try_recv_eagerly), 0, 0, 1, 1},
    {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
    {&__pyx_n_s_type_size, __pyx_k_type_size, sizeof(__pyx_k_type_size), 0, 0, 1, 1},
    {&__pyx_n_s_typeid, __pyx_k_typeid, sizeof(__pyx_k_typeid), 0, 0, 1, 1},
    {&__pyx_kp_u_typeid_must_be_a_UUID, __pyx_k_typeid_must_be_a_UUID, sizeof(__pyx_k_typeid_must_be_a_UUID), 0, 1, 0, 0},
    {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
    {&__pyx_n_s_typing, __pyx_k_typing, sizeof(__pyx_k_typing), 0, 0, 1, 1},
    {&__pyx_kp_s_typing_Optional_int, __pyx_k_typing_Optional_int, sizeof(__pyx_k_typing_Optional_int), 0, 0, 1, 0},
    {&__pyx_n_u_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 1, 0, 1},
    {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
    {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
    {&__pyx_kp_u_unable_to_decode_data_to_Python, __pyx_k_unable_to_decode_data_to_Python, sizeof(__pyx_k_unable_to_decode_data_to_Python), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_NULL_element_in_multi, __pyx_k_unexpected_NULL_element_in_multi, sizeof(__pyx_k_unexpected_NULL_element_in_multi), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_NULL_value_in_array_s, __pyx_k_unexpected_NULL_value_in_array_s, sizeof(__pyx_k_unexpected_NULL_value_in_array_s), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_message_type, __pyx_k_unexpected_message_type, sizeof(__pyx_k_unexpected_message_type), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_query_argument_codec, __pyx_k_unexpected_query_argument_codec, sizeof(__pyx_k_unexpected_query_argument_codec), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff, __pyx_k_unexpected_trailing_data_in_buff, sizeof(__pyx_k_unexpected_trailing_data_in_buff), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff_2, __pyx_k_unexpected_trailing_data_in_buff_2, sizeof(__pyx_k_unexpected_trailing_data_in_buff_2), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff_3, __pyx_k_unexpected_trailing_data_in_buff_3, sizeof(__pyx_k_unexpected_trailing_data_in_buff_3), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff_4, __pyx_k_unexpected_trailing_data_in_buff_4, sizeof(__pyx_k_unexpected_trailing_data_in_buff_4), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff_5, __pyx_k_unexpected_trailing_data_in_buff_5, sizeof(__pyx_k_unexpected_trailing_data_in_buff_5), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff_6, __pyx_k_unexpected_trailing_data_in_buff_6, sizeof(__pyx_k_unexpected_trailing_data_in_buff_6), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff_7, __pyx_k_unexpected_trailing_data_in_buff_7, sizeof(__pyx_k_unexpected_trailing_data_in_buff_7), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff_8, __pyx_k_unexpected_trailing_data_in_buff_8, sizeof(__pyx_k_unexpected_trailing_data_in_buff_8), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_buff_9, __pyx_k_unexpected_trailing_data_in_buff_9, sizeof(__pyx_k_unexpected_trailing_data_in_buff_9), 0, 1, 0, 0},
    {&__pyx_kp_u_unexpected_trailing_data_in_type, __pyx_k_unexpected_trailing_data_in_type, sizeof(__pyx_k_unexpected_trailing_data_in_type), 0, 1, 0, 0},
    {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
    {&__pyx_kp_u_unsupported_authentication_metho, __pyx_k_unsupported_authentication_metho, sizeof(__pyx_k_unsupported_authentication_metho), 0, 1, 0, 0},
    {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
    {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
    {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
    {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1},
    {&__pyx_n_u_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 1, 0, 1},
    {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
    {&__pyx_n_s_uuid, __pyx_k_uuid, sizeof(__pyx_k_uuid), 0, 0, 1, 1},
    {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
    {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
    {&__pyx_n_s_value_type, __pyx_k_value_type, sizeof(__pyx_k_value_type), 0, 0, 1, 1},
    {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
    {&__pyx_n_s_ver_buf, __pyx_k_ver_buf, sizeof(__pyx_k_ver_buf), 0, 0, 1, 1},
    {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
    {&__pyx_n_s_wait_for_connect, __pyx_k_wait_for_connect, sizeof(__pyx_k_wait_for_connect), 0, 0, 1, 1},
    {&__pyx_n_s_wait_for_disconnect, __pyx_k_wait_for_disconnect, sizeof(__pyx_k_wait_for_disconnect), 0, 0, 1, 1},
    {&__pyx_n_s_wait_for_message, __pyx_k_wait_for_message, sizeof(__pyx_k_wait_for_message), 0, 0, 1, 1},
    {&__pyx_n_u_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 1, 0, 1},
    {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
    {&__pyx_n_s_wkb, __pyx_k_wkb, sizeof(__pyx_k_wkb), 0, 0, 1, 1},
    {&__pyx_n_u_wkb, __pyx_k_wkb, sizeof(__pyx_k_wkb), 0, 1, 0, 1},
    {&__pyx_n_s_zfill, __pyx_k_zfill, sizeof(__pyx_k_zfill), 0, 0, 1, 1},
    {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
    {0, 0, 0, 0, 0, 0, 0}
  };
  return __Pyx_InitStrings(__pyx_string_tab);
}
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 23, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 48, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 38, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(1, 46, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 192, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 222, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 276, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(1, 284, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(3, 84, __pyx_L1_error)
  __pyx_builtin_LookupError = __Pyx_GetBuiltinName(__pyx_n_s_LookupError); if (!__pyx_builtin_LookupError) __PYX_ERR(4, 49, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(5, 107, __pyx_L1_error)
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(6, 209, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(7, 588, __pyx_L1_error)
  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(7, 1149, __pyx_L1_error)
  __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(8, 997, __pyx_L1_error)
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(2, 100, __pyx_L1_error)
  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 156, __pyx_L1_error)
  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 408, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 914, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0xe3b0c44, 0xda39a3e, 0xd41d8cd):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0xe3b0c44, 0xda39a3e, 0xd41d8cd) = ())" % __pyx_checksum
 */
  __pyx_tuple__2 = PyTuple_Pack(3, __pyx_int_238750788, __pyx_int_228825662, __pyx_int_222419149); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "View.MemoryView":582
 *     def suboffsets(self):
 *         if self.view.suboffsets == NULL:
 *             return (-1,) * self.view.ndim             # <<<<<<<<<<<<<<
 * 
 *         return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
 */
  __pyx_tuple__6 = PyTuple_New(1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(2, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_INCREF(__pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__6, 0, __pyx_int_neg_1)) __PYX_ERR(2, 582, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "View.MemoryView":679
 *     tup = <tuple>index if isinstance(index, tuple) else (index,)
 * 
 *     result = [slice(None)] * ndim             # <<<<<<<<<<<<<<
 *     have_slices = False
 *     seen_ellipsis = False
 */
  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) __PYX_ERR(2, 679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__7);
  __Pyx_GIVEREF(__pyx_slice__7);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
 */
  __pyx_tuple__10 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "cpython/datetime.pxd":308
 * cdef inline object timezone_new(object offset, object name=None):
 *     if PY_VERSION_HEX < 0x030700b1:
 *         raise RuntimeError('Time zones are not available from the C-API.')             # <<<<<<<<<<<<<<
 *     return __Pyx_TimeZone_FromOffsetAndName(offset, <PyObject*>name if name is not None else NULL)
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Time_zones_are_not_available_fro); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(12, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "gel/protocol/codecs/base.pyx":38
 * 
 *     def __init__(self):
 *         raise RuntimeError(             # <<<<<<<<<<<<<<
 *             'codecs are not supposed to be instantiated directly')
 * 
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_codecs_are_not_supposed_to_be_in); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "gel/protocol/codecs/base.pyx":161
 * 
 *         if self.encoder_flags & RECORD_ENCODER_INVALID:
 *             raise TypeError(             # <<<<<<<<<<<<<<
 *                 'argument tuples do not support objects')
 * 
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_argument_tuples_do_not_support_o); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "gel/protocol/codecs/base.pyx":184
 * 
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements for a tuple')             # <<<<<<<<<<<<<<
 * 
 *         if objlen != len(self.fields_codecs):
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_for_a_tuple); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "gel/protocol/codecs/base.pyx":204
 *                     value_repr = repr(item)
 *                     if len(value_repr) > 40:
 *                         value_repr = value_repr[:40] + '...'             # <<<<<<<<<<<<<<
 *                     raise errors.InvalidArgumentError(
 *                         'invalid input for query argument'
 */
  __pyx_slice__16 = PySlice_New(Py_None, __pyx_int_40, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(1, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__16);
  __Pyx_GIVEREF(__pyx_slice__16);

  /* "gel/protocol/codecs/array.pyx":58
 *         objlen = len(obj)
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements in array value')             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_array_value); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(5, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "gel/protocol/codecs/array.pyx":102
 * 
 *         if ndims > 1:
 *             raise RuntimeError('only 1-dimensional arrays are supported')             # <<<<<<<<<<<<<<
 * 
 *         if ndims == 0:
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_u_only_1_dimensional_arrays_are_su); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(5, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "gel/protocol/codecs/range.pyx":197
 *         objlen = len(obj)
 *         if objlen > _MAXINT32:
 *             raise ValueError('too many elements in multirange value')             # <<<<<<<<<<<<<<
 * 
 *         elem_data = WriteBuffer.new()
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_multirange); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(6, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "gel/protocol/codecs/range.pyx":232
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     'unexpected NULL element in multirange value')
 *             else:
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_u_unexpected_NULL_element_in_multi); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(6, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "gel/protocol/codecs/set.pyx":64
 *             return []
 *         elif ndims > 1:
 *             raise RuntimeError('expected a two-dimensional array for a '             # <<<<<<<<<<<<<<
 *                                'set of arrays')
 * 
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_u_expected_a_two_dimensional_array); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(15, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "gel/protocol/codecs/set.pyx":76
 *             recsize = <Py_ssize_t><uint32_t>hton.unpack_int32(frb_read(buf, 4))
 *             if recsize != 1:
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     'expected a record with a single element as an array set '
 *                     'element envelope')
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_u_expected_a_record_with_a_single); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(15, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "gel/protocol/codecs/set.pyx":84
 *             elem_len = hton.unpack_int32(frb_read(buf, 4))
 *             if elem_len == -1:
 *                 raise RuntimeError(             # <<<<<<<<<<<<<<
 *                     'unexpected NULL value in array set element ')
 * 
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_u_unexpected_NULL_value_in_array_s); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(15, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "gel/protocol/codecs/codecs.pyx":85
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):
 *         if format != 'python':
 *             raise ValueError('"python" is the only valid format')             # <<<<<<<<<<<<<<
 *         if not isinstance(typeid, uuid.UUID):
 *             raise TypeError('typeid must be a UUID')
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_u_python_is_the_only_valid_format); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(7, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "gel/protocol/codecs/codecs.pyx":87
 *             raise ValueError('"python" is the only valid format')
 *         if not isinstance(typeid, uuid.UUID):
 *             raise TypeError('typeid must be a UUID')             # <<<<<<<<<<<<<<
 *         basecodec = BASE_SCALAR_CODECS.get(typeid.bytes)
 *         if basecodec is None:
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_typeid_must_be_a_UUID); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(7, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "gel/protocol/codecs/codecs.pyx":113
 *             BaseCodec sub_codec
 * 
 *         if protocol_version >= (2, 0):             # <<<<<<<<<<<<<<
 *             desc_len = frb_get_len(spec) - 16 - 1
 * 
 */
  __pyx_tuple__31 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_0); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(7, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "gel/protocol/codecs/codecs.pyx":163
 *                 els = <uint16_t>hton.unpack_int16(frb_read(spec, 2))
 *                 if els != 1:
 *                     raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                         'cannot handle arrays with more than one dimension')
 *                 # First dimension length.
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_cannot_handle_arrays_with_more_t); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(7, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "gel/protocol/codecs/codecs.pyx":553
 *                     &elem_buf, codecs_list, protocol_version)
 *                 if frb_get_len(&elem_buf):
 *                     raise RuntimeError(             # <<<<<<<<<<<<<<
 *                         f'unexpected trailing data in type descriptor datum')
 *             else:
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_unexpected_trailing_data_in_type); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(7, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "gel/protocol/codecs/codecs.pyx":564
 * 
 *         if not codecs_list:
 *             raise RuntimeError(f'cannot not build codec; empty type desc')             # <<<<<<<<<<<<<<
 * 
 *         return codecs_list[-1]
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_cannot_not_build_codec_empty_typ); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(7, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "gel/protocol/codecs/codecs.pyx":596
 * cdef time_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if getattr(obj, 'tzinfo', None) is not None:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a naive time object (tzinfo is None) was expected')
 * 
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_a_naive_time_object_tzinfo_is_No); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(7, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "gel/protocol/codecs/codecs.pyx":607
 *     # let's ensure it doesn't have tzinfo anyways.
 *     if getattr(obj, 'tzinfo', None) is not None:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a naive date object (tzinfo is None) was expected')
 * 
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_u_a_naive_date_object_tzinfo_is_No); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(7, 607, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "gel/protocol/codecs/codecs.pyx":619
 * 
 *     if getattr(obj, 'tzinfo', None) is not None:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a naive datetime object (tzinfo is None) was expected')
 * 
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_u_a_naive_datetime_object_tzinfo_i); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(7, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "gel/protocol/codecs/codecs.pyx":627
 * cdef timestamptz_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 *     if not cpython.datetime.PyDateTime_Check(obj):
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a datetime.datetime object was expected')
 * 
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_u_a_datetime_datetime_object_was_e_2); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(7, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "gel/protocol/codecs/codecs.pyx":631
 * 
 *     if getattr(obj, 'tzinfo', None) is None:
 *         raise TypeError(             # <<<<<<<<<<<<<<
 *             f'a timezone-aware datetime object (tzinfo is not None) '
 *             f'was expected')
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_u_a_timezone_aware_datetime_object); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(7, 631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "gel/protocol/codecs/codecs.pyx":659
 *     months = hton.unpack_int32(frb_read(buf, 4))
 *     if days != 0 or months != 0:
 *         raise RuntimeError(f'non-zero reserved bytes in duration')             # <<<<<<<<<<<<<<
 * 
 *     return datetime.timedelta(microseconds=microseconds)
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_non_zero_reserved_bytes_in_durat); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(7, 659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "gel/protocol/codecs/codecs.pyx":716
 * 
 *     if microseconds != 0:
 *         raise ValueError("date duration has non-zero microseconds")             # <<<<<<<<<<<<<<
 * 
 *     return datatypes.DateDuration(days=days, months=months)
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_u_date_duration_has_non_zero_micro); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(7, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "gel/protocol/codecs/codecs.pyx":751
 *     objlen = len(obj)
 *     if objlen > PGVECTOR_MAX_DIM:
 *         raise ValueError('too many elements in vector value')             # <<<<<<<<<<<<<<
 * 
 *     buf.write_int32(4 + objlen*4)
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_u_too_many_elements_in_vector_valu); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(7, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "gel/protocol/codecs/codecs.pyx":1026
 * 
 *     if 'dim' not in obj:
 *         raise TypeError('"dim" key is missing')             # <<<<<<<<<<<<<<
 * 
 *     dim = obj['dim']
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_u_dim_key_is_missing); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(7, 1026, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "gel/protocol/codecs/codecs.pyx":1048
 *         if key != 'dim':
 *             if val == 0:
 *                 raise ValueError('elements in a sparse vector cannot be 0')             # <<<<<<<<<<<<<<
 *             buf.write_float(<float>val)
 * 
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_elements_in_a_sparse_vector_cann); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(7, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "gel/protocol/codecs/codecs.pyx":1094
 * ):
 *     if not isinstance(obj, decimal.Decimal) and not isinstance(obj, int):
 *         raise TypeError('expected a Decimal or an int')             # <<<<<<<<<<<<<<
 *     pgproto.numeric_encode_binary(settings, buf, obj)
 * 
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_u_expected_a_Decimal_or_an_int); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(7, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "gel/protocol/codecs/codecs.pyx":1104
 * cdef ensure_is_int(obj):
 *     if type(obj) is not int and not isinstance(obj, int):
 *         raise TypeError('expected an int')             # <<<<<<<<<<<<<<
 * 
 * cdef checked_int2_encode(pgproto.CodecContext settings, WriteBuffer buf, obj):
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_u_expected_an_int); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(7, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "gel/protocol/codecs/codecs.pyx":1166
 *         result = '-'
 *     elif sign != NUMERIC_POS:
 *         raise ValueError("bad bigint sign data")             # <<<<<<<<<<<<<<
 * 
 *     if dscale != 0:
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_u_bad_bigint_sign_data); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(7, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "gel/protocol/codecs/codecs.pyx":1169
 * 
 *     if dscale != 0:
 *         raise ValueError("bigint data has fractional part")             # <<<<<<<<<<<<<<
 * 
 *     if ndigits == 0:
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_u_bigint_data_has_fractional_part); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(7, 1169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "gel/protocol/codecs/codecs.pyx":1198
 *     # Just wrap the bytes into a named tuple with a single field `wkb`
 *     descriptor = datatypes.record_desc_new(
 *         ('wkb',), <object>NULL, <object>NULL)             # <<<<<<<<<<<<<<
 *     result = datatypes.namedtuple_new(
 *         datatypes.namedtuple_type_new(descriptor))
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_u_wkb); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(7, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "gel/protocol/protocol.pyx":186
 *         self.server_settings = {}
 *         self.reset_status()
 *         self.protocol_version = (PROTO_VER_MAJOR, PROTO_VER_MINOR)             # <<<<<<<<<<<<<<
 * 
 *         self.state_type_id = NULL_CODEC_ID
 */
  __pyx_tuple__54 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_0); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(8, 186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "gel/protocol/protocol.pyx":190
 *         self.state_type_id = NULL_CODEC_ID
 *         self.state_codec = None
 *         self.state_cache = (None, None)             # <<<<<<<<<<<<<<
 * 
 *     cdef reset_status(self):
 */
  __pyx_tuple__55 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(8, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "gel/protocol/protocol.pyx":311
 * 
 *         if not self.connected:
 *             raise RuntimeError('not connected')             # <<<<<<<<<<<<<<
 * 
 *         buf = WriteBuffer.new_message(PREPARE_MSG)
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_u_not_connected); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(8, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "gel/protocol/protocol.pyx":563
 *                 if mtype == DUMP_BLOCK_MSG:
 *                     if not header_received:
 *                         raise RuntimeError('data block before header block')             # <<<<<<<<<<<<<<
 *                     data_received = True
 * 
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_u_data_block_before_header_block); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(8, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "gel/protocol/protocol.pyx":572
 *                 elif mtype == DUMP_HEADER_BLOCK_MSG:
 *                     if header_received:
 *                         raise RuntimeError('more than one header block')             # <<<<<<<<<<<<<<
 *                     if data_received:
 *                         raise RuntimeError('header block after data block')
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_u_more_than_one_header_block); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(8, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "gel/protocol/protocol.pyx":574
 *                         raise RuntimeError('more than one header block')
 *                     if data_received:
 *                         raise RuntimeError('header block after data block')             # <<<<<<<<<<<<<<
 * 
 *                     header_received = True
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_u_header_block_after_data_block); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(8, 574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "gel/protocol/protocol.pyx":600
 * 
 *         if not header_received:
 *             raise RuntimeError('header block was not received')             # <<<<<<<<<<<<<<
 * 
 *         if exc is not None:
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_u_header_block_was_not_received); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(8, 600, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "gel/protocol/protocol.pyx":742
 * 
 *         if self.connected:
 *             raise RuntimeError('already connected')             # <<<<<<<<<<<<<<
 * 
 *         # protocol version
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_u_already_connected); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(8, 742, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "gel/protocol/protocol.pyx":785
 *                 self.buffer.finish_message()
 * 
 *                 if (major, minor) < (MIN_PROTO_VER_MAJOR, MIN_PROTO_VER_MINOR):             # <<<<<<<<<<<<<<
 *                     raise errors.ClientConnectionError(
 *                         f'the server requested an unsupported version of '
 */
  __pyx_tuple__76 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_13); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(8, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "gel/protocol/protocol.pyx":822
 *                     break
 *                 else:
 *                     raise RuntimeError('non-idle status after connect')             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_u_non_idle_status_after_connect); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(8, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "gel/protocol/protocol.pyx":832
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 'the server requested SASL authentication but did not '
 *                 'offer any methods')
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_u_the_server_requested_SASL_authen); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(8, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "gel/protocol/protocol.pyx":928
 * 
 *         if server_sig != expected_server_sig:
 *             raise RuntimeError(             # <<<<<<<<<<<<<<
 *                 f'server SCRAM proof does not match')
 * 
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_u_server_SCRAM_proof_does_not_matc); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(8, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "gel/protocol/protocol.pyx":1109
 *         if PG_DEBUG:
 *             if buf.get_message_type() != DATA_MSG:
 *                 raise RuntimeError('first message is not "DataMsg"')             # <<<<<<<<<<<<<<
 * 
 *             if not isinstance(result, list):
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_u_first_message_is_not_DataMsg); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(8, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "gel/protocol/protocol.pyx":1132
 *                 buflen = hton.unpack_int32(frb_read(rbuf, 4))
 *                 if frb_get_len(rbuf) != buflen:
 *                     raise RuntimeError('invalid buffer length')             # <<<<<<<<<<<<<<
 *             else:
 *                 # EdgeDB returns rows with one column; Postgres' rows
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_u_invalid_buffer_length); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(8, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "gel/protocol/protocol_v0.pyx":82
 *                     attrs = self.legacy_parse_headers()
 *                     cardinality = self.buffer.read_byte()
 *                     if self.protocol_version >= (0, 14):             # <<<<<<<<<<<<<<
 *                         in_dc, out_dc = self.parse_type_data(reg)
 *                     else:
 */
  __pyx_tuple__87 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_14); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(19, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum not in (0x0e1f4d2, 0x737459e, 0x53368d7):             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x0e1f4d2, 0x737459e, 0x53368d7) = (_dict, _dict_get, _dict_move_to_end, _maxsize))" % __pyx_checksum
 */
  __pyx_tuple__92 = PyTuple_Pack(3, __pyx_int_14808274, __pyx_int_121062814, __pyx_int_87255255); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_tuple__93 = PyTuple_Pack(3, __pyx_int_228165448, __pyx_int_113914406, __pyx_int_52716380); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_tuple__94 = PyTuple_Pack(3, __pyx_int_65974055, __pyx_int_34451156, __pyx_int_124019026); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_tuple__95 = PyTuple_Pack(3, __pyx_int_94322648, __pyx_int_262771094, __pyx_int_181010524); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(2, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__96 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state)
 */
  __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(2, 16, __pyx_L1_error)

  /* "EnumBase":28
 * cdef object __Pyx_EnumBase
 * class __Pyx_EnumBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):             # <<<<<<<<<<<<<<
 *         for v in cls:
 *             if v == value:
 */
  __pyx_tuple__100 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_value, __pyx_n_s_name, __pyx_n_s_v, __pyx_n_s_res); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_new, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(2, 28, __pyx_L1_error)
  __pyx_tuple__102 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "EnumBase":39
 *         cls.__members__[name] = res
 *         return res
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_repr, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(2, 39, __pyx_L1_error)

  /* "EnumBase":41
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 */
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_str, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(2, 41, __pyx_L1_error)

  /* "EnumBase":49
 * cdef object __Pyx_FlagBase
 * class __Pyx_FlagBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):             # <<<<<<<<<<<<<<
 *         for v in cls:
 *             if v == value:
 */
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_new, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(2, 49, __pyx_L1_error)

  /* "EnumBase":62
 *             cls.__members__[name] = res
 *         return res
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 */
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_repr, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(2, 62, __pyx_L1_error)

  /* "EnumBase":64
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 */
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_str, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(2, 64, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__109 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "View.MemoryView":100
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:
 *     if __import__("sys").version_info >= (3, 3):             # <<<<<<<<<<<<<<
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 *     else:
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(2, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_tuple__112 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(2, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "View.MemoryView":101
 * try:
 *     if __import__("sys").version_info >= (3, 3):
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence             # <<<<<<<<<<<<<<
 *     else:
 *         __pyx_collections_abc_Sequence = __import__("collections").Sequence
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(2, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "View.MemoryView":103
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 *     else:
 *         __pyx_collections_abc_Sequence = __import__("collections").Sequence             # <<<<<<<<<<<<<<
 * except:
 * 
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(2, 103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "View.MemoryView":309
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(2, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "View.MemoryView":310
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(2, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "View.MemoryView":311
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(2, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "View.MemoryView":314
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(2, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "View.MemoryView":315
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "gel/protocol/lru.pyx":89
 *         return iter(self._dict)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self._dict.clear()
 */
  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_lru_pyx, __pyx_n_s_clear, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 89, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_LRUMapping__set_state(self, __pyx_state)
 */
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(2, 16, __pyx_L1_error)

  /* "gel/protocol/codecs/edb_types.pxi":9
 * 
 * TYPE_IDS = {
 *     'anytype': uuid.UUID('00000000-0000-0000-0000-000000000001'),             # <<<<<<<<<<<<<<
 *     'anytuple': uuid.UUID('00000000-0000-0000-0000-000000000002'),
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "gel/protocol/codecs/edb_types.pxi":10
 * TYPE_IDS = {
 *     'anytype': uuid.UUID('00000000-0000-0000-0000-000000000001'),
 *     'anytuple': uuid.UUID('00000000-0000-0000-0000-000000000002'),             # <<<<<<<<<<<<<<
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_2); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(26, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "gel/protocol/codecs/edb_types.pxi":11
 *     'anytype': uuid.UUID('00000000-0000-0000-0000-000000000001'),
 *     'anytuple': uuid.UUID('00000000-0000-0000-0000-000000000002'),
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),             # <<<<<<<<<<<<<<
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_3); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(26, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "gel/protocol/codecs/edb_types.pxi":12
 *     'anytuple': uuid.UUID('00000000-0000-0000-0000-000000000002'),
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),             # <<<<<<<<<<<<<<
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_4); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(26, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "gel/protocol/codecs/edb_types.pxi":13
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),             # <<<<<<<<<<<<<<
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),
 */
  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_5); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(26, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "gel/protocol/codecs/edb_types.pxi":14
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),             # <<<<<<<<<<<<<<
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),
 */
  __pyx_tuple__129 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_6); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(26, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "gel/protocol/codecs/edb_types.pxi":15
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),             # <<<<<<<<<<<<<<
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),
 */
  __pyx_tuple__130 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_7); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(26, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "gel/protocol/codecs/edb_types.pxi":16
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),             # <<<<<<<<<<<<<<
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),
 */
  __pyx_tuple__131 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_8); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(26, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "gel/protocol/codecs/edb_types.pxi":17
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),             # <<<<<<<<<<<<<<
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_9); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(26, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "gel/protocol/codecs/edb_types.pxi":18
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),             # <<<<<<<<<<<<<<
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_10); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(26, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "gel/protocol/codecs/edb_types.pxi":19
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),             # <<<<<<<<<<<<<<
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),
 */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_11); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(26, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "gel/protocol/codecs/edb_types.pxi":20
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),             # <<<<<<<<<<<<<<
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_12); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(26, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "gel/protocol/codecs/edb_types.pxi":21
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),             # <<<<<<<<<<<<<<
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_13); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "gel/protocol/codecs/edb_types.pxi":22
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),             # <<<<<<<<<<<<<<
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_14); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(26, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "gel/protocol/codecs/edb_types.pxi":23
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),             # <<<<<<<<<<<<<<
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),
 */
  __pyx_tuple__138 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_15); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(26, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "gel/protocol/codecs/edb_types.pxi":24
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),             # <<<<<<<<<<<<<<
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_16); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "gel/protocol/codecs/edb_types.pxi":25
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),             # <<<<<<<<<<<<<<
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),
 */
  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_17); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(26, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "gel/protocol/codecs/edb_types.pxi":26
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),             # <<<<<<<<<<<<<<
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_18); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(26, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "gel/protocol/codecs/edb_types.pxi":27
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),             # <<<<<<<<<<<<<<
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_19); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(26, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "gel/protocol/codecs/edb_types.pxi":28
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),             # <<<<<<<<<<<<<<
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_20); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(26, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "gel/protocol/codecs/edb_types.pxi":29
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),             # <<<<<<<<<<<<<<
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),
 */
  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_21); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(26, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "gel/protocol/codecs/edb_types.pxi":30
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),             # <<<<<<<<<<<<<<
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_22); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(26, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "gel/protocol/codecs/edb_types.pxi":31
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),             # <<<<<<<<<<<<<<
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),
 */
  __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_23); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(26, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "gel/protocol/codecs/edb_types.pxi":32
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),             # <<<<<<<<<<<<<<
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),
 */
  __pyx_tuple__147 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_24); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(26, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "gel/protocol/codecs/edb_types.pxi":33
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),             # <<<<<<<<<<<<<<
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),
 */
  __pyx_tuple__148 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000000_25); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(26, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "gel/protocol/codecs/edb_types.pxi":34
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),             # <<<<<<<<<<<<<<
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),
 */
  __pyx_tuple__149 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000100); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(26, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);

  /* "gel/protocol/codecs/edb_types.pxi":35
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),             # <<<<<<<<<<<<<<
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),
 *     'std::pg::date': uuid.UUID('00000000-0000-0000-0000-000001000004'),
 */
  __pyx_tuple__150 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000100_2); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(26, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "gel/protocol/codecs/edb_types.pxi":36
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),             # <<<<<<<<<<<<<<
 *     'std::pg::date': uuid.UUID('00000000-0000-0000-0000-000001000004'),
 *     'std::pg::interval': uuid.UUID('00000000-0000-0000-0000-000001000005'),
 */
  __pyx_tuple__151 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000100_3); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(26, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "gel/protocol/codecs/edb_types.pxi":37
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),
 *     'std::pg::date': uuid.UUID('00000000-0000-0000-0000-000001000004'),             # <<<<<<<<<<<<<<
 *     'std::pg::interval': uuid.UUID('00000000-0000-0000-0000-000001000005'),
 * }
 */
  __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000100_4); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(26, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "gel/protocol/codecs/edb_types.pxi":38
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),
 *     'std::pg::date': uuid.UUID('00000000-0000-0000-0000-000001000004'),
 *     'std::pg::interval': uuid.UUID('00000000-0000-0000-0000-000001000005'),             # <<<<<<<<<<<<<<
 * }
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_u_00000000_0000_0000_0000_00000100_5); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(26, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "gel/protocol/codecs/base.pyx":29
 * 
 * cdef bytes NULL_CODEC_ID = b'\x00' * 16
 * cdef bytes EMPTY_TUPLE_CODEC_ID = TYPE_IDS.get('empty-tuple').bytes             # <<<<<<<<<<<<<<
 * 
 * EMPTY_NULL_DATA = b'\x00\x00\x00\x00'
 */
  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_kp_u_empty_tuple); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "gel/protocol/codecs/base.pyx":54
 *         return f'{level * " "}{self.name}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_tuple__158 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_describe_context); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);
  __pyx_codeobj__159 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_base_pyx, __pyx_n_s_make_type, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__159)) __PYX_ERR(1, 54, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":91
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return self.codec.make_type(describe_context)
 * 
 */
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_base_pyx, __pyx_n_s_make_type, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(1, 91, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":124
 *         return self.empty_tup
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_base_pyx, __pyx_n_s_make_type, 124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(1, 124, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":138
 *         self.name = 'null-codec'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_base_pyx, __pyx_n_s_make_type, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(1, 138, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":317
 *         self._codec = codecs.lookup('utf-8')
 * 
 *     cpdef get_text_codec(self):             # <<<<<<<<<<<<<<
 *         return self._codec
 * 
 */
  __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_base_pyx, __pyx_n_s_get_text_codec, 317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(1, 317, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/scalar.pyx":55
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         if self.base_codec is None:
 *             return describe.BaseScalarType(
 */
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_scalar_pyx, __pyx_n_s_make_type, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(13, 55, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/tuple.pyx":81
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_tuple__181 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_describe_context, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(14, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_tuple_pyx, __pyx_n_s_make_type, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(14, 81, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/namedtuple.pyx":78
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.NamedTupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_tuple__185 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_describe_context, __pyx_n_s_field, __pyx_n_s_codec); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_namedtuple_p, __pyx_n_s_make_type, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(3, 78, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/object.pyx":122
 *         buf.write_buffer(elem_data)
 * 
 *     def _make_missing_args_error_message(self, args):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */
  __pyx_tuple__189 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_descriptor, __pyx_n_s_required_args, __pyx_n_s_i, __pyx_n_s_name, __pyx_n_s_passed_args, __pyx_n_s_missed_args, __pyx_n_s_extra_args, __pyx_n_s_required, __pyx_n_s_error_message, __pyx_n_s_passed_args_repr); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(4, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_object_pyx, __pyx_n_s_make_missing_args_error_message, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(4, 122, __pyx_L1_error)

  /* "gel/protocol/codecs/object.pyx":194
 *         return result
 * 
 *     def get_dataclass_fields(self):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */
  __pyx_tuple__191 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_descriptor, __pyx_n_s_rv, __pyx_n_s_i, __pyx_n_s_name, __pyx_n_s_field); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(4, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_object_pyx, __pyx_n_s_get_dataclass_fields, 194, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(4, 194, __pyx_L1_error)

  /* "gel/protocol/codecs/object.pyx":230
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */
  __pyx_tuple__193 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_describe_context, __pyx_n_s_descriptor, __pyx_n_s_elements, __pyx_n_s_i, __pyx_n_s_codec, __pyx_n_s_name, __pyx_n_s_is_implicit); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(4, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_object_pyx, __pyx_n_s_make_type, 230, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(4, 230, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/array.pyx":157
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_array_pyx, __pyx_n_s_make_type, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(5, 157, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/range.pyx":150
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.RangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_range_pyx, __pyx_n_s_make_type, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(6, 150, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/range.pyx":251
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.MultiRangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_range_pyx, __pyx_n_s_make_type, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(6, 251, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/set.pyx":98
 *         return result
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_set_pyx, __pyx_n_s_make_type, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(15, 98, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/enum.pyx":63
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.EnumType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_enum_pyx, __pyx_n_s_make_type, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(16, 63, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(2, 3, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":79
 *         self.base_codec_overrides = {}
 * 
 *     def clear_cache(self):             # <<<<<<<<<<<<<<
 *         self.codecs.clear()
 *         self.codecs_build_cache.clear()
 */
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_codecs_pyx, __pyx_n_s_clear_cache, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(7, 79, __pyx_L1_error)

  /* "gel/protocol/codecs/codecs.pyx":83
 *         self.codecs_build_cache.clear()
 * 
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):             # <<<<<<<<<<<<<<
 *         if format != 'python':
 *             raise ValueError('"python" is the only valid format')
 */
  __pyx_tuple__217 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_typeid, __pyx_n_s_encoder, __pyx_n_s_decoder, __pyx_n_s_format, __pyx_n_s_basecodec); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(7, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_codecs_codecs_pyx, __pyx_n_s_set_type_codec, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(7, 83, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CodecsRegistry__set_state(self, __pyx_state)
 */
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(2, 16, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ExecuteContext__set_state(self, __pyx_state)
 */
  __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(2, 16, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":196
 *         self.last_details = None
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         return types.MappingProxyType(self.server_settings)
 * 
 */
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_get_settings, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(8, 196, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":199
 *         return types.MappingProxyType(self.server_settings)
 * 
 *     def is_in_transaction(self):             # <<<<<<<<<<<<<<
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)
 * 
 */
  __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_is_in_transaction, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(8, 199, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":202
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)
 * 
 *     def set_connection(self, con):             # <<<<<<<<<<<<<<
 *         self.con = weakref.ref(con)
 * 
 */
  __pyx_tuple__225 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_con); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(8, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);
  __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_set_connection, 202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(8, 202, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":205
 *         self.con = weakref.ref(con)
 * 
 *     cpdef abort(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_abort, 205, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(8, 205, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":211
 *         raise NotImplementedError
 * 
 *     async def wait_for_message(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_wait_for_message, 211, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(8, 211, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":214
 *         raise NotImplementedError
 * 
 *     async def try_recv_eagerly(self):             # <<<<<<<<<<<<<<
 *         # If there's data in the socket try reading it into the
 *         # buffer.  Needed for blocking-io connections.
 */
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_try_recv_eagerly, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(8, 214, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":219
 *         raise NotImplementedError
 * 
 *     async def wait_for_connect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_wait_for_connect, 219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(8, 219, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":222
 *         raise NotImplementedError
 * 
 *     async def wait_for_disconnect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_wait_for_disconnect, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(8, 222, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":302
 *         return buf
 * 
 *     async def _parse(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf, params
 */
  __pyx_tuple__228 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_buf, __pyx_n_s_params, __pyx_n_s_mtype, __pyx_n_s_type_size, __pyx_n_s_in_type_id, __pyx_n_s_out_type_id, __pyx_n_s_exc, __pyx_n_s_methname); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(8, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_parse, 302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(8, 302, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":365
 *                 f'does not return any data')
 * 
 *     async def _execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */
  __pyx_tuple__229 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_packet, __pyx_n_s_buf, __pyx_n_s_params, __pyx_n_s_mtype, __pyx_n_s_result, __pyx_n_s_exc, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(8, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_execute, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(8, 365, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":484
 *             return NULL_CODEC_ID, EMPTY_NULL_DATA
 * 
 *     async def execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         self.ensure_connected()
 *         self.reset_status()
 */
  __pyx_tuple__230 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(8, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_execute_2, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(8, 484, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":504
 *         return await self._execute(ctx)
 * 
 *     async def query(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:
 */
  __pyx_tuple__231 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_ret, __pyx_n_s_methname); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(8, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_query, 504, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(8, 504, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":533
 *                     return ret
 * 
 *     async def dump(self, header_callback, block_callback):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */
  __pyx_tuple__232 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_header_callback, __pyx_n_s_block_callback, __pyx_n_s_buf, __pyx_n_s_mtype, __pyx_n_s_header_received, __pyx_n_s_data_received, __pyx_n_s_exc); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(8, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_dump, 533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(8, 533, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":605
 *             raise exc
 * 
 *     async def _sync(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */
  __pyx_tuple__233 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_mtype); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(8, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_sync, 605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(8, 605, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":619
 *                 self.fallthrough()
 * 
 *     async def ping(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */
  __pyx_tuple__234 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_mtype, __pyx_n_s_exc); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(8, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_ping, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(8, 619, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":640
 *             raise exc
 * 
 *     async def restore(self, bytes header, data_gen):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */
  __pyx_tuple__235 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_header, __pyx_n_s_data_gen, __pyx_n_s_buf, __pyx_n_s_mtype, __pyx_n_s_exc, __pyx_n_s_data); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(8, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_restore, 640, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(8, 640, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":725
 *             raise exc
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         try:
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())
 */
  __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_terminate, 725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(8, 725, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":731
 *             pass
 * 
 *     async def connect(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer ver_buf
 */
  __pyx_tuple__237 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_ver_buf, __pyx_n_s_msg_buf, __pyx_n_s_buf, __pyx_n_s_mtype, __pyx_n_s_status, __pyx_n_s_handshake_buf, __pyx_n_s_params, __pyx_n_s_k, __pyx_n_s_v, __pyx_n_s_major, __pyx_n_s_minor); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(8, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);
  __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_connect, 731, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(8, 731, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":829
 *             self.buffer.finish_message()
 * 
 *     async def _auth_sasl(self):             # <<<<<<<<<<<<<<
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:
 */
  __pyx_tuple__238 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_num_methods, __pyx_n_s_methods, __pyx_n_s_i, __pyx_n_s_method, __pyx_n_s_client_nonce, __pyx_n_s_client_first, __pyx_n_s_client_first_bare, __pyx_n_s_msg_buf, __pyx_n_s_mtype, __pyx_n_s_exc, __pyx_n_s_status, __pyx_n_s_server_first, __pyx_n_s_server_nonce, __pyx_n_s_salt, __pyx_n_s_itercount, __pyx_n_s_client_final, __pyx_n_s_expected_server_sig, __pyx_n_s_server_final, __pyx_n_s_server_sig); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(8, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);
  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_pyx, __pyx_n_s_auth_sasl, 829, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(8, 829, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SansIOProtocol__set_state(self, __pyx_state)
 */
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(2, 16, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":32
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):
 *     async def _legacy_parse(             # <<<<<<<<<<<<<<
 *         self,
 *         query: str,
 */
  __pyx_tuple__242 = PyTuple_Pack(22, __pyx_n_s_self, __pyx_n_s_query, __pyx_n_s_reg, __pyx_n_s_output_format, __pyx_n_s_expect_one, __pyx_n_s_required_one, __pyx_n_s_implicit_limit, __pyx_n_s_inline_typenames, __pyx_n_s_inline_typeids, __pyx_n_s_allow_capabilities, __pyx_n_s_buf, __pyx_n_s_mtype, __pyx_n_s_in_dc, __pyx_n_s_out_dc, __pyx_n_s_type_size, __pyx_n_s_in_type_id, __pyx_n_s_out_type_id, __pyx_n_s_cardinality, __pyx_n_s_attrs_2, __pyx_n_s_exc, __pyx_n_s__241, __pyx_n_s_methname); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(19, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__242);
  __Pyx_GIVEREF(__pyx_tuple__242);
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 22, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_v0_pyx, __pyx_n_s_legacy_parse, 32, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(19, 32, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":156
 *         return cardinality, in_dc, out_dc, attrs
 * 
 *     async def _legacy_execute(             # <<<<<<<<<<<<<<
 *         self, BaseCodec in_dc, BaseCodec out_dc, args, kwargs
 *     ):
 */
  __pyx_tuple__243 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_in_dc, __pyx_n_s_out_dc, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_packet, __pyx_n_s_buf, __pyx_n_s_mtype, __pyx_n_s_result, __pyx_n_s_exc, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(19, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_v0_pyx, __pyx_n_s_legacy_execute, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(19, 156, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":228
 *         return result
 * 
 *     async def _legacy_optimistic_execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */
  __pyx_tuple__244 = PyTuple_Pack(26, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_packet, __pyx_n_s_buf, __pyx_n_s_mtype, __pyx_n_s_re_exec, __pyx_n_s_result, __pyx_n_s_new_cardinality, __pyx_n_s_query, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_reg, __pyx_n_s_output_format, __pyx_n_s_expect_one, __pyx_n_s_required_one, __pyx_n_s_implicit_limit, __pyx_n_s_inline_typenames, __pyx_n_s_inline_typeids, __pyx_n_s_allow_capabilities, __pyx_n_s_in_dc, __pyx_n_s_out_dc, __pyx_n_s_exc, __pyx_n_s_headers, __pyx_n_s_capabilities, __pyx_n_s_ex, __pyx_n_s_methname); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(19, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__244);
  __Pyx_GIVEREF(__pyx_tuple__244);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_v0_pyx, __pyx_n_s_legacy_optimistic_execute, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(19, 228, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":348
 *             return result
 * 
 *     async def legacy_execute_anonymous(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             BaseCodec in_dc
 */
  __pyx_tuple__245 = PyTuple_Pack(21, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_in_dc, __pyx_n_s_out_dc, __pyx_n_s_query, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_reg, __pyx_n_s_output_format, __pyx_n_s_expect_one, __pyx_n_s_required_one, __pyx_n_s_implicit_limit, __pyx_n_s_inline_typenames, __pyx_n_s_inline_typeids, __pyx_n_s_allow_capabilities, __pyx_n_s_codecs, __pyx_n_s_cardinality, __pyx_n_s_headers, __pyx_n_s_capabilities, __pyx_n_s_ret, __pyx_n_s_methname); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(19, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 21, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_v0_pyx, __pyx_n_s_legacy_execute_anonymous, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(19, 348, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":434
 *                     return ret
 * 
 *     async def legacy_simple_query(             # <<<<<<<<<<<<<<
 *         self, str query, capabilities: enums.Capability
 *     ):
 */
  __pyx_tuple__246 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_query, __pyx_n_s_capabilities, __pyx_n_s_buf, __pyx_n_s_mtype, __pyx_n_s_cap_bytes, __pyx_n_s_exc); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(19, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gel_protocol_protocol_v0_pyx, __pyx_n_s_legacy_simple_query, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(19, 434, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(2, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(self, __pyx_state)
 */
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(2, 16, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_LRUMapping(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_LRUMapping, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_CodecsRegistry, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_ExecuteContext, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SansIOProtocol, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(2, 1, __pyx_L1_error)
  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SansIOProtocolBac, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
  __pyx_umethod_PyDict_Type_update.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_update.method_name = &__pyx_n_s_update;
  if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(8, 1, __pyx_L1_error);
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_4097 = PyInt_FromLong(4097); if (unlikely(!__pyx_int_4097)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_10000 = PyInt_FromLong(10000L); if (unlikely(!__pyx_int_10000)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_65281 = PyInt_FromLong(65281L); if (unlikely(!__pyx_int_65281)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_65282 = PyInt_FromLong(65282L); if (unlikely(!__pyx_int_65282)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_65283 = PyInt_FromLong(65283L); if (unlikely(!__pyx_int_65283)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_65284 = PyInt_FromLong(65284L); if (unlikely(!__pyx_int_65284)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_14808274 = PyInt_FromLong(14808274L); if (unlikely(!__pyx_int_14808274)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_34451156 = PyInt_FromLong(34451156L); if (unlikely(!__pyx_int_34451156)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_52716380 = PyInt_FromLong(52716380L); if (unlikely(!__pyx_int_52716380)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_65974055 = PyInt_FromLong(65974055L); if (unlikely(!__pyx_int_65974055)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_84082689 = PyInt_FromLong(84082689L); if (unlikely(!__pyx_int_84082689)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_84082690 = PyInt_FromLong(84082690L); if (unlikely(!__pyx_int_84082690)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_84082945 = PyInt_FromLong(84082945L); if (unlikely(!__pyx_int_84082945)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_84082946 = PyInt_FromLong(84082946L); if (unlikely(!__pyx_int_84082946)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_87255255 = PyInt_FromLong(87255255L); if (unlikely(!__pyx_int_87255255)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_94322648 = PyInt_FromLong(94322648L); if (unlikely(!__pyx_int_94322648)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_113914406 = PyInt_FromLong(113914406L); if (unlikely(!__pyx_int_113914406)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_121062814 = PyInt_FromLong(121062814L); if (unlikely(!__pyx_int_121062814)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_124019026 = PyInt_FromLong(124019026L); if (unlikely(!__pyx_int_124019026)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_181010524 = PyInt_FromLong(181010524L); if (unlikely(!__pyx_int_181010524)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_228165448 = PyInt_FromLong(228165448L); if (unlikely(!__pyx_int_228165448)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_228825662 = PyInt_FromLong(228825662L); if (unlikely(!__pyx_int_228825662)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_238750788 = PyInt_FromLong(238750788L); if (unlikely(!__pyx_int_238750788)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_262771094 = PyInt_FromLong(262771094L); if (unlikely(!__pyx_int_262771094)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_0xffffffffffffffff = PyInt_FromString((char *)"0xffffffffffffffff", 0, 0); if (unlikely(!__pyx_int_0xffffffffffffffff)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(8, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  /* AssertionsEnabled.init */
  if (likely(__Pyx_init_assertions_enabled() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_module ### */

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_v_3gel_8protocol_8protocol__LRU_MARKER = Py_None; Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_DEFAULT_CODEC_CONTEXT = ((struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_CARDS_MAP = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_NULL_CODEC = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC = ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_ONE_EL_F32_ARRAY = Py_None; Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_ONE_EL16_ARRAY = Py_None; Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_ONE_EL_I32_ARRAY = Py_None; Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_OLD_ERROR_CODES = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_result_cardinality_mismatch_code = Py_None; Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_parameter_type_mismatch_code = Py_None; Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __pyx_v_3gel_8protocol_8protocol_FLUSH_MESSAGE = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __Pyx_OrderedDict = Py_None; Py_INCREF(Py_None);
  __Pyx_EnumBase = Py_None; Py_INCREF(Py_None);
  __Pyx_FlagBase = Py_None; Py_INCREF(Py_None);
  __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
  generic = Py_None; Py_INCREF(Py_None);
  strided = Py_None; Py_INCREF(Py_None);
  indirect = Py_None; Py_INCREF(Py_None);
  contiguous = Py_None; Py_INCREF(Py_None);
  indirect_contiguous = Py_None; Py_INCREF(Py_None);
  __Pyx_globals = ((PyObject*)Py_None); Py_INCREF(Py_None);
  __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
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_3gel_8protocol_8protocol_LRUMapping = &__pyx_vtable_3gel_8protocol_8protocol_LRUMapping;
  __pyx_vtable_3gel_8protocol_8protocol_LRUMapping.get = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_LRUMapping *, PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_10LRUMapping_get;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol_LRUMapping = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_LRUMapping_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_LRUMapping)) __PYX_ERR(0, 26, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_LRUMapping_spec, __pyx_ptype_3gel_8protocol_8protocol_LRUMapping) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_LRUMapping = &__pyx_type_3gel_8protocol_8protocol_LRUMapping;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_LRUMapping) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_LRUMapping->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_LRUMapping->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_LRUMapping->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_LRUMapping->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_LRUMapping, __pyx_vtabptr_3gel_8protocol_8protocol_LRUMapping) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_LRUMapping) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LRUMapping, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_LRUMapping) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_LRUMapping) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec = &__pyx_vtable_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_BaseCodec.get_tid = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *))__pyx_f_3gel_8protocol_8protocol_9BaseCodec_get_tid;
  __pyx_vtable_3gel_8protocol_8protocol_BaseCodec.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_9BaseCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_BaseCodec.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_9BaseCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_BaseCodec.dump = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args))__pyx_f_3gel_8protocol_8protocol_9BaseCodec_dump;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol_BaseCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_BaseCodec_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_BaseCodec)) __PYX_ERR(1, 35, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_BaseCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_BaseCodec) < 0) __PYX_ERR(1, 35, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_BaseCodec = &__pyx_type_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec) < 0) __PYX_ERR(1, 35, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_BaseCodec->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec, __pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec) < 0) __PYX_ERR(1, 35, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec) < 0) __PYX_ERR(1, 35, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BaseCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec) < 0) __PYX_ERR(1, 35, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_BaseCodec) < 0) __PYX_ERR(1, 35, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_CodecPythonOverride = &__pyx_vtable_3gel_8protocol_8protocol_CodecPythonOverride;
  __pyx_vtable_3gel_8protocol_8protocol_CodecPythonOverride.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_CodecPythonOverride.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_encode;
  __pyx_vtable_3gel_8protocol_8protocol_CodecPythonOverride.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_decode;
  __pyx_vtable_3gel_8protocol_8protocol_CodecPythonOverride.__pyx_base.dump = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args))__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_dump;
  __pyx_vtable_3gel_8protocol_8protocol_CodecPythonOverride.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_19CodecPythonOverride_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_CodecPythonOverride_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride)) __PYX_ERR(1, 58, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_CodecPythonOverride_spec, __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride) < 0) __PYX_ERR(1, 58, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride = &__pyx_type_3gel_8protocol_8protocol_CodecPythonOverride;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride) < 0) __PYX_ERR(1, 58, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride, __pyx_vtabptr_3gel_8protocol_8protocol_CodecPythonOverride) < 0) __PYX_ERR(1, 58, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride) < 0) __PYX_ERR(1, 58, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CodecPythonOverride, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride) < 0) __PYX_ERR(1, 58, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride) < 0) __PYX_ERR(1, 58, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_BaseRecordCodec = &__pyx_vtable_3gel_8protocol_8protocol_BaseRecordCodec;
  __pyx_vtable_3gel_8protocol_8protocol_BaseRecordCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_BaseRecordCodec.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_15BaseRecordCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_BaseRecordCodec._check_encoder = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseRecordCodec *))__pyx_f_3gel_8protocol_8protocol_15BaseRecordCodec__check_encoder;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_BaseRecordCodec_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec)) __PYX_ERR(1, 142, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_BaseRecordCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec) < 0) __PYX_ERR(1, 142, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec = &__pyx_type_3gel_8protocol_8protocol_BaseRecordCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec) < 0) __PYX_ERR(1, 142, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec, __pyx_vtabptr_3gel_8protocol_8protocol_BaseRecordCodec) < 0) __PYX_ERR(1, 142, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec) < 0) __PYX_ERR(1, 142, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BaseRecordCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec) < 0) __PYX_ERR(1, 142, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec) < 0) __PYX_ERR(1, 142, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_EmptyTupleCodec = &__pyx_vtable_3gel_8protocol_8protocol_EmptyTupleCodec;
  __pyx_vtable_3gel_8protocol_8protocol_EmptyTupleCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_EmptyTupleCodec.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_15EmptyTupleCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_EmptyTupleCodec.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_15EmptyTupleCodec_decode;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec)) __PYX_ERR(1, 95, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec) < 0) __PYX_ERR(1, 95, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec = &__pyx_type_3gel_8protocol_8protocol_EmptyTupleCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec) < 0) __PYX_ERR(1, 95, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec, __pyx_vtabptr_3gel_8protocol_8protocol_EmptyTupleCodec) < 0) __PYX_ERR(1, 95, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec) < 0) __PYX_ERR(1, 95, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EmptyTupleCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec) < 0) __PYX_ERR(1, 95, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec) < 0) __PYX_ERR(1, 95, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_NullCodec = &__pyx_vtable_3gel_8protocol_8protocol_NullCodec;
  __pyx_vtable_3gel_8protocol_8protocol_NullCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_3gel_8protocol_8protocol_NullCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_NullCodec_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_NullCodec)) __PYX_ERR(1, 132, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_NullCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_NullCodec) < 0) __PYX_ERR(1, 132, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_NullCodec = &__pyx_type_3gel_8protocol_8protocol_NullCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_NullCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_NullCodec) < 0) __PYX_ERR(1, 132, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_NullCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_NullCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_NullCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_NullCodec->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_NullCodec, __pyx_vtabptr_3gel_8protocol_8protocol_NullCodec) < 0) __PYX_ERR(1, 132, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_NullCodec) < 0) __PYX_ERR(1, 132, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_NullCodec) < 0) __PYX_ERR(1, 132, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_NullCodec) < 0) __PYX_ERR(1, 132, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_BaseNamedRecordCodec = &__pyx_vtable_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  __pyx_vtable_3gel_8protocol_8protocol_BaseNamedRecordCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseRecordCodec;
  __pyx_vtable_3gel_8protocol_8protocol_BaseNamedRecordCodec.__pyx_base.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_20BaseNamedRecordCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_BaseNamedRecordCodec.__pyx_base.__pyx_base.dump = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args))__pyx_f_3gel_8protocol_8protocol_20BaseNamedRecordCodec_dump;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec)) __PYX_ERR(1, 215, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec = &__pyx_type_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec, __pyx_vtabptr_3gel_8protocol_8protocol_BaseNamedRecordCodec) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BaseNamedRecordCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  #endif
  __pyx_t_1 = PyImport_ImportModule("gel.pgproto.pgproto"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_3gel_7pgproto_7pgproto_CodecContext = __Pyx_ImportType_3_0_12(__pyx_t_1, "gel.pgproto.pgproto", "CodecContext", sizeof(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_vtabptr_3gel_7pgproto_7pgproto_CodecContext = (struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_CodecContext*)__Pyx_GetVtable(__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext); if (unlikely(!__pyx_vtabptr_3gel_7pgproto_7pgproto_CodecContext)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_vtabptr_3gel_8protocol_8protocol_EdegDBCodecContext = &__pyx_vtable_3gel_8protocol_8protocol_EdegDBCodecContext;
  __pyx_vtable_3gel_8protocol_8protocol_EdegDBCodecContext.__pyx_base = *__pyx_vtabptr_3gel_7pgproto_7pgproto_CodecContext;
  __pyx_vtable_3gel_8protocol_8protocol_EdegDBCodecContext.__pyx_base.get_text_codec = (PyObject *(*)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, int __pyx_skip_dispatch))__pyx_f_3gel_8protocol_8protocol_18EdegDBCodecContext_get_text_codec;
  __pyx_vtable_3gel_8protocol_8protocol_EdegDBCodecContext.__pyx_base.is_encoding_utf8 = (PyObject *(*)(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *))__pyx_f_3gel_8protocol_8protocol_18EdegDBCodecContext_is_encoding_utf8;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_7pgproto_7pgproto_CodecContext); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext)) __PYX_ERR(1, 312, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext_spec, __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext) < 0) __PYX_ERR(1, 312, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext = &__pyx_type_3gel_8protocol_8protocol_EdegDBCodecContext;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext->tp_base = __pyx_ptype_3gel_7pgproto_7pgproto_CodecContext;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext) < 0) __PYX_ERR(1, 312, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext, __pyx_vtabptr_3gel_8protocol_8protocol_EdegDBCodecContext) < 0) __PYX_ERR(1, 312, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext) < 0) __PYX_ERR(1, 312, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EdegDBCodecContext, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext) < 0) __PYX_ERR(1, 312, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext) < 0) __PYX_ERR(1, 312, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_ScalarCodec = &__pyx_vtable_3gel_8protocol_8protocol_ScalarCodec;
  __pyx_vtable_3gel_8protocol_8protocol_ScalarCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_ScalarCodec.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_ScalarCodec.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_ScalarCodec.derive = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_ScalarCodec *, PyObject *))__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_derive;
  __pyx_vtable_3gel_8protocol_8protocol_ScalarCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, PyObject *, __pyx_t_3gel_7pgproto_7pgproto_encode_func, __pyx_t_3gel_7pgproto_7pgproto_decode_func))__pyx_f_3gel_8protocol_8protocol_11ScalarCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_ScalarCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec)) __PYX_ERR(13, 21, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_ScalarCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec) < 0) __PYX_ERR(13, 21, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec = &__pyx_type_3gel_8protocol_8protocol_ScalarCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec) < 0) __PYX_ERR(13, 21, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec, __pyx_vtabptr_3gel_8protocol_8protocol_ScalarCodec) < 0) __PYX_ERR(13, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec) < 0) __PYX_ERR(13, 21, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ScalarCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec) < 0) __PYX_ERR(13, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_ScalarCodec) < 0) __PYX_ERR(13, 21, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_TupleCodec = &__pyx_vtable_3gel_8protocol_8protocol_TupleCodec;
  __pyx_vtable_3gel_8protocol_8protocol_TupleCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseRecordCodec;
  __pyx_vtable_3gel_8protocol_8protocol_TupleCodec.__pyx_base.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_10TupleCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_TupleCodec.__pyx_base.__pyx_base.dump = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args))__pyx_f_3gel_8protocol_8protocol_10TupleCodec_dump;
  __pyx_vtable_3gel_8protocol_8protocol_TupleCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_10TupleCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_TupleCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_TupleCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_TupleCodec)) __PYX_ERR(14, 21, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_TupleCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_TupleCodec) < 0) __PYX_ERR(14, 21, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_TupleCodec = &__pyx_type_3gel_8protocol_8protocol_TupleCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_TupleCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseRecordCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_TupleCodec) < 0) __PYX_ERR(14, 21, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_TupleCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_TupleCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_TupleCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_TupleCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_TupleCodec, __pyx_vtabptr_3gel_8protocol_8protocol_TupleCodec) < 0) __PYX_ERR(14, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_TupleCodec) < 0) __PYX_ERR(14, 21, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TupleCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_TupleCodec) < 0) __PYX_ERR(14, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_TupleCodec) < 0) __PYX_ERR(14, 21, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_NamedTupleCodec = &__pyx_vtable_3gel_8protocol_8protocol_NamedTupleCodec;
  __pyx_vtable_3gel_8protocol_8protocol_NamedTupleCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  __pyx_vtable_3gel_8protocol_8protocol_NamedTupleCodec.__pyx_base.__pyx_base.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_15NamedTupleCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_NamedTupleCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_15NamedTupleCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_NamedTupleCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec)) __PYX_ERR(3, 21, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_NamedTupleCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec) < 0) __PYX_ERR(3, 21, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec = &__pyx_type_3gel_8protocol_8protocol_NamedTupleCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec) < 0) __PYX_ERR(3, 21, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec, __pyx_vtabptr_3gel_8protocol_8protocol_NamedTupleCodec) < 0) __PYX_ERR(3, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec) < 0) __PYX_ERR(3, 21, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NamedTupleCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec) < 0) __PYX_ERR(3, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec) < 0) __PYX_ERR(3, 21, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_ObjectCodec = &__pyx_vtable_3gel_8protocol_8protocol_ObjectCodec;
  __pyx_vtable_3gel_8protocol_8protocol_ObjectCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  __pyx_vtable_3gel_8protocol_8protocol_ObjectCodec.__pyx_base.__pyx_base.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_ObjectCodec.__pyx_base.__pyx_base.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_ObjectCodec.encode_args = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_ObjectCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_encode_args;
  __pyx_vtable_3gel_8protocol_8protocol_ObjectCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int))__pyx_f_3gel_8protocol_8protocol_11ObjectCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_ObjectCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec)) __PYX_ERR(4, 32, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_ObjectCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec = &__pyx_type_3gel_8protocol_8protocol_ObjectCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec, __pyx_vtabptr_3gel_8protocol_8protocol_ObjectCodec) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ObjectCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_ObjectCodec) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_BaseArrayCodec = &__pyx_vtable_3gel_8protocol_8protocol_BaseArrayCodec;
  __pyx_vtable_3gel_8protocol_8protocol_BaseArrayCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_BaseArrayCodec.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_BaseArrayCodec.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_BaseArrayCodec.__pyx_base.dump = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args))__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec_dump;
  __pyx_vtable_3gel_8protocol_8protocol_BaseArrayCodec._decode_array = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseArrayCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_14BaseArrayCodec__decode_array;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_BaseArrayCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec)) __PYX_ERR(5, 25, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_BaseArrayCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec) < 0) __PYX_ERR(5, 25, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec = &__pyx_type_3gel_8protocol_8protocol_BaseArrayCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec) < 0) __PYX_ERR(5, 25, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec, __pyx_vtabptr_3gel_8protocol_8protocol_BaseArrayCodec) < 0) __PYX_ERR(5, 25, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec) < 0) __PYX_ERR(5, 25, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BaseArrayCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec) < 0) __PYX_ERR(5, 25, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec) < 0) __PYX_ERR(5, 25, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_ArrayCodec = &__pyx_vtable_3gel_8protocol_8protocol_ArrayCodec;
  __pyx_vtable_3gel_8protocol_8protocol_ArrayCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseArrayCodec;
  __pyx_vtable_3gel_8protocol_8protocol_ArrayCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, int32_t))__pyx_f_3gel_8protocol_8protocol_10ArrayCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_ArrayCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec)) __PYX_ERR(5, 141, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_ArrayCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec) < 0) __PYX_ERR(5, 141, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec = &__pyx_type_3gel_8protocol_8protocol_ArrayCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec) < 0) __PYX_ERR(5, 141, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec, __pyx_vtabptr_3gel_8protocol_8protocol_ArrayCodec) < 0) __PYX_ERR(5, 141, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec) < 0) __PYX_ERR(5, 141, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArrayCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec) < 0) __PYX_ERR(5, 141, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_ArrayCodec) < 0) __PYX_ERR(5, 141, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_RangeCodec = &__pyx_vtable_3gel_8protocol_8protocol_RangeCodec;
  __pyx_vtable_3gel_8protocol_8protocol_RangeCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_RangeCodec.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_RangeCodec.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_RangeCodec.__pyx_base.dump = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args))__pyx_f_3gel_8protocol_8protocol_10RangeCodec_dump;
  __pyx_vtable_3gel_8protocol_8protocol_RangeCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *))__pyx_f_3gel_8protocol_8protocol_10RangeCodec_new;
  __pyx_vtable_3gel_8protocol_8protocol_RangeCodec.encode_range = (PyObject *(*)(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *))__pyx_f_3gel_8protocol_8protocol_10RangeCodec_encode_range;
  __pyx_vtable_3gel_8protocol_8protocol_RangeCodec.decode_range = (PyObject *(*)(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *))__pyx_f_3gel_8protocol_8protocol_10RangeCodec_decode_range;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_RangeCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_RangeCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_RangeCodec)) __PYX_ERR(6, 31, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_RangeCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_RangeCodec) < 0) __PYX_ERR(6, 31, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_RangeCodec = &__pyx_type_3gel_8protocol_8protocol_RangeCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_RangeCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_RangeCodec) < 0) __PYX_ERR(6, 31, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_RangeCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_RangeCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_RangeCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_RangeCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_RangeCodec, __pyx_vtabptr_3gel_8protocol_8protocol_RangeCodec) < 0) __PYX_ERR(6, 31, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_RangeCodec) < 0) __PYX_ERR(6, 31, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RangeCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_RangeCodec) < 0) __PYX_ERR(6, 31, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_RangeCodec) < 0) __PYX_ERR(6, 31, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_MultiRangeCodec = &__pyx_vtable_3gel_8protocol_8protocol_MultiRangeCodec;
  __pyx_vtable_3gel_8protocol_8protocol_MultiRangeCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_MultiRangeCodec.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_MultiRangeCodec.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_MultiRangeCodec.__pyx_base.dump = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_opt_args_3gel_8protocol_8protocol_9BaseCodec_dump *__pyx_optional_args))__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_dump;
  __pyx_vtable_3gel_8protocol_8protocol_MultiRangeCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *))__pyx_f_3gel_8protocol_8protocol_15MultiRangeCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_MultiRangeCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec)) __PYX_ERR(6, 159, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_MultiRangeCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec) < 0) __PYX_ERR(6, 159, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec = &__pyx_type_3gel_8protocol_8protocol_MultiRangeCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec) < 0) __PYX_ERR(6, 159, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec, __pyx_vtabptr_3gel_8protocol_8protocol_MultiRangeCodec) < 0) __PYX_ERR(6, 159, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec) < 0) __PYX_ERR(6, 159, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MultiRangeCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec) < 0) __PYX_ERR(6, 159, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec) < 0) __PYX_ERR(6, 159, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_SetCodec = &__pyx_vtable_3gel_8protocol_8protocol_SetCodec;
  __pyx_vtable_3gel_8protocol_8protocol_SetCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseArrayCodec;
  __pyx_vtable_3gel_8protocol_8protocol_SetCodec.__pyx_base.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_8SetCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_SetCodec._decode_array_set = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SetCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_8SetCodec__decode_array_set;
  __pyx_vtable_3gel_8protocol_8protocol_SetCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *))__pyx_f_3gel_8protocol_8protocol_8SetCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_SetCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_SetCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_SetCodec)) __PYX_ERR(15, 21, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_SetCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_SetCodec) < 0) __PYX_ERR(15, 21, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_SetCodec = &__pyx_type_3gel_8protocol_8protocol_SetCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_SetCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseArrayCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_SetCodec) < 0) __PYX_ERR(15, 21, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_SetCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_SetCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_SetCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_SetCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_SetCodec, __pyx_vtabptr_3gel_8protocol_8protocol_SetCodec) < 0) __PYX_ERR(15, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_SetCodec) < 0) __PYX_ERR(15, 21, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SetCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_SetCodec) < 0) __PYX_ERR(15, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_SetCodec) < 0) __PYX_ERR(15, 21, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_EnumCodec = &__pyx_vtable_3gel_8protocol_8protocol_EnumCodec;
  __pyx_vtable_3gel_8protocol_8protocol_EnumCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseCodec;
  __pyx_vtable_3gel_8protocol_8protocol_EnumCodec.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_9EnumCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_EnumCodec.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_9EnumCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_EnumCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_9EnumCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_EnumCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_EnumCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_EnumCodec)) __PYX_ERR(16, 23, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_EnumCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_EnumCodec) < 0) __PYX_ERR(16, 23, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_EnumCodec = &__pyx_type_3gel_8protocol_8protocol_EnumCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_EnumCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_EnumCodec) < 0) __PYX_ERR(16, 23, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_EnumCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_EnumCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_EnumCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_EnumCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_EnumCodec, __pyx_vtabptr_3gel_8protocol_8protocol_EnumCodec) < 0) __PYX_ERR(16, 23, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_EnumCodec) < 0) __PYX_ERR(16, 23, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EnumCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_EnumCodec) < 0) __PYX_ERR(16, 23, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_EnumCodec) < 0) __PYX_ERR(16, 23, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_RecordCodec = &__pyx_vtable_3gel_8protocol_8protocol_RecordCodec;
  __pyx_vtable_3gel_8protocol_8protocol_RecordCodec.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  __pyx_vtable_3gel_8protocol_8protocol_RecordCodec.__pyx_base.__pyx_base.__pyx_base.encode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_11RecordCodec_encode;
  __pyx_vtable_3gel_8protocol_8protocol_RecordCodec.__pyx_base.__pyx_base.__pyx_base.decode = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *))__pyx_f_3gel_8protocol_8protocol_11RecordCodec_decode;
  __pyx_vtable_3gel_8protocol_8protocol_RecordCodec.new = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(PyObject *, PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_11RecordCodec_new;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_RecordCodec = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_RecordCodec_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_RecordCodec)) __PYX_ERR(17, 21, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_RecordCodec_spec, __pyx_ptype_3gel_8protocol_8protocol_RecordCodec) < 0) __PYX_ERR(17, 21, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_RecordCodec = &__pyx_type_3gel_8protocol_8protocol_RecordCodec;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_RecordCodec->tp_base = __pyx_ptype_3gel_8protocol_8protocol_BaseNamedRecordCodec;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_RecordCodec) < 0) __PYX_ERR(17, 21, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_RecordCodec->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_RecordCodec->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_RecordCodec->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_RecordCodec->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_RecordCodec, __pyx_vtabptr_3gel_8protocol_8protocol_RecordCodec) < 0) __PYX_ERR(17, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_RecordCodec) < 0) __PYX_ERR(17, 21, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordCodec, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_RecordCodec) < 0) __PYX_ERR(17, 21, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_RecordCodec) < 0) __PYX_ERR(17, 21, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_CodecsRegistry = &__pyx_vtable_3gel_8protocol_8protocol_CodecsRegistry;
  __pyx_vtable_3gel_8protocol_8protocol_CodecsRegistry._build_codec = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry__build_codec;
  __pyx_vtable_3gel_8protocol_8protocol_CodecsRegistry.build_codec = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_build_codec;
  __pyx_vtable_3gel_8protocol_8protocol_CodecsRegistry.has_codec = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_has_codec;
  __pyx_vtable_3gel_8protocol_8protocol_CodecsRegistry.get_codec = (struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *(*)(struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14CodecsRegistry_get_codec;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_CodecsRegistry_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry)) __PYX_ERR(7, 72, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_CodecsRegistry_spec, __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry) < 0) __PYX_ERR(7, 72, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry = &__pyx_type_3gel_8protocol_8protocol_CodecsRegistry;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry) < 0) __PYX_ERR(7, 72, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry, __pyx_vtabptr_3gel_8protocol_8protocol_CodecsRegistry) < 0) __PYX_ERR(7, 72, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry) < 0) __PYX_ERR(7, 72, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CodecsRegistry, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry) < 0) __PYX_ERR(7, 72, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry) < 0) __PYX_ERR(7, 72, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_ExecuteContext = &__pyx_vtable_3gel_8protocol_8protocol_ExecuteContext;
  __pyx_vtable_3gel_8protocol_8protocol_ExecuteContext.has_na_cardinality = (int (*)(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *))__pyx_f_3gel_8protocol_8protocol_14ExecuteContext_has_na_cardinality;
  __pyx_vtable_3gel_8protocol_8protocol_ExecuteContext.load_from_cache = (int (*)(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *))__pyx_f_3gel_8protocol_8protocol_14ExecuteContext_load_from_cache;
  __pyx_vtable_3gel_8protocol_8protocol_ExecuteContext.store_to_cache = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *))__pyx_f_3gel_8protocol_8protocol_14ExecuteContext_store_to_cache;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_ExecuteContext_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext)) __PYX_ERR(8, 94, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_ExecuteContext_spec, __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext) < 0) __PYX_ERR(8, 94, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext = &__pyx_type_3gel_8protocol_8protocol_ExecuteContext;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext) < 0) __PYX_ERR(8, 94, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, __pyx_vtabptr_3gel_8protocol_8protocol_ExecuteContext) < 0) __PYX_ERR(8, 94, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext) < 0) __PYX_ERR(8, 94, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ExecuteContext, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext) < 0) __PYX_ERR(8, 94, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_ExecuteContext) < 0) __PYX_ERR(8, 94, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocol = &__pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.encode_args = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_args;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.encode_state = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_state;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_data_messages = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_data_messages;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_sync_message = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_sync_message;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_command_complete_message = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_command_complete_message;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_describe_type_message = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_describe_type_message;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_describe_state_message = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_describe_state_message;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_type_data = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_type_data;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol._amend_parse_error = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, PyObject *, enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, int, int))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol__amend_parse_error;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.ignore_headers = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ignore_headers;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.read_headers = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_read_headers;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_error_headers = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_error_headers;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.write_annotations = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_write_annotations;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_error_message = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_error_message;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.write = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_write;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.abort = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, int __pyx_skip_dispatch))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_abort;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.reset_status = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_reset_status;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_system_config = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_system_config;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.parse_server_settings = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, PyObject *, PyObject *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_parse_server_settings;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.fallthrough = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_fallthrough;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.ensure_connected = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_ensure_connected;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocol.encode_parse_params = (struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocol *, struct __pyx_obj_3gel_8protocol_8protocol_ExecuteContext *))__pyx_f_3gel_8protocol_8protocol_14SansIOProtocol_encode_parse_params;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_SansIOProtocol_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol)) __PYX_ERR(8, 170, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_SansIOProtocol_spec, __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol) < 0) __PYX_ERR(8, 170, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol = &__pyx_type_3gel_8protocol_8protocol_SansIOProtocol;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol) < 0) __PYX_ERR(8, 170, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocol) < 0) __PYX_ERR(8, 170, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol) < 0) __PYX_ERR(8, 170, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SansIOProtocol, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol) < 0) __PYX_ERR(8, 170, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol) < 0) __PYX_ERR(8, 170, __pyx_L1_error)
  #endif
  __pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible = &__pyx_vtable_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible.__pyx_base = *__pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocol;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible.parse_legacy_describe_type_message = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *, struct __pyx_obj_3gel_8protocol_8protocol_CodecsRegistry *))__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_parse_legacy_describe_type_message;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible.parse_legacy_command_complete_message = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *))__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_parse_legacy_command_complete_message;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible.legacy_write_headers = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *))__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_write_headers;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible.legacy_write_execute_headers = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, int, int, int, uint64_t))__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_write_execute_headers;
  __pyx_vtable_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible.legacy_parse_headers = (PyObject *(*)(struct __pyx_obj_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible *))__pyx_f_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_legacy_parse_headers;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol); if (unlikely(!__pyx_t_2)) __PYX_ERR(19, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible)) __PYX_ERR(19, 31, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible_spec, __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible) < 0) __PYX_ERR(19, 31, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible = &__pyx_type_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible->tp_base = __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible) < 0) __PYX_ERR(19, 31, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, __pyx_vtabptr_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible) < 0) __PYX_ERR(19, 31, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible) < 0) __PYX_ERR(19, 31, __pyx_L1_error)
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SansIOProtocolBackwardsCompatibl_6, (PyObject *) __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible) < 0) __PYX_ERR(19, 31, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible) < 0) __PYX_ERR(19, 31, __pyx_L1_error)
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type)) __PYX_ERR(14, 81, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type) < 0) __PYX_ERR(14, 81, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct__make_type;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type) < 0) __PYX_ERR(14, 81, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct__make_type->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr)) __PYX_ERR(14, 86, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(14, 86, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(14, 86, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_1_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr)) __PYX_ERR(16, 67, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(16, 67, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(16, 67, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_2_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message)) __PYX_ERR(8, 211, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message) < 0) __PYX_ERR(8, 211, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message) < 0) __PYX_ERR(8, 211, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_3_wait_for_message->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly)) __PYX_ERR(8, 214, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly) < 0) __PYX_ERR(8, 214, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly) < 0) __PYX_ERR(8, 214, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_4_try_recv_eagerly->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect)) __PYX_ERR(8, 219, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect) < 0) __PYX_ERR(8, 219, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect) < 0) __PYX_ERR(8, 219, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_5_wait_for_connect->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect)) __PYX_ERR(8, 222, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect) < 0) __PYX_ERR(8, 222, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect) < 0) __PYX_ERR(8, 222, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_6_wait_for_disconnect->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse)) __PYX_ERR(8, 302, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse) < 0) __PYX_ERR(8, 302, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_7__parse;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse) < 0) __PYX_ERR(8, 302, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_7__parse->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute)) __PYX_ERR(8, 365, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute) < 0) __PYX_ERR(8, 365, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_8__execute;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute) < 0) __PYX_ERR(8, 365, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_8__execute->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute)) __PYX_ERR(8, 484, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute) < 0) __PYX_ERR(8, 484, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_9_execute;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute) < 0) __PYX_ERR(8, 484, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_9_execute->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query)) __PYX_ERR(8, 504, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query) < 0) __PYX_ERR(8, 504, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_10_query;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query) < 0) __PYX_ERR(8, 504, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_10_query->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump)) __PYX_ERR(8, 533, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump) < 0) __PYX_ERR(8, 533, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_11_dump;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump) < 0) __PYX_ERR(8, 533, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_11_dump->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync)) __PYX_ERR(8, 605, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync) < 0) __PYX_ERR(8, 605, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_12__sync;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync) < 0) __PYX_ERR(8, 605, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_12__sync->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping)) __PYX_ERR(8, 619, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping) < 0) __PYX_ERR(8, 619, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_13_ping;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping) < 0) __PYX_ERR(8, 619, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_13_ping->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore)) __PYX_ERR(8, 640, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore) < 0) __PYX_ERR(8, 640, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_14_restore;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore) < 0) __PYX_ERR(8, 640, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_14_restore->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect)) __PYX_ERR(8, 731, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect) < 0) __PYX_ERR(8, 731, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_15_connect;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect) < 0) __PYX_ERR(8, 731, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_15_connect->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl)) __PYX_ERR(8, 829, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl) < 0) __PYX_ERR(8, 829, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl) < 0) __PYX_ERR(8, 829, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_16__auth_sasl->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse)) __PYX_ERR(19, 32, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_17__legacy_parse->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute)) __PYX_ERR(19, 156, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute) < 0) __PYX_ERR(19, 156, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute) < 0) __PYX_ERR(19, 156, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_18__legacy_execute->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute)) __PYX_ERR(19, 228, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute) < 0) __PYX_ERR(19, 228, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute) < 0) __PYX_ERR(19, 228, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_19__legacy_optimistic_execute->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous)) __PYX_ERR(19, 348, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous) < 0) __PYX_ERR(19, 348, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous) < 0) __PYX_ERR(19, 348, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_20_legacy_execute_anonymous->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query_spec, NULL); if (unlikely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query)) __PYX_ERR(19, 434, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query_spec, __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query) < 0) __PYX_ERR(19, 434, __pyx_L1_error)
  #else
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query = &__pyx_type_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query) < 0) __PYX_ERR(19, 434, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query->tp_dictoffset && __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype_3gel_8protocol_8protocol___pyx_scope_struct_21_legacy_simple_query->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)(&PyType_Type)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_ptype___Pyx_EnumMeta = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__Pyx_EnumMeta_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_ptype___Pyx_EnumMeta)) __PYX_ERR(2, 16, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__Pyx_EnumMeta_spec, __pyx_ptype___Pyx_EnumMeta) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  #else
  __pyx_ptype___Pyx_EnumMeta = &__Pyx_EnumMeta;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype___Pyx_EnumMeta->tp_dealloc = (&PyType_Type)->tp_dealloc;
  __pyx_ptype___Pyx_EnumMeta->tp_base = (&PyType_Type);
  __pyx_ptype___Pyx_EnumMeta->tp_new = (&PyType_Type)->tp_new;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_ptype___Pyx_EnumMeta) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_ptype___Pyx_EnumMeta->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype___Pyx_EnumMeta->tp_dictoffset && __pyx_ptype___Pyx_EnumMeta->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_ptype___Pyx_EnumMeta->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_ptype___Pyx_EnumMeta) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  #endif
  __pyx_vtabptr_array = &__pyx_vtable_array;
  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(2, 114, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
  if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
    __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
  }
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(2, 114, __pyx_L1_error)
  #else
  __pyx_array_type = &__pyx_type___pyx_array;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(2, 114, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_array_type->tp_print = 0;
  #endif
  if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 114, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(2, 114, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(2, 114, __pyx_L1_error)
  #endif
  #if CYTHON_USE_TYPE_SPECS
  __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(2, 302, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(2, 302, __pyx_L1_error)
  #else
  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(2, 302, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_MemviewEnum_type->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(2, 302, __pyx_L1_error)
  #endif
  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
  __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(2, 337, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
  if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
    __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
  }
  #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
  /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
  #elif defined(_MSC_VER)
  #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
  #else
  #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
  #endif
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(2, 337, __pyx_L1_error)
  #else
  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(2, 337, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_memoryview_type->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 337, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(2, 337, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(2, 337, __pyx_L1_error)
  #endif
  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
  __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_2);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(2, 952, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(2, 952, __pyx_L1_error)
  #else
  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(2, 952, __pyx_L1_error)
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_memoryviewslice_type->tp_print = 0;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 952, __pyx_L1_error)
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(2, 952, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(2, 952, __pyx_L1_error)
  #endif
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_RefNannyFinishContext();
  return -1;
}

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(20, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject),
  #elif CYTHON_COMPILING_IN_LIMITED_API
  sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject),
  #endif
  __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(20, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(21, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(22, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("datetime"); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "date", sizeof(PyDateTime_Date), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Date),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_date) __PYX_ERR(12, 70, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "time", sizeof(PyDateTime_Time), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Time),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_time) __PYX_ERR(12, 83, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "datetime", sizeof(PyDateTime_DateTime), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_DateTime),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_datetime) __PYX_ERR(12, 109, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "timedelta", sizeof(PyDateTime_Delta), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_Delta),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_timedelta) __PYX_ERR(12, 147, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType_3_0_12(__pyx_t_1, "datetime", "tzinfo", sizeof(PyDateTime_TZInfo), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyDateTime_TZInfo),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_8datetime_tzinfo) __PYX_ERR(12, 160, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("gel.pgproto.pgproto"); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer = __Pyx_ImportType_3_0_12(__pyx_t_1, "gel.pgproto.pgproto", "WriteBuffer", sizeof(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer) __PYX_ERR(11, 8, __pyx_L1_error)
  __pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer = (struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer*)__Pyx_GetVtable(__pyx_ptype_3gel_7pgproto_7pgproto_WriteBuffer); if (unlikely(!__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer)) __PYX_ERR(11, 8, __pyx_L1_error)
  __pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer = __Pyx_ImportType_3_0_12(__pyx_t_1, "gel.pgproto.pgproto", "ReadBuffer", sizeof(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_3gel_7pgproto_7pgproto_ReadBuffer),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer) __PYX_ERR(11, 68, __pyx_L1_error)
  __pyx_vtabptr_3gel_7pgproto_7pgproto_ReadBuffer = (struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_ReadBuffer*)__Pyx_GetVtable(__pyx_ptype_3gel_7pgproto_7pgproto_ReadBuffer); if (unlikely(!__pyx_vtabptr_3gel_7pgproto_7pgproto_ReadBuffer)) __PYX_ERR(11, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("gel.datatypes.datatypes"); if (unlikely(!__pyx_t_1)) __PYX_ERR(23, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_3gel_9datatypes_9datatypes_RelativeDuration = __Pyx_ImportType_3_0_12(__pyx_t_1, "gel.datatypes.datatypes", "RelativeDuration", sizeof(struct __pyx_obj_3gel_9datatypes_9datatypes_RelativeDuration), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_3gel_9datatypes_9datatypes_RelativeDuration),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_3gel_9datatypes_9datatypes_RelativeDuration) __PYX_ERR(23, 24, __pyx_L1_error)
  __pyx_ptype_3gel_9datatypes_9datatypes_DateDuration = __Pyx_ImportType_3_0_12(__pyx_t_1, "gel.datatypes.datatypes", "DateDuration", sizeof(struct __pyx_obj_3gel_9datatypes_9datatypes_DateDuration), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_3gel_9datatypes_9datatypes_DateDuration),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_3gel_9datatypes_9datatypes_DateDuration) __PYX_ERR(24, 24, __pyx_L1_error)
  __pyx_ptype_3gel_9datatypes_9datatypes_ConfigMemory = __Pyx_ImportType_3_0_12(__pyx_t_1, "gel.datatypes.datatypes", "ConfigMemory", sizeof(struct __pyx_obj_3gel_9datatypes_9datatypes_ConfigMemory), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_3gel_9datatypes_9datatypes_ConfigMemory),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_3gel_9datatypes_9datatypes_ConfigMemory) __PYX_ERR(25, 24, __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
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __pyx_t_1 = PyImport_ImportModule("gel.pgproto.pgproto"); if (!__pyx_t_1) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "frb_check", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_frb_check, "PyObject *(struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, Py_ssize_t)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "date_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_date_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "date_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_date_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "timestamp_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_timestamp_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "timestamp_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_timestamp_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "timestamptz_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_timestamptz_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "timestamptz_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_timestamptz_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "time_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_time_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "time_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_time_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "bool_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_bool_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "bool_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_bool_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "int2_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_int2_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "int2_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_int2_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "int4_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_int4_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "int4_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_int4_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "int8_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_int8_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "int8_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_int8_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "float4_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_float4_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "float4_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_float4_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "float8_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_float8_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "float8_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_float8_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "jsonb_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_jsonb_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "jsonb_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_jsonb_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "json_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_json_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "json_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_json_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "text_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_text_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "text_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_text_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "bytea_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_bytea_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "bytea_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_bytea_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "uuid_encode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_uuid_encode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "uuid_decode", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_uuid_decode, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "numeric_encode_binary", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_numeric_encode_binary, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "numeric_decode_binary_ex", (void (**)(void))&__pyx_f_3gel_7pgproto_7pgproto_numeric_decode_binary_ex, "PyObject *(struct __pyx_obj_3gel_7pgproto_7pgproto_CodecContext *, struct __pyx_t_3gel_7pgproto_7pgproto_FRBuffer *, int)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("gel.datatypes.datatypes"); if (!__pyx_t_1) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "record_desc_new", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_record_desc_new, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "record_desc_pointer_name", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_name, "PyObject *(PyObject *, Py_ssize_t)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "record_desc_pointer_card", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_card, "PyObject *(PyObject *, Py_ssize_t)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "record_desc_pointer_is_link_prop", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_link_prop, "PyObject *(PyObject *, Py_ssize_t)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "record_desc_pointer_is_link", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_link, "PyObject *(PyObject *, Py_ssize_t)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "record_desc_pointer_is_implicit", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_record_desc_pointer_is_implicit, "PyObject *(PyObject *, Py_ssize_t)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "namedtuple_new", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_namedtuple_new, "PyObject *(PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "namedtuple_type_new", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_namedtuple_type_new, "PyObject *(PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "object_new", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_object_new, "PyObject *(PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "object_set", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_object_set, "PyObject *(PyObject *, Py_ssize_t, PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "record_new", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_record_new, "PyObject *(PyObject *)") < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "record_set", (void (**)(void))&__pyx_f_3gel_9datatypes_9datatypes_record_set, "PyObject *(PyObject *, Py_ssize_t, PyObject *)") < 0) __PYX_ERR(8, 1, __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;
}


#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_protocol(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_protocol},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "protocol",
      0, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstate), /* 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
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#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 initprotocol(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initprotocol(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_protocol(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_protocol(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;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
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)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        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, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    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;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    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_protocol(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  static PyThread_type_lock __pyx_t_9[8];
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'protocol' 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
  /*--- 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("protocol", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(8, 1, __pyx_L1_error)
  #elif CYTHON_USE_MODULE_STATE
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 1, __pyx_L1_error)
  {
    int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "protocol" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(8, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #endif
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(8, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(8, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #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_protocol(void)", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(8, 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(8, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(8, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(8, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(8, 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
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(8, 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(8, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_gel__protocol__protocol) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(8, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "gel.protocol.protocol")) {
      if (unlikely((PyDict_SetItemString(modules, "gel.protocol.protocol", __pyx_m) < 0))) __PYX_ERR(8, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(8, 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();
  if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(8, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(8, 1, __pyx_L1_error)
  (void)__Pyx_modinit_variable_import_code();
  if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(8, 1, __pyx_L1_error)
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  #endif

  /* "EnumBase":10
 * cdef object __Pyx_OrderedDict
 * 
 * if PY_VERSION_HEX >= 0x03060000:             # <<<<<<<<<<<<<<
 *     __Pyx_OrderedDict = dict
 * else:
 */
  __pyx_t_2 = (PY_VERSION_HEX >= 0x03060000);
  if (__pyx_t_2) {

    /* "EnumBase":11
 * 
 * if PY_VERSION_HEX >= 0x03060000:
 *     __Pyx_OrderedDict = dict             # <<<<<<<<<<<<<<
 * else:
 *     from collections import OrderedDict as __Pyx_OrderedDict
 */
    __Pyx_INCREF((PyObject *)(&PyDict_Type));
    __Pyx_XGOTREF(__Pyx_OrderedDict);
    __Pyx_DECREF_SET(__Pyx_OrderedDict, ((PyObject *)(&PyDict_Type)));
    __Pyx_GIVEREF((PyObject *)(&PyDict_Type));

    /* "EnumBase":10
 * cdef object __Pyx_OrderedDict
 * 
 * if PY_VERSION_HEX >= 0x03060000:             # <<<<<<<<<<<<<<
 *     __Pyx_OrderedDict = dict
 * else:
 */
    goto __pyx_L2;
  }

  /* "EnumBase":13
 *     __Pyx_OrderedDict = dict
 * else:
 *     from collections import OrderedDict as __Pyx_OrderedDict             # <<<<<<<<<<<<<<
 * 
 * @cython.internal
 */
  /*else*/ {
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_n_s_OrderedDict);
    __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_OrderedDict)) __PYX_ERR(2, 13, __pyx_L1_error);
    __pyx_t_4 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XGOTREF(__Pyx_OrderedDict);
    __Pyx_DECREF_SET(__Pyx_OrderedDict, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_L2:;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumMeta_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Pyx_EnumMeta___reduce_cython, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype___Pyx_EnumMeta, __pyx_n_s_reduce_cython, __pyx_t_4) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype___Pyx_EnumMeta);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle___Pyx_EnumMeta, (type(self), 0xe3b0c44, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle___Pyx_EnumMeta__set_state(self, __pyx_state)
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumMeta_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Pyx_EnumMeta___setstate_cython, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype___Pyx_EnumMeta, __pyx_n_s_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype___Pyx_EnumMeta);

  /* "EnumBase":27
 * 
 * cdef object __Pyx_EnumBase
 * class __Pyx_EnumBase(int, metaclass=__Pyx_EnumMeta):             # <<<<<<<<<<<<<<
 *     def __new__(cls, value, name=None):
 *         for v in cls:
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF((PyObject *)(&PyInt_Type));
  __Pyx_GIVEREF((PyObject *)(&PyInt_Type));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(2, 27, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(((PyObject *)__pyx_ptype___Pyx_EnumMeta), __pyx_t_3, __pyx_n_s_Pyx_EnumBase, __pyx_n_s_Pyx_EnumBase, __pyx_t_5, __pyx_n_s_EnumBase, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_3 != __pyx_t_4) {
    if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(2, 27, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "EnumBase":28
 * cdef object __Pyx_EnumBase
 * class __Pyx_EnumBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):             # <<<<<<<<<<<<<<
 *         for v in cls:
 *             if v == value:
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Pyx_EnumBase___new, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__102);
  if (__Pyx_SetNewInClass(__pyx_t_6, __pyx_n_s_new, __pyx_t_4) < 0) __PYX_ERR(2, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "EnumBase":39
 *         cls.__members__[name] = res
 *         return res
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_3__repr__, 0, __pyx_n_s_Pyx_EnumBase___repr, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(2, 39, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "EnumBase":41
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_EnumBase_5__str__, 0, __pyx_n_s_Pyx_EnumBase___str, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_6, __pyx_n_s_str, __pyx_t_4) < 0) __PYX_ERR(2, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "EnumBase":27
 * 
 * cdef object __Pyx_EnumBase
 * class __Pyx_EnumBase(int, metaclass=__Pyx_EnumMeta):             # <<<<<<<<<<<<<<
 *     def __new__(cls, value, name=None):
 *         for v in cls:
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject *)__pyx_ptype___Pyx_EnumMeta), __pyx_n_s_Pyx_EnumBase, __pyx_t_3, __pyx_t_6, __pyx_t_5, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(__Pyx_EnumBase);
  __Pyx_DECREF_SET(__Pyx_EnumBase, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "EnumBase":44
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 * if PY_VERSION_HEX >= 0x03040000:             # <<<<<<<<<<<<<<
 *     from enum import IntEnum as __Pyx_EnumBase
 * 
 */
  __pyx_t_2 = (PY_VERSION_HEX >= 0x03040000);
  if (__pyx_t_2) {

    /* "EnumBase":45
 * 
 * if PY_VERSION_HEX >= 0x03040000:
 *     from enum import IntEnum as __Pyx_EnumBase             # <<<<<<<<<<<<<<
 * 
 * cdef object __Pyx_FlagBase
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_n_s_IntEnum);
    __Pyx_GIVEREF(__pyx_n_s_IntEnum);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_IntEnum)) __PYX_ERR(2, 45, __pyx_L1_error);
    __pyx_t_5 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_3, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XGOTREF(__Pyx_EnumBase);
    __Pyx_DECREF_SET(__Pyx_EnumBase, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "EnumBase":44
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 * if PY_VERSION_HEX >= 0x03040000:             # <<<<<<<<<<<<<<
 *     from enum import IntEnum as __Pyx_EnumBase
 * 
 */
  }

  /* "EnumBase":48
 * 
 * cdef object __Pyx_FlagBase
 * class __Pyx_FlagBase(int, metaclass=__Pyx_EnumMeta):             # <<<<<<<<<<<<<<
 *     def __new__(cls, value, name=None):
 *         for v in cls:
 */
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF((PyObject *)(&PyInt_Type));
  __Pyx_GIVEREF((PyObject *)(&PyInt_Type));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&PyInt_Type)))) __PYX_ERR(2, 48, __pyx_L1_error);
  __pyx_t_3 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(((PyObject *)__pyx_ptype___Pyx_EnumMeta), __pyx_t_3, __pyx_n_s_Pyx_FlagBase, __pyx_n_s_Pyx_FlagBase, __pyx_t_6, __pyx_n_s_EnumBase, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_3 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_4, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(2, 48, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "EnumBase":49
 * cdef object __Pyx_FlagBase
 * class __Pyx_FlagBase(int, metaclass=__Pyx_EnumMeta):
 *     def __new__(cls, value, name=None):             # <<<<<<<<<<<<<<
 *         for v in cls:
 *             if v == value:
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_FlagBase_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Pyx_FlagBase___new, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__102);
  if (__Pyx_SetNewInClass(__pyx_t_4, __pyx_n_s_new, __pyx_t_5) < 0) __PYX_ERR(2, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "EnumBase":62
 *             cls.__members__[name] = res
 *         return res
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_FlagBase_3__repr__, 0, __pyx_n_s_Pyx_FlagBase___repr, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(2, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "EnumBase":64
 *     def __repr__(self):
 *         return "<%s.%s: %d>" % (self.__class__.__name__, self.name, self)
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_14__Pyx_FlagBase_5__str__, 0, __pyx_n_s_Pyx_FlagBase___str, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_str, __pyx_t_5) < 0) __PYX_ERR(2, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "EnumBase":48
 * 
 * cdef object __Pyx_FlagBase
 * class __Pyx_FlagBase(int, metaclass=__Pyx_EnumMeta):             # <<<<<<<<<<<<<<
 *     def __new__(cls, value, name=None):
 *         for v in cls:
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject *)__pyx_ptype___Pyx_EnumMeta), __pyx_n_s_Pyx_FlagBase, __pyx_t_3, __pyx_t_4, __pyx_t_6, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_XGOTREF(__Pyx_FlagBase);
  __Pyx_DECREF_SET(__Pyx_FlagBase, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "EnumBase":67
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 * if PY_VERSION_HEX >= 0x03060000:             # <<<<<<<<<<<<<<
 *     from enum import IntFlag as __Pyx_FlagBase
 * 
 */
  __pyx_t_2 = (PY_VERSION_HEX >= 0x03060000);
  if (__pyx_t_2) {

    /* "EnumBase":68
 * 
 * if PY_VERSION_HEX >= 0x03060000:
 *     from enum import IntFlag as __Pyx_FlagBase             # <<<<<<<<<<<<<<
 * 
 */
    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_n_s_IntFlag);
    __Pyx_GIVEREF(__pyx_n_s_IntFlag);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_IntFlag)) __PYX_ERR(2, 68, __pyx_L1_error);
    __pyx_t_6 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_3, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_6, __pyx_n_s_IntFlag); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 68, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XGOTREF(__Pyx_FlagBase);
    __Pyx_DECREF_SET(__Pyx_FlagBase, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "EnumBase":67
 *         return "%s.%s" % (self.__class__.__name__, self.name)
 * 
 * if PY_VERSION_HEX >= 0x03060000:             # <<<<<<<<<<<<<<
 *     from enum import IntFlag as __Pyx_FlagBase
 * 
 */
  }

  /* "(tree fragment)":1
 * def __pyx_unpickle___Pyx_EnumMeta(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_8EnumBase_1__pyx_unpickle___Pyx_EnumMeta, 0, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta, NULL, __pyx_n_s_EnumBase, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle___Pyx_EnumMeta, __pyx_t_6) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "View.MemoryView":99
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     if __import__("sys").version_info >= (3, 3):
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "View.MemoryView":100
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:
 *     if __import__("sys").version_info >= (3, 3):             # <<<<<<<<<<<<<<
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 *     else:
 */
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 100, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 100, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_tuple__112, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 100, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 100, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_2) {

        /* "View.MemoryView":101
 * try:
 *     if __import__("sys").version_info >= (3, 3):
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence             # <<<<<<<<<<<<<<
 *     else:
 *         __pyx_collections_abc_Sequence = __import__("collections").Sequence
 */
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 101, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_abc); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 101, __pyx_L5_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_Sequence); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 101, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
        __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_6 = 0;

        /* "View.MemoryView":100
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:
 *     if __import__("sys").version_info >= (3, 3):             # <<<<<<<<<<<<<<
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 *     else:
 */
        goto __pyx_L11;
      }

      /* "View.MemoryView":103
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 *     else:
 *         __pyx_collections_abc_Sequence = __import__("collections").Sequence             # <<<<<<<<<<<<<<
 * except:
 * 
 */
      /*else*/ {
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 103, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 103, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
        __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
      }
      __pyx_L11:;

      /* "View.MemoryView":99
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     if __import__("sys").version_info >= (3, 3):
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L10_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":104
 *     else:
 *         __pyx_collections_abc_Sequence = __import__("collections").Sequence
 * except:             # <<<<<<<<<<<<<<
 * 
 *     __pyx_collections_abc_Sequence = None
 */
    /*except:*/ {
      __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(2, 104, __pyx_L7_except_error)
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);

      /* "View.MemoryView":106
 * except:
 * 
 *     __pyx_collections_abc_Sequence = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_INCREF(Py_None);
      __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
      __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_exception_handled;
    }

    /* "View.MemoryView":99
 * 
 * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
 * try:             # <<<<<<<<<<<<<<
 *     if __import__("sys").version_info >= (3, 3):
 *         __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
 */
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_7, __pyx_t_8);
    __pyx_L10_try_end:;
  }

  /* "View.MemoryView":241
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "View.MemoryView":242
 * 
 *     try:
 *         count = __pyx_collections_abc_Sequence.count             # <<<<<<<<<<<<<<
 *         index = __pyx_collections_abc_Sequence.index
 *     except:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 242, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_4) < 0) __PYX_ERR(2, 242, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      PyType_Modified(__pyx_array_type);

      /* "View.MemoryView":243
 *     try:
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index             # <<<<<<<<<<<<<<
 *     except:
 *         pass
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 243, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index_2, __pyx_t_4) < 0) __PYX_ERR(2, 243, __pyx_L14_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      PyType_Modified(__pyx_array_type);

      /* "View.MemoryView":241
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L19_try_end;
    __pyx_L14_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":244
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L15_exception_handled;
    }
    __pyx_L15_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_1);
    __pyx_L19_try_end:;
  }

  /* "View.MemoryView":309
 *         return self.name
 * 
 * cdef generic = Enum("<strided and direct or indirect>")             # <<<<<<<<<<<<<<
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")
 */
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(generic);
  __Pyx_DECREF_SET(generic, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":310
 * 
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default             # <<<<<<<<<<<<<<
 * cdef indirect = Enum("<strided and indirect>")
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(strided);
  __Pyx_DECREF_SET(strided, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":311
 * cdef generic = Enum("<strided and direct or indirect>")
 * cdef strided = Enum("<strided and direct>") # default
 * cdef indirect = Enum("<strided and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(indirect);
  __Pyx_DECREF_SET(indirect, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":314
 * 
 * 
 * cdef contiguous = Enum("<contiguous and direct>")             # <<<<<<<<<<<<<<
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(contiguous);
  __Pyx_DECREF_SET(contiguous, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":315
 * 
 * cdef contiguous = Enum("<contiguous and direct>")
 * cdef indirect_contiguous = Enum("<contiguous and indirect>")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_XGOTREF(indirect_contiguous);
  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "View.MemoryView":323
 * 
 * 
 * cdef int __pyx_memoryview_thread_locks_used = 0             # <<<<<<<<<<<<<<
 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
 *     PyThread_allocate_lock(),
 */
  __pyx_memoryview_thread_locks_used = 0;

  /* "View.MemoryView":324
 * 
 * cdef int __pyx_memoryview_thread_locks_used = 0
 * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [             # <<<<<<<<<<<<<<
 *     PyThread_allocate_lock(),
 *     PyThread_allocate_lock(),
 */
  __pyx_t_9[0] = PyThread_allocate_lock();
  __pyx_t_9[1] = PyThread_allocate_lock();
  __pyx_t_9[2] = PyThread_allocate_lock();
  __pyx_t_9[3] = PyThread_allocate_lock();
  __pyx_t_9[4] = PyThread_allocate_lock();
  __pyx_t_9[5] = PyThread_allocate_lock();
  __pyx_t_9[6] = PyThread_allocate_lock();
  __pyx_t_9[7] = PyThread_allocate_lock();
  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_9, sizeof(__pyx_memoryview_thread_locks[0]) * (8));

  /* "View.MemoryView":982
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_8);
    /*try:*/ {

      /* "View.MemoryView":983
 * 
 *     try:
 *         count = __pyx_collections_abc_Sequence.count             # <<<<<<<<<<<<<<
 *         index = __pyx_collections_abc_Sequence.index
 *     except:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 983, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_4) < 0) __PYX_ERR(2, 983, __pyx_L20_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      PyType_Modified(__pyx_memoryviewslice_type);

      /* "View.MemoryView":984
 *     try:
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index             # <<<<<<<<<<<<<<
 *     except:
 *         pass
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 984, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index_2, __pyx_t_4) < 0) __PYX_ERR(2, 984, __pyx_L20_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      PyType_Modified(__pyx_memoryviewslice_type);

      /* "View.MemoryView":982
 * 
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":985
 *         count = __pyx_collections_abc_Sequence.count
 *         index = __pyx_collections_abc_Sequence.index
 *     except:             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L21_exception_handled;
    }
    __pyx_L21_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_7, __pyx_t_8);
    __pyx_L25_try_end:;
  }

  /* "View.MemoryView":988
 *         pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     if __pyx_collections_abc_Sequence:
 * 
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_7, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "View.MemoryView":989
 * 
 * try:
 *     if __pyx_collections_abc_Sequence:             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(2, 989, __pyx_L26_error)
      if (__pyx_t_2) {

        /* "View.MemoryView":993
 * 
 * 
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)             # <<<<<<<<<<<<<<
 *         __pyx_collections_abc_Sequence.register(array)
 * except:
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 993, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 993, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "View.MemoryView":994
 * 
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)
 *         __pyx_collections_abc_Sequence.register(array)             # <<<<<<<<<<<<<<
 * except:
 *     pass  # ignore failure, it's a minor issue
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 994, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 994, __pyx_L26_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "View.MemoryView":989
 * 
 * try:
 *     if __pyx_collections_abc_Sequence:             # <<<<<<<<<<<<<<
 * 
 * 
 */
      }

      /* "View.MemoryView":988
 *         pass
 * 
 * try:             # <<<<<<<<<<<<<<
 *     if __pyx_collections_abc_Sequence:
 * 
 */
    }
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L31_try_end;
    __pyx_L26_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "View.MemoryView":995
 *         __pyx_collections_abc_Sequence.register(_memoryviewslice)
 *         __pyx_collections_abc_Sequence.register(array)
 * except:             # <<<<<<<<<<<<<<
 *     pass  # ignore failure, it's a minor issue
 * 
 */
    /*except:*/ {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L27_exception_handled;
    }
    __pyx_L27_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_7, __pyx_t_1);
    __pyx_L31_try_end:;
  }

  /* "(tree fragment)":1
 * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_4) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "EnumType":76
 *     object __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(InputLanguage value)
 * 
 * cdef dict __Pyx_globals = globals()             # <<<<<<<<<<<<<<
 * if PY_VERSION_HEX >= 0x03060000:
 * 
 */
  __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_4))) __PYX_ERR(2, 76, __pyx_L1_error)
  __Pyx_XGOTREF(__Pyx_globals);
  __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_4));
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;

  /* "EnumType":77
 * 
 * cdef dict __Pyx_globals = globals()
 * if PY_VERSION_HEX >= 0x03060000:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (PY_VERSION_HEX >= 0x03060000);
  if (__pyx_t_2) {

    /* "EnumType":81
 * 
 *     InputLanguage = __Pyx_FlagBase('InputLanguage', [
 *         ('EDGEQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(EDGEQL)),             # <<<<<<<<<<<<<<
 *         ('SQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(SQL)),
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(__pyx_e_3gel_8protocol_8protocol_EDGEQL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_n_s_EDGEQL);
    __Pyx_GIVEREF(__pyx_n_s_EDGEQL);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_EDGEQL)) __PYX_ERR(2, 81, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(2, 81, __pyx_L1_error);
    __pyx_t_4 = 0;

    /* "EnumType":82
 *     InputLanguage = __Pyx_FlagBase('InputLanguage', [
 *         ('EDGEQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(EDGEQL)),
 *         ('SQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(SQL)),             # <<<<<<<<<<<<<<
 * 
 *     ], module=__Pyx_globals.get("__module__", 'gel.protocol.protocol'))
 */
    __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(__pyx_e_3gel_8protocol_8protocol_SQL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_n_s_SQL);
    __Pyx_GIVEREF(__pyx_n_s_SQL);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SQL)) __PYX_ERR(2, 82, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(2, 82, __pyx_L1_error);
    __pyx_t_4 = 0;

    /* "EnumType":80
 * 
 * 
 *     InputLanguage = __Pyx_FlagBase('InputLanguage', [             # <<<<<<<<<<<<<<
 *         ('EDGEQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(EDGEQL)),
 *         ('SQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(SQL)),
 */
    __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(2, 80, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(2, 80, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_n_s_InputLanguage);
    __Pyx_GIVEREF(__pyx_n_s_InputLanguage);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_InputLanguage)) __PYX_ERR(2, 80, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(2, 80, __pyx_L1_error);
    __pyx_t_4 = 0;

    /* "EnumType":84
 *         ('SQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(SQL)),
 * 
 *     ], module=__Pyx_globals.get("__module__", 'gel.protocol.protocol'))             # <<<<<<<<<<<<<<
 * 
 *     if PY_VERSION_HEX >= 0x030B0000:
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
      __PYX_ERR(2, 84, __pyx_L1_error)
    }
    __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__Pyx_globals, __pyx_n_s_module, __pyx_n_s_gel_protocol_protocol); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_module_2, __pyx_t_6) < 0) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "EnumType":80
 * 
 * 
 *     InputLanguage = __Pyx_FlagBase('InputLanguage', [             # <<<<<<<<<<<<<<
 *         ('EDGEQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(EDGEQL)),
 *         ('SQL', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(SQL)),
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__Pyx_FlagBase, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_InputLanguage, __pyx_t_6) < 0) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "EnumType":86
 *     ], module=__Pyx_globals.get("__module__", 'gel.protocol.protocol'))
 * 
 *     if PY_VERSION_HEX >= 0x030B0000:             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = (PY_VERSION_HEX >= 0x030B0000);
    if (__pyx_t_2) {

      /* "EnumType":91
 * 
 * 
 *         InputLanguage._member_names_ = list(InputLanguage.__members__)             # <<<<<<<<<<<<<<
 * 
 *     __Pyx_globals['EDGEQL'] = InputLanguage.EDGEQL
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_InputLanguage); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_members); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InputLanguage); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_n_s_member_names, __pyx_t_6) < 0) __PYX_ERR(2, 91, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "EnumType":86
 *     ], module=__Pyx_globals.get("__module__", 'gel.protocol.protocol'))
 * 
 *     if PY_VERSION_HEX >= 0x030B0000:             # <<<<<<<<<<<<<<
 * 
 * 
 */
    }

    /* "EnumType":93
 *         InputLanguage._member_names_ = list(InputLanguage.__members__)
 * 
 *     __Pyx_globals['EDGEQL'] = InputLanguage.EDGEQL             # <<<<<<<<<<<<<<
 *     __Pyx_globals['SQL'] = InputLanguage.SQL
 * else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InputLanguage); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_EDGEQL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 93, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 93, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_EDGEQL, __pyx_t_6) < 0))) __PYX_ERR(2, 93, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "EnumType":94
 * 
 *     __Pyx_globals['EDGEQL'] = InputLanguage.EDGEQL
 *     __Pyx_globals['SQL'] = InputLanguage.SQL             # <<<<<<<<<<<<<<
 * else:
 *     class InputLanguage(__Pyx_FlagBase):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_InputLanguage); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_SQL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 94, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 94, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_SQL, __pyx_t_4) < 0))) __PYX_ERR(2, 94, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "EnumType":77
 * 
 * cdef dict __Pyx_globals = globals()
 * if PY_VERSION_HEX >= 0x03060000:             # <<<<<<<<<<<<<<
 * 
 * 
 */
    goto __pyx_L33;
  }

  /* "EnumType":96
 *     __Pyx_globals['SQL'] = InputLanguage.SQL
 * else:
 *     class InputLanguage(__Pyx_FlagBase):             # <<<<<<<<<<<<<<
 *         pass
 *     __Pyx_globals['EDGEQL'] = InputLanguage(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(EDGEQL), 'EDGEQL')
 */
  /*else*/ {
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__Pyx_FlagBase);
    __Pyx_GIVEREF(__Pyx_FlagBase);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __Pyx_FlagBase)) __PYX_ERR(2, 96, __pyx_L1_error);
    __pyx_t_6 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_6, __pyx_n_s_InputLanguage, __pyx_n_s_InputLanguage, (PyObject *) NULL, __pyx_n_s_EnumType, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_6 != __pyx_t_4) {
      if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(2, 96, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_InputLanguage, __pyx_t_6, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_InputLanguage, __pyx_t_4) < 0) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "EnumType":98
 *     class InputLanguage(__Pyx_FlagBase):
 *         pass
 *     __Pyx_globals['EDGEQL'] = InputLanguage(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(EDGEQL), 'EDGEQL')             # <<<<<<<<<<<<<<
 *     __Pyx_globals['SQL'] = InputLanguage(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(SQL), 'SQL')
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_InputLanguage); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(__pyx_e_3gel_8protocol_8protocol_EDGEQL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(2, 98, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_s_EDGEQL);
    __Pyx_GIVEREF(__pyx_n_s_EDGEQL);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_EDGEQL)) __PYX_ERR(2, 98, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 98, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_EDGEQL, __pyx_t_3) < 0))) __PYX_ERR(2, 98, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "EnumType":99
 *         pass
 *     __Pyx_globals['EDGEQL'] = InputLanguage(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(EDGEQL), 'EDGEQL')
 *     __Pyx_globals['SQL'] = InputLanguage(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(SQL), 'SQL')             # <<<<<<<<<<<<<<
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InputLanguage); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(__pyx_e_3gel_8protocol_8protocol_SQL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(2, 99, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_s_SQL);
    __Pyx_GIVEREF(__pyx_n_s_SQL);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_SQL)) __PYX_ERR(2, 99, __pyx_L1_error);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 99, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_SQL, __pyx_t_5) < 0))) __PYX_ERR(2, 99, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L33:;

  /* "EnumType":76
 *     object __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(OutputFormat value)
 * 
 * cdef dict __Pyx_globals = globals()             # <<<<<<<<<<<<<<
 * if PY_VERSION_HEX >= 0x03060000:
 * 
 */
  __pyx_t_5 = __Pyx_Globals(); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(PyDict_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None) || __Pyx_RaiseUnexpectedTypeError("dict", __pyx_t_5))) __PYX_ERR(2, 76, __pyx_L1_error)
  __Pyx_XGOTREF(__Pyx_globals);
  __Pyx_DECREF_SET(__Pyx_globals, ((PyObject*)__pyx_t_5));
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;

  /* "EnumType":77
 * 
 * cdef dict __Pyx_globals = globals()
 * if PY_VERSION_HEX >= 0x03060000:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = (PY_VERSION_HEX >= 0x03060000);
  if (__pyx_t_2) {

    /* "EnumType":81
 * 
 *     OutputFormat = __Pyx_FlagBase('OutputFormat', [
 *         ('BINARY', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY)),             # <<<<<<<<<<<<<<
 *         ('JSON', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON)),
 *         ('JSON_ELEMENTS', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON_ELEMENTS)),
 */
    __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_e_3gel_8protocol_8protocol_BINARY); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_n_s_BINARY);
    __Pyx_GIVEREF(__pyx_n_s_BINARY);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_n_s_BINARY)) __PYX_ERR(2, 81, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(2, 81, __pyx_L1_error);
    __pyx_t_5 = 0;

    /* "EnumType":82
 *     OutputFormat = __Pyx_FlagBase('OutputFormat', [
 *         ('BINARY', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY)),
 *         ('JSON', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON)),             # <<<<<<<<<<<<<<
 *         ('JSON_ELEMENTS', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON_ELEMENTS)),
 *         ('NONE', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(NONE)),
 */
    __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_e_3gel_8protocol_8protocol_JSON); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 82, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_n_s_JSON);
    __Pyx_GIVEREF(__pyx_n_s_JSON);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_JSON)) __PYX_ERR(2, 82, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(2, 82, __pyx_L1_error);
    __pyx_t_5 = 0;

    /* "EnumType":83
 *         ('BINARY', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY)),
 *         ('JSON', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON)),
 *         ('JSON_ELEMENTS', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON_ELEMENTS)),             # <<<<<<<<<<<<<<
 *         ('NONE', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(NONE)),
 * 
 */
    __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_e_3gel_8protocol_8protocol_JSON_ELEMENTS); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_n_s_JSON_ELEMENTS);
    __Pyx_GIVEREF(__pyx_n_s_JSON_ELEMENTS);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_JSON_ELEMENTS)) __PYX_ERR(2, 83, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5)) __PYX_ERR(2, 83, __pyx_L1_error);
    __pyx_t_5 = 0;

    /* "EnumType":84
 *         ('JSON', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON)),
 *         ('JSON_ELEMENTS', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON_ELEMENTS)),
 *         ('NONE', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(NONE)),             # <<<<<<<<<<<<<<
 * 
 *     ], module=__Pyx_globals.get("__module__", 'gel.protocol.protocol'))
 */
    __pyx_t_5 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_e_3gel_8protocol_8protocol_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_n_s_NONE);
    __Pyx_GIVEREF(__pyx_n_s_NONE);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_NONE)) __PYX_ERR(2, 84, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(2, 84, __pyx_L1_error);
    __pyx_t_5 = 0;

    /* "EnumType":80
 * 
 * 
 *     OutputFormat = __Pyx_FlagBase('OutputFormat', [             # <<<<<<<<<<<<<<
 *         ('BINARY', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY)),
 *         ('JSON', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON)),
 */
    __pyx_t_5 = PyList_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(2, 80, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(2, 80, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(2, 80, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 3, __pyx_t_10)) __PYX_ERR(2, 80, __pyx_L1_error);
    __pyx_t_6 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_10 = 0;
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_n_s_OutputFormat);
    __Pyx_GIVEREF(__pyx_n_s_OutputFormat);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_OutputFormat)) __PYX_ERR(2, 80, __pyx_L1_error);
    __Pyx_GIVEREF(__pyx_t_5);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(2, 80, __pyx_L1_error);
    __pyx_t_5 = 0;

    /* "EnumType":86
 *         ('NONE', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(NONE)),
 * 
 *     ], module=__Pyx_globals.get("__module__", 'gel.protocol.protocol'))             # <<<<<<<<<<<<<<
 * 
 *     if PY_VERSION_HEX >= 0x030B0000:
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
      __PYX_ERR(2, 86, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__Pyx_globals, __pyx_n_s_module, __pyx_n_s_gel_protocol_protocol); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_module_2, __pyx_t_4) < 0) __PYX_ERR(2, 86, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "EnumType":80
 * 
 * 
 *     OutputFormat = __Pyx_FlagBase('OutputFormat', [             # <<<<<<<<<<<<<<
 *         ('BINARY', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY)),
 *         ('JSON', __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON)),
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__Pyx_FlagBase, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutputFormat, __pyx_t_4) < 0) __PYX_ERR(2, 80, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "EnumType":88
 *     ], module=__Pyx_globals.get("__module__", 'gel.protocol.protocol'))
 * 
 *     if PY_VERSION_HEX >= 0x030B0000:             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = (PY_VERSION_HEX >= 0x030B0000);
    if (__pyx_t_2) {

      /* "EnumType":93
 * 
 * 
 *         OutputFormat._member_names_ = list(OutputFormat.__members__)             # <<<<<<<<<<<<<<
 * 
 *     __Pyx_globals['BINARY'] = OutputFormat.BINARY
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_members); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 93, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_member_names, __pyx_t_4) < 0) __PYX_ERR(2, 93, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "EnumType":88
 *     ], module=__Pyx_globals.get("__module__", 'gel.protocol.protocol'))
 * 
 *     if PY_VERSION_HEX >= 0x030B0000:             # <<<<<<<<<<<<<<
 * 
 * 
 */
    }

    /* "EnumType":95
 *         OutputFormat._member_names_ = list(OutputFormat.__members__)
 * 
 *     __Pyx_globals['BINARY'] = OutputFormat.BINARY             # <<<<<<<<<<<<<<
 *     __Pyx_globals['JSON'] = OutputFormat.JSON
 *     __Pyx_globals['JSON_ELEMENTS'] = OutputFormat.JSON_ELEMENTS
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_BINARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 95, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 95, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_BINARY, __pyx_t_4) < 0))) __PYX_ERR(2, 95, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "EnumType":96
 * 
 *     __Pyx_globals['BINARY'] = OutputFormat.BINARY
 *     __Pyx_globals['JSON'] = OutputFormat.JSON             # <<<<<<<<<<<<<<
 *     __Pyx_globals['JSON_ELEMENTS'] = OutputFormat.JSON_ELEMENTS
 *     __Pyx_globals['NONE'] = OutputFormat.NONE
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_JSON); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 96, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_JSON, __pyx_t_5) < 0))) __PYX_ERR(2, 96, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "EnumType":97
 *     __Pyx_globals['BINARY'] = OutputFormat.BINARY
 *     __Pyx_globals['JSON'] = OutputFormat.JSON
 *     __Pyx_globals['JSON_ELEMENTS'] = OutputFormat.JSON_ELEMENTS             # <<<<<<<<<<<<<<
 *     __Pyx_globals['NONE'] = OutputFormat.NONE
 * else:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_JSON_ELEMENTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 97, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_JSON_ELEMENTS, __pyx_t_4) < 0))) __PYX_ERR(2, 97, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "EnumType":98
 *     __Pyx_globals['JSON'] = OutputFormat.JSON
 *     __Pyx_globals['JSON_ELEMENTS'] = OutputFormat.JSON_ELEMENTS
 *     __Pyx_globals['NONE'] = OutputFormat.NONE             # <<<<<<<<<<<<<<
 * else:
 *     class OutputFormat(__Pyx_FlagBase):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 98, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 98, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_NONE, __pyx_t_5) < 0))) __PYX_ERR(2, 98, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "EnumType":77
 * 
 * cdef dict __Pyx_globals = globals()
 * if PY_VERSION_HEX >= 0x03060000:             # <<<<<<<<<<<<<<
 * 
 * 
 */
    goto __pyx_L35;
  }

  /* "EnumType":100
 *     __Pyx_globals['NONE'] = OutputFormat.NONE
 * else:
 *     class OutputFormat(__Pyx_FlagBase):             # <<<<<<<<<<<<<<
 *         pass
 *     __Pyx_globals['BINARY'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY), 'BINARY')
 */
  /*else*/ {
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__Pyx_FlagBase);
    __Pyx_GIVEREF(__Pyx_FlagBase);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __Pyx_FlagBase)) __PYX_ERR(2, 100, __pyx_L1_error);
    __pyx_t_4 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_4, __pyx_n_s_OutputFormat, __pyx_n_s_OutputFormat, (PyObject *) NULL, __pyx_n_s_EnumType, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_4 != __pyx_t_5) {
      if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(2, 100, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_OutputFormat, __pyx_t_4, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_OutputFormat, __pyx_t_5) < 0) __PYX_ERR(2, 100, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "EnumType":102
 *     class OutputFormat(__Pyx_FlagBase):
 *         pass
 *     __Pyx_globals['BINARY'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY), 'BINARY')             # <<<<<<<<<<<<<<
 *     __Pyx_globals['JSON'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON), 'JSON')
 *     __Pyx_globals['JSON_ELEMENTS'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON_ELEMENTS), 'JSON_ELEMENTS')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_e_3gel_8protocol_8protocol_BINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10)) __PYX_ERR(2, 102, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_s_BINARY);
    __Pyx_GIVEREF(__pyx_n_s_BINARY);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_BINARY)) __PYX_ERR(2, 102, __pyx_L1_error);
    __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 102, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_BINARY, __pyx_t_10) < 0))) __PYX_ERR(2, 102, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "EnumType":103
 *         pass
 *     __Pyx_globals['BINARY'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY), 'BINARY')
 *     __Pyx_globals['JSON'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON), 'JSON')             # <<<<<<<<<<<<<<
 *     __Pyx_globals['JSON_ELEMENTS'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON_ELEMENTS), 'JSON_ELEMENTS')
 *     __Pyx_globals['NONE'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(NONE), 'NONE')
 */
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_e_3gel_8protocol_8protocol_JSON); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(2, 103, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_s_JSON);
    __Pyx_GIVEREF(__pyx_n_s_JSON);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_JSON)) __PYX_ERR(2, 103, __pyx_L1_error);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 103, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_JSON, __pyx_t_3) < 0))) __PYX_ERR(2, 103, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "EnumType":104
 *     __Pyx_globals['BINARY'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(BINARY), 'BINARY')
 *     __Pyx_globals['JSON'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON), 'JSON')
 *     __Pyx_globals['JSON_ELEMENTS'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON_ELEMENTS), 'JSON_ELEMENTS')             # <<<<<<<<<<<<<<
 *     __Pyx_globals['NONE'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(NONE), 'NONE')
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_e_3gel_8protocol_8protocol_JSON_ELEMENTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_4);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4)) __PYX_ERR(2, 104, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_s_JSON_ELEMENTS);
    __Pyx_GIVEREF(__pyx_n_s_JSON_ELEMENTS);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_JSON_ELEMENTS)) __PYX_ERR(2, 104, __pyx_L1_error);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 104, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_JSON_ELEMENTS, __pyx_t_4) < 0))) __PYX_ERR(2, 104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "EnumType":105
 *     __Pyx_globals['JSON'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON), 'JSON')
 *     __Pyx_globals['JSON_ELEMENTS'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(JSON_ELEMENTS), 'JSON_ELEMENTS')
 *     __Pyx_globals['NONE'] = OutputFormat(__Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(NONE), 'NONE')             # <<<<<<<<<<<<<<
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_OutputFormat); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(__pyx_e_3gel_8protocol_8protocol_NONE); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_10);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10)) __PYX_ERR(2, 105, __pyx_L1_error);
    __Pyx_INCREF(__pyx_n_s_NONE);
    __Pyx_GIVEREF(__pyx_n_s_NONE);
    if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_NONE)) __PYX_ERR(2, 105, __pyx_L1_error);
    __pyx_t_10 = 0;
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__Pyx_globals == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(2, 105, __pyx_L1_error)
    }
    if (unlikely((PyDict_SetItem(__Pyx_globals, __pyx_n_s_NONE, __pyx_t_10) < 0))) __PYX_ERR(2, 105, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __pyx_L35:;

  /* "gel/protocol/protocol.pyx":24
 * cimport cpython.datetime
 * 
 * import asyncio             # <<<<<<<<<<<<<<
 * import collections
 * import datetime
 */
  __pyx_t_10 = __Pyx_patch_asyncio(__Pyx_ImportDottedModule(__pyx_n_s_asyncio, NULL)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asyncio, __pyx_t_10) < 0) __PYX_ERR(8, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":25
 * 
 * import asyncio
 * import collections             # <<<<<<<<<<<<<<
 * import datetime
 * import json
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_collections, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_10) < 0) __PYX_ERR(8, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":26
 * import asyncio
 * import collections
 * import datetime             # <<<<<<<<<<<<<<
 * import json
 * import time
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_10) < 0) __PYX_ERR(8, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":27
 * import collections
 * import datetime
 * import json             # <<<<<<<<<<<<<<
 * import time
 * import types
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_json, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_10) < 0) __PYX_ERR(8, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":28
 * import datetime
 * import json
 * import time             # <<<<<<<<<<<<<<
 * import types
 * import typing
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_time, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_10) < 0) __PYX_ERR(8, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":29
 * import json
 * import time
 * import types             # <<<<<<<<<<<<<<
 * import typing
 * import weakref
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_types, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_10) < 0) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":30
 * import time
 * import types
 * import typing             # <<<<<<<<<<<<<<
 * import weakref
 * 
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_typing, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_typing, __pyx_t_10) < 0) __PYX_ERR(8, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":31
 * import types
 * import typing
 * import weakref             # <<<<<<<<<<<<<<
 * 
 * from gel.pgproto.pgproto cimport (
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_weakref, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_weakref, __pyx_t_10) < 0) __PYX_ERR(8, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":47
 * )
 * 
 * from gel.pgproto import pgproto             # <<<<<<<<<<<<<<
 * from gel.pgproto cimport pgproto
 * from gel.pgproto cimport hton
 */
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_n_s_pgproto);
  __Pyx_GIVEREF(__pyx_n_s_pgproto);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_pgproto)) __PYX_ERR(8, 47, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_gel_pgproto, __pyx_t_10, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_pgproto); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pgproto, __pyx_t_10) < 0) __PYX_ERR(8, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":50
 * from gel.pgproto cimport pgproto
 * from gel.pgproto cimport hton
 * from gel.pgproto.pgproto import UUID             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_UUID);
  __Pyx_GIVEREF(__pyx_n_s_UUID);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_UUID)) __PYX_ERR(8, 50, __pyx_L1_error);
  __pyx_t_10 = __Pyx_Import(__pyx_n_s_gel_pgproto_pgproto, __pyx_t_3, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_10, __pyx_n_s_UUID); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UUID, __pyx_t_3) < 0) __PYX_ERR(8, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":60
 * from . cimport cpythonx
 * 
 * from gel import enums             # <<<<<<<<<<<<<<
 * from gel import errors
 * from gel import scram
 */
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_n_s_enums);
  __Pyx_GIVEREF(__pyx_n_s_enums);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_enums)) __PYX_ERR(8, 60, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_gel, __pyx_t_10, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_enums, __pyx_t_10) < 0) __PYX_ERR(8, 60, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":61
 * 
 * from gel import enums
 * from gel import errors             # <<<<<<<<<<<<<<
 * from gel import scram
 * 
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_errors);
  __Pyx_GIVEREF(__pyx_n_s_errors);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_errors)) __PYX_ERR(8, 61, __pyx_L1_error);
  __pyx_t_10 = __Pyx_Import(__pyx_n_s_gel, __pyx_t_3, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_10, __pyx_n_s_errors); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_3) < 0) __PYX_ERR(8, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":62
 * from gel import enums
 * from gel import errors
 * from gel import scram             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_n_s_scram);
  __Pyx_GIVEREF(__pyx_n_s_scram);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_scram)) __PYX_ERR(8, 62, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_gel, __pyx_t_10, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_scram); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_scram, __pyx_t_10) < 0) __PYX_ERR(8, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/lru.pyx":20
 * 
 * 
 * import collections             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_collections, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/lru.pyx":23
 * 
 * 
 * cdef object _LRU_MARKER = object()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol__LRU_MARKER);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol__LRU_MARKER, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "gel/protocol/lru.pyx":89
 *         return iter(self._dict)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self._dict.clear()
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10LRUMapping_15clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LRUMapping_clear, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_LRUMapping, __pyx_n_s_clear, __pyx_t_3) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_LRUMapping);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10LRUMapping_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LRUMapping___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_LRUMapping, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_LRUMapping);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_LRUMapping, (type(self), 0x0e1f4d2, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_LRUMapping__set_state(self, __pyx_state)
 */
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10LRUMapping_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LRUMapping___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_LRUMapping, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_LRUMapping);

  /* "gel/protocol/codecs/codecs.pyx":20
 * 
 * 
 * import array             # <<<<<<<<<<<<<<
 * import decimal
 * import uuid
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_array, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_3) < 0) __PYX_ERR(7, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":21
 * 
 * import array
 * import decimal             # <<<<<<<<<<<<<<
 * import uuid
 * import datetime
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_decimal, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decimal, __pyx_t_3) < 0) __PYX_ERR(7, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":22
 * import array
 * import decimal
 * import uuid             # <<<<<<<<<<<<<<
 * import datetime
 * from gel import describe
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_uuid, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uuid, __pyx_t_3) < 0) __PYX_ERR(7, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":23
 * import decimal
 * import uuid
 * import datetime             # <<<<<<<<<<<<<<
 * from gel import describe
 * from gel import enums
 */
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_datetime, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_3) < 0) __PYX_ERR(7, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":24
 * import uuid
 * import datetime
 * from gel import describe             # <<<<<<<<<<<<<<
 * from gel import enums
 * from gel.datatypes import datatypes
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_describe);
  __Pyx_GIVEREF(__pyx_n_s_describe);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_describe)) __PYX_ERR(7, 24, __pyx_L1_error);
  __pyx_t_10 = __Pyx_Import(__pyx_n_s_gel, __pyx_t_3, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_10, __pyx_n_s_describe); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_describe, __pyx_t_3) < 0) __PYX_ERR(7, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":25
 * import datetime
 * from gel import describe
 * from gel import enums             # <<<<<<<<<<<<<<
 * from gel.datatypes import datatypes
 * 
 */
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_n_s_enums);
  __Pyx_GIVEREF(__pyx_n_s_enums);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_enums)) __PYX_ERR(7, 25, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_gel, __pyx_t_10, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_enums, __pyx_t_10) < 0) __PYX_ERR(7, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/codecs.pyx":26
 * from gel import describe
 * from gel import enums
 * from gel.datatypes import datatypes             # <<<<<<<<<<<<<<
 * 
 * from libc.string cimport memcpy
 */
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_datatypes);
  __Pyx_GIVEREF(__pyx_n_s_datatypes);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_datatypes)) __PYX_ERR(7, 26, __pyx_L1_error);
  __pyx_t_10 = __Pyx_Import(__pyx_n_s_gel_datatypes, __pyx_t_3, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_10, __pyx_n_s_datatypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datatypes, __pyx_t_3) < 0) __PYX_ERR(7, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":5
 * 
 * 
 * import uuid             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_uuid, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uuid, __pyx_t_10) < 0) __PYX_ERR(26, 5, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":9
 * 
 * TYPE_IDS = {
 *     'anytype': uuid.UUID('00000000-0000-0000-0000-000000000001'),             # <<<<<<<<<<<<<<
 *     'anytuple': uuid.UUID('00000000-0000-0000-0000-000000000002'),
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(30); if (unlikely(!__pyx_t_10)) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_anytype, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":10
 * TYPE_IDS = {
 *     'anytype': uuid.UUID('00000000-0000-0000-0000-000000000001'),
 *     'anytuple': uuid.UUID('00000000-0000-0000-0000-000000000002'),             # <<<<<<<<<<<<<<
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_anytuple, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":11
 *     'anytype': uuid.UUID('00000000-0000-0000-0000-000000000001'),
 *     'anytuple': uuid.UUID('00000000-0000-0000-0000-000000000002'),
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),             # <<<<<<<<<<<<<<
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_u_std, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":12
 *     'anytuple': uuid.UUID('00000000-0000-0000-0000-000000000002'),
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),             # <<<<<<<<<<<<<<
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_empty_tuple, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":13
 *     'std': uuid.UUID('00000000-0000-0000-0000-0000000000f0'),
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),             # <<<<<<<<<<<<<<
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__128, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_uuid, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":14
 *     'empty-tuple': uuid.UUID('00000000-0000-0000-0000-0000000000ff'),
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),             # <<<<<<<<<<<<<<
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__129, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_str, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":15
 *     'std::uuid': uuid.UUID('00000000-0000-0000-0000-000000000100'),
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),             # <<<<<<<<<<<<<<
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__130, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_bytes, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":16
 *     'std::str': uuid.UUID('00000000-0000-0000-0000-000000000101'),
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),             # <<<<<<<<<<<<<<
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__131, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_int16, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":17
 *     'std::bytes': uuid.UUID('00000000-0000-0000-0000-000000000102'),
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),             # <<<<<<<<<<<<<<
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__132, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_int32, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":18
 *     'std::int16': uuid.UUID('00000000-0000-0000-0000-000000000103'),
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),             # <<<<<<<<<<<<<<
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_int64, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":19
 *     'std::int32': uuid.UUID('00000000-0000-0000-0000-000000000104'),
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),             # <<<<<<<<<<<<<<
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_float32, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":20
 *     'std::int64': uuid.UUID('00000000-0000-0000-0000-000000000105'),
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),             # <<<<<<<<<<<<<<
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_float64, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":21
 *     'std::float32': uuid.UUID('00000000-0000-0000-0000-000000000106'),
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),             # <<<<<<<<<<<<<<
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_decimal, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":22
 *     'std::float64': uuid.UUID('00000000-0000-0000-0000-000000000107'),
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),             # <<<<<<<<<<<<<<
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_bool, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":23
 *     'std::decimal': uuid.UUID('00000000-0000-0000-0000-000000000108'),
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),             # <<<<<<<<<<<<<<
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__138, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_datetime, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":24
 *     'std::bool': uuid.UUID('00000000-0000-0000-0000-000000000109'),
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),             # <<<<<<<<<<<<<<
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__139, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_cal_local_datetime, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":25
 *     'std::datetime': uuid.UUID('00000000-0000-0000-0000-00000000010a'),
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),             # <<<<<<<<<<<<<<
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_cal_local_date, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":26
 *     'cal::local_datetime': uuid.UUID('00000000-0000-0000-0000-00000000010b'),
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),             # <<<<<<<<<<<<<<
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__141, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_cal_local_time, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":27
 *     'cal::local_date': uuid.UUID('00000000-0000-0000-0000-00000000010c'),
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),             # <<<<<<<<<<<<<<
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_duration, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":28
 *     'cal::local_time': uuid.UUID('00000000-0000-0000-0000-00000000010d'),
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),             # <<<<<<<<<<<<<<
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_json, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":29
 *     'std::duration': uuid.UUID('00000000-0000-0000-0000-00000000010e'),
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),             # <<<<<<<<<<<<<<
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_bigint, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":30
 *     'std::json': uuid.UUID('00000000-0000-0000-0000-00000000010f'),
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),             # <<<<<<<<<<<<<<
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_cal_relative_duration, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":31
 *     'std::bigint': uuid.UUID('00000000-0000-0000-0000-000000000110'),
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),             # <<<<<<<<<<<<<<
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_cal_date_duration, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":32
 *     'cal::relative_duration': uuid.UUID('00000000-0000-0000-0000-000000000111'),
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),             # <<<<<<<<<<<<<<
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_cfg_memory, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":33
 *     'cal::date_duration': uuid.UUID('00000000-0000-0000-0000-000000000112'),
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),             # <<<<<<<<<<<<<<
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__148, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_fts_language, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":34
 *     'cfg::memory': uuid.UUID('00000000-0000-0000-0000-000000000130'),
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),             # <<<<<<<<<<<<<<
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__149, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_pg_json, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":35
 *     'fts::language': uuid.UUID('00000000-0000-0000-0000-000000000140'),
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),             # <<<<<<<<<<<<<<
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),
 *     'std::pg::date': uuid.UUID('00000000-0000-0000-0000-000001000004'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__150, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_pg_timestamptz, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":36
 *     'std::pg::json': uuid.UUID('00000000-0000-0000-0000-000001000001'),
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),             # <<<<<<<<<<<<<<
 *     'std::pg::date': uuid.UUID('00000000-0000-0000-0000-000001000004'),
 *     'std::pg::interval': uuid.UUID('00000000-0000-0000-0000-000001000005'),
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__151, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_pg_timestamp, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":37
 *     'std::pg::timestamptz': uuid.UUID('00000000-0000-0000-0000-000001000002'),
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),
 *     'std::pg::date': uuid.UUID('00000000-0000-0000-0000-000001000004'),             # <<<<<<<<<<<<<<
 *     'std::pg::interval': uuid.UUID('00000000-0000-0000-0000-000001000005'),
 * }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_pg_date, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/edb_types.pxi":38
 *     'std::pg::timestamp': uuid.UUID('00000000-0000-0000-0000-000001000003'),
 *     'std::pg::date': uuid.UUID('00000000-0000-0000-0000-000001000004'),
 *     'std::pg::interval': uuid.UUID('00000000-0000-0000-0000-000001000005'),             # <<<<<<<<<<<<<<
 * }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_uuid); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_UUID); if (unlikely(!__pyx_t_4)) __PYX_ERR(26, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(26, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_kp_u_std_pg_interval, __pyx_t_3) < 0) __PYX_ERR(26, 9, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TYPE_IDS, __pyx_t_10) < 0) __PYX_ERR(26, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/base.pyx":20
 * 
 * 
 * import codecs             # <<<<<<<<<<<<<<
 * 
 * from collections.abc import Mapping as MappingABC
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_codecs, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_codecs, __pyx_t_10) < 0) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/base.pyx":22
 * import codecs
 * 
 * from collections.abc import Mapping as MappingABC             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_n_s_Mapping);
  __Pyx_GIVEREF(__pyx_n_s_Mapping);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_Mapping)) __PYX_ERR(1, 22, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_kp_s_collections_abc, __pyx_t_10, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MappingABC, __pyx_t_10) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/base.pyx":25
 * 
 * 
 * cdef uint64_t RECORD_ENCODER_CHECKED = 1 << 0             # <<<<<<<<<<<<<<
 * cdef uint64_t RECORD_ENCODER_INVALID = 1 << 1
 * 
 */
  __pyx_v_3gel_8protocol_8protocol_RECORD_ENCODER_CHECKED = 0x1;

  /* "gel/protocol/codecs/base.pyx":26
 * 
 * cdef uint64_t RECORD_ENCODER_CHECKED = 1 << 0
 * cdef uint64_t RECORD_ENCODER_INVALID = 1 << 1             # <<<<<<<<<<<<<<
 * 
 * cdef bytes NULL_CODEC_ID = b'\x00' * 16
 */
  __pyx_v_3gel_8protocol_8protocol_RECORD_ENCODER_INVALID = 0x2;

  /* "gel/protocol/codecs/base.pyx":28
 * cdef uint64_t RECORD_ENCODER_INVALID = 1 << 1
 * 
 * cdef bytes NULL_CODEC_ID = b'\x00' * 16             # <<<<<<<<<<<<<<
 * cdef bytes EMPTY_TUPLE_CODEC_ID = TYPE_IDS.get('empty-tuple').bytes
 * 
 */
  __Pyx_INCREF(__pyx_kp_b__154);
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC_ID, __pyx_kp_b__154);
  __Pyx_GIVEREF(__pyx_kp_b__154);

  /* "gel/protocol/codecs/base.pyx":29
 * 
 * cdef bytes NULL_CODEC_ID = b'\x00' * 16
 * cdef bytes EMPTY_TUPLE_CODEC_ID = TYPE_IDS.get('empty-tuple').bytes             # <<<<<<<<<<<<<<
 * 
 * EMPTY_NULL_DATA = b'\x00\x00\x00\x00'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_TYPE_IDS); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __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_bytes); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_10))) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC_ID, ((PyObject*)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/base.pyx":31
 * cdef bytes EMPTY_TUPLE_CODEC_ID = TYPE_IDS.get('empty-tuple').bytes
 * 
 * EMPTY_NULL_DATA = b'\x00\x00\x00\x00'             # <<<<<<<<<<<<<<
 * EMPTY_RECORD_DATA = b'\x00\x00\x00\x04\x00\x00\x00\x00'
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMPTY_NULL_DATA, __pyx_kp_b__156) < 0) __PYX_ERR(1, 31, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":32
 * 
 * EMPTY_NULL_DATA = b'\x00\x00\x00\x00'
 * EMPTY_RECORD_DATA = b'\x00\x00\x00\x04\x00\x00\x00\x00'             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMPTY_RECORD_DATA, __pyx_kp_b__157) < 0) __PYX_ERR(1, 32, __pyx_L1_error)

  /* "gel/protocol/codecs/base.pyx":54
 *         return f'{level * " "}{self.name}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9BaseCodec_5make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__159)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_BaseCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(1, 54, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_BaseCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9BaseCodec_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9BaseCodec_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/base.pyx":91
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return self.codec.make_type(describe_context)
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_19CodecPythonOverride_3make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecPythonOverride_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(1, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_CodecPythonOverride);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_19CodecPythonOverride_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecPythonOverride___reduce_cyt, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_19CodecPythonOverride_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecPythonOverride___setstate_c, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/base.pyx":124
 *         return self.empty_tup
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15EmptyTupleCodec_3make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EmptyTupleCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(1, 124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15EmptyTupleCodec_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EmptyTupleCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15EmptyTupleCodec_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EmptyTupleCodec___setstate_cytho, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/base.pyx":138
 *         self.name = 'null-codec'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9NullCodec_3make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NullCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_NullCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(1, 138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_NullCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9NullCodec_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NullCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9NullCodec_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NullCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15BaseRecordCodec_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseRecordCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15BaseRecordCodec_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseRecordCodec___setstate_cytho, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_20BaseNamedRecordCodec_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseNamedRecordCodec___reduce_cy, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_20BaseNamedRecordCodec_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseNamedRecordCodec___setstate, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/base.pyx":317
 *         self._codec = codecs.lookup('utf-8')
 * 
 *     cpdef get_text_codec(self):             # <<<<<<<<<<<<<<
 *         return self._codec
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_18EdegDBCodecContext_3get_text_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EdegDBCodecContext_get_text_code, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext, __pyx_n_s_get_text_codec, __pyx_t_10) < 0) __PYX_ERR(1, 317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_18EdegDBCodecContext_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EdegDBCodecContext___reduce_cyth, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_18EdegDBCodecContext_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EdegDBCodecContext___setstate_cy, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/base.pyx":324
 * 
 * 
 * cdef EdegDBCodecContext DEFAULT_CODEC_CONTEXT = EdegDBCodecContext()             # <<<<<<<<<<<<<<
 */
  __pyx_t_10 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_EdegDBCodecContext)); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_XGOTREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_DEFAULT_CODEC_CONTEXT);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_DEFAULT_CODEC_CONTEXT, ((struct __pyx_obj_3gel_8protocol_8protocol_EdegDBCodecContext *)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/scalar.pyx":55
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         if self.base_codec is None:
 *             return describe.BaseScalarType(
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11ScalarCodec_3make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ScalarCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_10)) __PYX_ERR(13, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(13, 55, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_ScalarCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11ScalarCodec_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ScalarCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11ScalarCodec_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ScalarCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/tuple.pyx":81
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.TupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10TupleCodec_1make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TupleCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_10)) __PYX_ERR(14, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_TupleCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(14, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_TupleCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10TupleCodec_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TupleCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10TupleCodec_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TupleCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/namedtuple.pyx":78
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.NamedTupleType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15NamedTupleCodec_1make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamedTupleCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(3, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_NamedTupleCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15NamedTupleCodec_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamedTupleCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15NamedTupleCodec_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NamedTupleCodec___setstate_cytho, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/object.pyx":19
 * #
 * 
 * import dataclasses             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_dataclasses, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dataclasses, __pyx_t_10) < 0) __PYX_ERR(4, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/object.pyx":23
 * 
 * cdef dict CARDS_MAP = {
 *     datatypes.EdgeFieldCardinality.NO_RESULT: enums.Cardinality.NO_RESULT,             # <<<<<<<<<<<<<<
 *     datatypes.EdgeFieldCardinality.AT_MOST_ONE: enums.Cardinality.AT_MOST_ONE,
 *     datatypes.EdgeFieldCardinality.ONE: enums.Cardinality.ONE,
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyInt_From_EdgeFieldCardinality(NO_RESULT); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_enums); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Cardinality); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_NO_RESULT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/object.pyx":24
 * cdef dict CARDS_MAP = {
 *     datatypes.EdgeFieldCardinality.NO_RESULT: enums.Cardinality.NO_RESULT,
 *     datatypes.EdgeFieldCardinality.AT_MOST_ONE: enums.Cardinality.AT_MOST_ONE,             # <<<<<<<<<<<<<<
 *     datatypes.EdgeFieldCardinality.ONE: enums.Cardinality.ONE,
 *     datatypes.EdgeFieldCardinality.MANY: enums.Cardinality.MANY,
 */
  __pyx_t_4 = __Pyx_PyInt_From_EdgeFieldCardinality(AT_MOST_ONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Cardinality); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AT_MOST_ONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/object.pyx":25
 *     datatypes.EdgeFieldCardinality.NO_RESULT: enums.Cardinality.NO_RESULT,
 *     datatypes.EdgeFieldCardinality.AT_MOST_ONE: enums.Cardinality.AT_MOST_ONE,
 *     datatypes.EdgeFieldCardinality.ONE: enums.Cardinality.ONE,             # <<<<<<<<<<<<<<
 *     datatypes.EdgeFieldCardinality.MANY: enums.Cardinality.MANY,
 *     datatypes.EdgeFieldCardinality.AT_LEAST_ONE: enums.Cardinality.AT_LEAST_ONE,
 */
  __pyx_t_3 = __Pyx_PyInt_From_EdgeFieldCardinality(ONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_enums); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Cardinality); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/object.pyx":26
 *     datatypes.EdgeFieldCardinality.AT_MOST_ONE: enums.Cardinality.AT_MOST_ONE,
 *     datatypes.EdgeFieldCardinality.ONE: enums.Cardinality.ONE,
 *     datatypes.EdgeFieldCardinality.MANY: enums.Cardinality.MANY,             # <<<<<<<<<<<<<<
 *     datatypes.EdgeFieldCardinality.AT_LEAST_ONE: enums.Cardinality.AT_LEAST_ONE,
 * }
 */
  __pyx_t_4 = __Pyx_PyInt_From_EdgeFieldCardinality(MANY); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Cardinality); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MANY); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_t_4, __pyx_t_3) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/codecs/object.pyx":27
 *     datatypes.EdgeFieldCardinality.ONE: enums.Cardinality.ONE,
 *     datatypes.EdgeFieldCardinality.MANY: enums.Cardinality.MANY,
 *     datatypes.EdgeFieldCardinality.AT_LEAST_ONE: enums.Cardinality.AT_LEAST_ONE,             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_3 = __Pyx_PyInt_From_EdgeFieldCardinality(AT_LEAST_ONE); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_enums); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Cardinality); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_AT_LEAST_ONE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_10, __pyx_t_3, __pyx_t_4) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_CARDS_MAP);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_CARDS_MAP, ((PyObject*)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/object.pyx":122
 *         buf.write_buffer(elem_data)
 * 
 *     def _make_missing_args_error_message(self, args):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_1_make_missing_args_error_message, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectCodec__make_missing_args_e, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec, __pyx_n_s_make_missing_args_error_message, __pyx_t_10) < 0) __PYX_ERR(4, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec);

  /* "gel/protocol/codecs/object.pyx":194
 *         return result
 * 
 *     def get_dataclass_fields(self):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_3get_dataclass_fields, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectCodec_get_dataclass_fields, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec, __pyx_n_s_get_dataclass_fields, __pyx_t_10) < 0) __PYX_ERR(4, 194, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec);

  /* "gel/protocol/codecs/object.pyx":230
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         cdef descriptor = (<BaseNamedRecordCodec>self).descriptor
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_5make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(4, 230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_ObjectCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11ObjectCodec_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ObjectCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/array.pyx":20
 * 
 * 
 * from collections.abc import (Iterable as IterableABC,             # <<<<<<<<<<<<<<
 *                              Mapping as MappingABC,
 *                              Sized as SizedABC)
 */
  __pyx_t_10 = PyList_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_n_s_Iterable);
  __Pyx_GIVEREF(__pyx_n_s_Iterable);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_Iterable)) __PYX_ERR(5, 20, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_Mapping);
  __Pyx_GIVEREF(__pyx_n_s_Mapping);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_Mapping)) __PYX_ERR(5, 20, __pyx_L1_error);
  __Pyx_INCREF(__pyx_n_s_Sized);
  __Pyx_GIVEREF(__pyx_n_s_Sized);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 2, __pyx_n_s_Sized)) __PYX_ERR(5, 20, __pyx_L1_error);
  __pyx_t_4 = __Pyx_Import(__pyx_kp_s_collections_abc, __pyx_t_10, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Iterable); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IterableABC, __pyx_t_10) < 0) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MappingABC, __pyx_t_10) < 0) __PYX_ERR(5, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Sized); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SizedABC, __pyx_t_10) < 0) __PYX_ERR(5, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14BaseArrayCodec_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseArrayCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_4) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14BaseArrayCodec_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BaseArrayCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/array.pyx":157
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10ArrayCodec_1make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ArrayCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec, __pyx_n_s_make_type, __pyx_t_4) < 0) __PYX_ERR(5, 157, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_ArrayCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10ArrayCodec_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ArrayCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_4) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10ArrayCodec_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ArrayCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/codecs/range.pyx":20
 * 
 * 
 * from gel.datatypes import range as range_mod             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_s_range);
  __Pyx_GIVEREF(__pyx_n_s_range);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_range)) __PYX_ERR(6, 20, __pyx_L1_error);
  __pyx_t_10 = __Pyx_Import(__pyx_n_s_gel_datatypes, __pyx_t_4, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_10, __pyx_n_s_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_range_mod, __pyx_t_4) < 0) __PYX_ERR(6, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/range.pyx":23
 * 
 * 
 * cdef uint8_t RANGE_EMPTY = 0x01             # <<<<<<<<<<<<<<
 * cdef uint8_t RANGE_LB_INC = 0x02
 * cdef uint8_t RANGE_UB_INC = 0x04
 */
  __pyx_v_3gel_8protocol_8protocol_RANGE_EMPTY = 0x01;

  /* "gel/protocol/codecs/range.pyx":24
 * 
 * cdef uint8_t RANGE_EMPTY = 0x01
 * cdef uint8_t RANGE_LB_INC = 0x02             # <<<<<<<<<<<<<<
 * cdef uint8_t RANGE_UB_INC = 0x04
 * cdef uint8_t RANGE_LB_INF = 0x08
 */
  __pyx_v_3gel_8protocol_8protocol_RANGE_LB_INC = 0x02;

  /* "gel/protocol/codecs/range.pyx":25
 * cdef uint8_t RANGE_EMPTY = 0x01
 * cdef uint8_t RANGE_LB_INC = 0x02
 * cdef uint8_t RANGE_UB_INC = 0x04             # <<<<<<<<<<<<<<
 * cdef uint8_t RANGE_LB_INF = 0x08
 * cdef uint8_t RANGE_UB_INF = 0x10
 */
  __pyx_v_3gel_8protocol_8protocol_RANGE_UB_INC = 0x04;

  /* "gel/protocol/codecs/range.pyx":26
 * cdef uint8_t RANGE_LB_INC = 0x02
 * cdef uint8_t RANGE_UB_INC = 0x04
 * cdef uint8_t RANGE_LB_INF = 0x08             # <<<<<<<<<<<<<<
 * cdef uint8_t RANGE_UB_INF = 0x10
 * 
 */
  __pyx_v_3gel_8protocol_8protocol_RANGE_LB_INF = 0x08;

  /* "gel/protocol/codecs/range.pyx":27
 * cdef uint8_t RANGE_UB_INC = 0x04
 * cdef uint8_t RANGE_LB_INF = 0x08
 * cdef uint8_t RANGE_UB_INF = 0x10             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_3gel_8protocol_8protocol_RANGE_UB_INF = 0x10;

  /* "gel/protocol/codecs/range.pyx":150
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.RangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10RangeCodec_3make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RangeCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_RangeCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(6, 150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_RangeCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10RangeCodec_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RangeCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_10RangeCodec_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RangeCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/range.pyx":251
 *         return f'{level * " "}{self.name}\n{self.sub_codec.dump(level + 1)}'
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.MultiRangeType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15MultiRangeCodec_3make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultiRangeCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(6, 251, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_MultiRangeCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15MultiRangeCodec_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultiRangeCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_15MultiRangeCodec_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultiRangeCodec___setstate_cytho, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/set.pyx":98
 *         return result
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.ArrayType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_8SetCodec_1make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SetCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_10)) __PYX_ERR(15, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SetCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(15, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SetCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_8SetCodec_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SetCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_8SetCodec_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SetCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/enum.pyx":19
 * #
 * 
 * import enum             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = __Pyx_ImportDottedModule(__pyx_n_s_enum, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_enum, __pyx_t_10) < 0) __PYX_ERR(16, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/enum.pyx":63
 *         return codec
 * 
 *     def make_type(self, describe_context):             # <<<<<<<<<<<<<<
 *         return describe.EnumType(
 *             desc_id=uuid.UUID(bytes=self.tid),
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9EnumCodec_1make_type, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EnumCodec_make_type, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_10)) __PYX_ERR(16, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_EnumCodec, __pyx_n_s_make_type, __pyx_t_10) < 0) __PYX_ERR(16, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_EnumCodec);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9EnumCodec_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EnumCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9EnumCodec_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_EnumCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11RecordCodec_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RecordCodec___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_11RecordCodec_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RecordCodec___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":68
 * DEF NUMERIC_NEG = 0x4000
 * 
 * cdef BaseCodec NULL_CODEC = NullCodec.__new__(NullCodec)             # <<<<<<<<<<<<<<
 * cdef BaseCodec EMPTY_TUPLE_CODEC = EmptyTupleCodec.__new__(EmptyTupleCodec)
 * 
 */
  __pyx_t_10 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_NullCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_NullCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 68, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_10);
  if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_10), __pyx_ptype_3gel_8protocol_8protocol_BaseCodec)))) __PYX_ERR(7, 68, __pyx_L1_error)
  __Pyx_XGOTREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_NULL_CODEC);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_NULL_CODEC, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":69
 * 
 * cdef BaseCodec NULL_CODEC = NullCodec.__new__(NullCodec)
 * cdef BaseCodec EMPTY_TUPLE_CODEC = EmptyTupleCodec.__new__(EmptyTupleCodec)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = ((PyObject *)__pyx_tp_new_3gel_8protocol_8protocol_EmptyTupleCodec(((PyTypeObject *)__pyx_ptype_3gel_8protocol_8protocol_EmptyTupleCodec), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 69, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_10);
  if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_10), __pyx_ptype_3gel_8protocol_8protocol_BaseCodec)))) __PYX_ERR(7, 69, __pyx_L1_error)
  __Pyx_XGOTREF((PyObject *)__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_EMPTY_TUPLE_CODEC, ((struct __pyx_obj_3gel_8protocol_8protocol_BaseCodec *)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":79
 *         self.base_codec_overrides = {}
 * 
 *     def clear_cache(self):             # <<<<<<<<<<<<<<
 *         self.codecs.clear()
 *         self.codecs_build_cache.clear()
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14CodecsRegistry_3clear_cache, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecsRegistry_clear_cache, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry, __pyx_n_s_clear_cache, __pyx_t_10) < 0) __PYX_ERR(7, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry);

  /* "gel/protocol/codecs/codecs.pyx":83
 *         self.codecs_build_cache.clear()
 * 
 *     def set_type_codec(self, typeid, *, encoder, decoder, format):             # <<<<<<<<<<<<<<
 *         if format != 'python':
 *             raise ValueError('"python" is the only valid format')
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14CodecsRegistry_5set_type_codec, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecsRegistry_set_type_codec, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry, __pyx_n_s_set_type_codec, __pyx_t_10) < 0) __PYX_ERR(7, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14CodecsRegistry_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecsRegistry___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_CodecsRegistry, (type(self), 0xd998748, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_CodecsRegistry__set_state(self, __pyx_state)
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14CodecsRegistry_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CodecsRegistry___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_CodecsRegistry);

  /* "gel/protocol/codecs/codecs.pyx":569
 * 
 * 
 * cdef dict BASE_SCALAR_CODECS = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_BASE_SCALAR_CODECS, ((PyObject*)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":798
 * 
 * 
 * cdef object ONE_EL_F32_ARRAY = array.array('f', [0.0])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_float_0_0)) __PYX_ERR(7, 798, __pyx_L1_error);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_u_f);
  __Pyx_GIVEREF(__pyx_n_u_f);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_f)) __PYX_ERR(7, 798, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_10)) __PYX_ERR(7, 798, __pyx_L1_error);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_ONE_EL_F32_ARRAY);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_ONE_EL_F32_ARRAY, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":934
 * 
 * 
 * generate_tables()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = __pyx_f_3gel_8protocol_8protocol_generate_tables(); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":971
 * 
 * 
 * cdef object ONE_EL16_ARRAY = array.array('H', [0])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_int_0)) __PYX_ERR(7, 971, __pyx_L1_error);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_n_u_H);
  __Pyx_GIVEREF(__pyx_n_u_H);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_H)) __PYX_ERR(7, 971, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10)) __PYX_ERR(7, 971, __pyx_L1_error);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_ONE_EL16_ARRAY);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_ONE_EL16_ARRAY, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1052
 * 
 * 
 * cdef object ONE_EL_I32_ARRAY = array.array('l', [0])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_int_0)) __PYX_ERR(7, 1052, __pyx_L1_error);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_u_l);
  __Pyx_GIVEREF(__pyx_n_u_l);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_l)) __PYX_ERR(7, 1052, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_10);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_10)) __PYX_ERR(7, 1052, __pyx_L1_error);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 1052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_ONE_EL_I32_ARRAY);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_ONE_EL_I32_ARRAY, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/codecs/codecs.pyx":1392
 * 
 * 
 * register_base_scalar_codecs()             # <<<<<<<<<<<<<<
 */
  __pyx_t_10 = __pyx_f_3gel_8protocol_8protocol_register_base_scalar_codecs(); if (unlikely(!__pyx_t_10)) __PYX_ERR(7, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":70
 * 
 * 
 * cpython.datetime.import_datetime()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_7cpython_8datetime_import_datetime();

  /* "gel/protocol/protocol.pyx":74
 * 
 * _QUERY_SINGLE_METHOD = {
 *     True: {             # <<<<<<<<<<<<<<
 *         OutputFormat.JSON: 'query_required_single_json',
 *         OutputFormat.JSON_ELEMENTS: 'raw_query',
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);

  /* "gel/protocol/protocol.pyx":75
 * _QUERY_SINGLE_METHOD = {
 *     True: {
 *         OutputFormat.JSON: 'query_required_single_json',             # <<<<<<<<<<<<<<
 *         OutputFormat.JSON_ELEMENTS: 'raw_query',
 *         OutputFormat.BINARY: 'query_required_single',
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_e_3gel_8protocol_8protocol_JSON); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_n_u_query_required_single_json) < 0) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":76
 *     True: {
 *         OutputFormat.JSON: 'query_required_single_json',
 *         OutputFormat.JSON_ELEMENTS: 'raw_query',             # <<<<<<<<<<<<<<
 *         OutputFormat.BINARY: 'query_required_single',
 *     },
 */
  __pyx_t_4 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_e_3gel_8protocol_8protocol_JSON_ELEMENTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_n_u_raw_query) < 0) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":77
 *         OutputFormat.JSON: 'query_required_single_json',
 *         OutputFormat.JSON_ELEMENTS: 'raw_query',
 *         OutputFormat.BINARY: 'query_required_single',             # <<<<<<<<<<<<<<
 *     },
 *     False: {
 */
  __pyx_t_4 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_e_3gel_8protocol_8protocol_BINARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_n_u_query_required_single) < 0) __PYX_ERR(8, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, Py_True, __pyx_t_3) < 0) __PYX_ERR(8, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol.pyx":80
 *     },
 *     False: {
 *         OutputFormat.JSON: 'query_single_json',             # <<<<<<<<<<<<<<
 *         OutputFormat.JSON_ELEMENTS: 'raw_query',
 *         OutputFormat.BINARY: 'query_single',
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_e_3gel_8protocol_8protocol_JSON); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_n_u_query_single_json) < 0) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":81
 *     False: {
 *         OutputFormat.JSON: 'query_single_json',
 *         OutputFormat.JSON_ELEMENTS: 'raw_query',             # <<<<<<<<<<<<<<
 *         OutputFormat.BINARY: 'query_single',
 *     },
 */
  __pyx_t_4 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_e_3gel_8protocol_8protocol_JSON_ELEMENTS); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_n_u_raw_query) < 0) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "gel/protocol/protocol.pyx":82
 *         OutputFormat.JSON: 'query_single_json',
 *         OutputFormat.JSON_ELEMENTS: 'raw_query',
 *         OutputFormat.BINARY: 'query_single',             # <<<<<<<<<<<<<<
 *     },
 * }
 */
  __pyx_t_4 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_e_3gel_8protocol_8protocol_BINARY); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 82, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_t_4, __pyx_n_u_query_single) < 0) __PYX_ERR(8, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_10, Py_False, __pyx_t_3) < 0) __PYX_ERR(8, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_QUERY_SINGLE_METHOD, __pyx_t_10) < 0) __PYX_ERR(8, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":86
 * }
 * 
 * ALL_CAPABILITIES = 0xFFFFFFFFFFFFFFFF             # <<<<<<<<<<<<<<
 * 
 * cdef dict OLD_ERROR_CODES = {
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ALL_CAPABILITIES, __pyx_int_0xffffffffffffffff) < 0) __PYX_ERR(8, 86, __pyx_L1_error)

  /* "gel/protocol/protocol.pyx":89
 * 
 * cdef dict OLD_ERROR_CODES = {
 *     0x05_03_00_01: 0x05_03_01_01,  # TransactionSerializationError #2431             # <<<<<<<<<<<<<<
 *     0x05_03_00_02: 0x05_03_01_02,  # TransactionDeadlockError      #2431
 * }
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_int_84082689, __pyx_int_84082945) < 0) __PYX_ERR(8, 89, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_int_84082690, __pyx_int_84082946) < 0) __PYX_ERR(8, 89, __pyx_L1_error)
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_OLD_ERROR_CODES);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_OLD_ERROR_CODES, ((PyObject*)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":107
 *         expect_one: bool = False,
 *         required_one: bool = False,
 *         implicit_limit: int = 0,             # <<<<<<<<<<<<<<
 *         inline_typenames: bool = False,
 *         inline_typeids: bool = False,
 */
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(8, 107, __pyx_L1_error)
  __Pyx_INCREF(__pyx_int_0);
  __pyx_k__52 = ((PyObject*)__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);

  /* "gel/protocol/protocol.pyx":110
 *         inline_typenames: bool = False,
 *         inline_typeids: bool = False,
 *         allow_capabilities: enums.Capability = enums.Capability.ALL,             # <<<<<<<<<<<<<<
 *         state: typing.Optional[dict] = None,
 *         annotations: typing.Optional[dict[str, str]] = None,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_enums); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Capability); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 110, __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_ALL); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_k__53 = __pyx_t_10;
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14ExecuteContext_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExecuteContext___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_ExecuteContext, (type(self), 0x3eeaf27, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_ExecuteContext__set_state(self, __pyx_state)
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14ExecuteContext_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExecuteContext___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_ExecuteContext);

  /* "gel/protocol/protocol.pyx":196
 *         self.last_details = None
 * 
 *     def get_settings(self):             # <<<<<<<<<<<<<<
 *         return types.MappingProxyType(self.server_settings)
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_3get_settings, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocol_get_settings, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_get_settings, __pyx_t_10) < 0) __PYX_ERR(8, 196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":199
 *         return types.MappingProxyType(self.server_settings)
 * 
 *     def is_in_transaction(self):             # <<<<<<<<<<<<<<
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_5is_in_transaction, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocol_is_in_transaction, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_is_in_transaction, __pyx_t_10) < 0) __PYX_ERR(8, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":202
 *         return self.xact_status in (TRANS_INTRANS, TRANS_INERROR)
 * 
 *     def set_connection(self, con):             # <<<<<<<<<<<<<<
 *         self.con = weakref.ref(con)
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_7set_connection, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocol_set_connection, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_set_connection, __pyx_t_10) < 0) __PYX_ERR(8, 202, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":205
 *         self.con = weakref.ref(con)
 * 
 *     cpdef abort(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_9abort, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocol_abort, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_abort, __pyx_t_10) < 0) __PYX_ERR(8, 205, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":211
 *         raise NotImplementedError
 * 
 *     async def wait_for_message(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_11wait_for_message, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_wait_for_message, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_wait_for_message, __pyx_t_10) < 0) __PYX_ERR(8, 211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":214
 *         raise NotImplementedError
 * 
 *     async def try_recv_eagerly(self):             # <<<<<<<<<<<<<<
 *         # If there's data in the socket try reading it into the
 *         # buffer.  Needed for blocking-io connections.
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_14try_recv_eagerly, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_try_recv_eagerly, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_try_recv_eagerly, __pyx_t_10) < 0) __PYX_ERR(8, 214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":219
 *         raise NotImplementedError
 * 
 *     async def wait_for_connect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_17wait_for_connect, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_wait_for_connect, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_wait_for_connect, __pyx_t_10) < 0) __PYX_ERR(8, 219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":222
 *         raise NotImplementedError
 * 
 *     async def wait_for_disconnect(self):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_20wait_for_disconnect, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_wait_for_disconne, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_wait_for_disconnect, __pyx_t_10) < 0) __PYX_ERR(8, 222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":302
 *         return buf
 * 
 *     async def _parse(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf, params
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_ctx, __pyx_n_s_ExecuteContext) < 0) __PYX_ERR(8, 302, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_23_parse, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol__parse, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_parse, __pyx_t_3) < 0) __PYX_ERR(8, 302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":365
 *                 f'does not return any data')
 * 
 *     async def _execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ctx, __pyx_n_s_ExecuteContext) < 0) __PYX_ERR(8, 365, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_26_execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol__execute, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_execute, __pyx_t_10) < 0) __PYX_ERR(8, 365, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":484
 *             return NULL_CODEC_ID, EMPTY_NULL_DATA
 * 
 *     async def execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         self.ensure_connected()
 *         self.reset_status()
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_ctx, __pyx_n_s_ExecuteContext) < 0) __PYX_ERR(8, 484, __pyx_L1_error)
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_29execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_execute, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_execute_2, __pyx_t_3) < 0) __PYX_ERR(8, 484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":504
 *         return await self._execute(ctx)
 * 
 *     async def query(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         ret = await self.execute(ctx)
 *         if ctx.expect_one:
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ctx, __pyx_n_s_ExecuteContext) < 0) __PYX_ERR(8, 504, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_32query, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_query, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_query, __pyx_t_10) < 0) __PYX_ERR(8, 504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":533
 *                     return ret
 * 
 *     async def dump(self, header_callback, block_callback):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_35dump, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_dump, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_dump, __pyx_t_10) < 0) __PYX_ERR(8, 533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":605
 *             raise exc
 * 
 *     async def _sync(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_38_sync, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol__sync, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_sync, __pyx_t_10) < 0) __PYX_ERR(8, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":619
 *                 self.fallthrough()
 * 
 *     async def ping(self):             # <<<<<<<<<<<<<<
 *         cdef char mtype
 *         self.write(WriteBuffer.new_message(SYNC_MSG).end_message())
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_41ping, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_ping, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_ping, __pyx_t_10) < 0) __PYX_ERR(8, 619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":640
 *             raise exc
 * 
 *     async def restore(self, bytes header, data_gen):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer buf
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_44restore, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_restore, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_restore, __pyx_t_10) < 0) __PYX_ERR(8, 640, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":725
 *             raise exc
 * 
 *     def terminate(self):             # <<<<<<<<<<<<<<
 *         try:
 *             self.write(WriteBuffer.new_message(TERMINATE_MSG).end_message())
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_47terminate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocol_terminate, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_terminate, __pyx_t_10) < 0) __PYX_ERR(8, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":731
 *             pass
 * 
 *     async def connect(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer ver_buf
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_49connect, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol_connect, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_connect, __pyx_t_10) < 0) __PYX_ERR(8, 731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":829
 *             self.buffer.finish_message()
 * 
 *     async def _auth_sasl(self):             # <<<<<<<<<<<<<<
 *         num_methods = self.buffer.read_int32()
 *         if num_methods <= 0:
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_52_auth_sasl, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocol__auth_sasl, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_auth_sasl, __pyx_t_10) < 0) __PYX_ERR(8, 829, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_55__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocol___reduce_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SansIOProtocol, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SansIOProtocol__set_state(self, __pyx_state)
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_14SansIOProtocol_57__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocol___setstate_cython, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocol);

  /* "gel/protocol/protocol.pyx":1237
 * 
 * cdef result_cardinality_mismatch_code = \
 *     errors.ResultCardinalityMismatchError._code             # <<<<<<<<<<<<<<
 * cdef parameter_type_mismatch_code = errors.ParameterTypeMismatchError._code
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_errors); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ResultCardinalityMismatchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1237, __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_code); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_result_cardinality_mismatch_code);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_result_cardinality_mismatch_code, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":1238
 * cdef result_cardinality_mismatch_code = \
 *     errors.ResultCardinalityMismatchError._code
 * cdef parameter_type_mismatch_code = errors.ParameterTypeMismatchError._code             # <<<<<<<<<<<<<<
 * 
 * cdef bytes SYNC_MESSAGE = bytes(
 */
  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_errors); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ParameterTypeMismatchError); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1238, __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_code); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_parameter_type_mismatch_code);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_parameter_type_mismatch_code, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":1241
 * 
 * cdef bytes SYNC_MESSAGE = bytes(
 *     WriteBuffer.new_message(SYNC_MSG).end_message())             # <<<<<<<<<<<<<<
 * cdef bytes FLUSH_MESSAGE = bytes(
 *     WriteBuffer.new_message(FLUSH_MSG).end_message())
 */
  __pyx_t_10 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('S')); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_10)->__pyx_vtab)->end_message(((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":1240
 * cdef parameter_type_mismatch_code = errors.ParameterTypeMismatchError._code
 * 
 * cdef bytes SYNC_MESSAGE = bytes(             # <<<<<<<<<<<<<<
 *     WriteBuffer.new_message(SYNC_MSG).end_message())
 * cdef bytes FLUSH_MESSAGE = bytes(
 */
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_SYNC_MESSAGE, ((PyObject*)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":1243
 *     WriteBuffer.new_message(SYNC_MSG).end_message())
 * cdef bytes FLUSH_MESSAGE = bytes(
 *     WriteBuffer.new_message(FLUSH_MSG).end_message())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = ((PyObject *)__pyx_vtabptr_3gel_7pgproto_7pgproto_WriteBuffer->new_message('H')); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_3 = ((struct __pyx_vtabstruct_3gel_7pgproto_7pgproto_WriteBuffer *)((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_10)->__pyx_vtab)->end_message(((struct __pyx_obj_3gel_7pgproto_7pgproto_WriteBuffer *)__pyx_t_10)); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":1242
 * cdef bytes SYNC_MESSAGE = bytes(
 *     WriteBuffer.new_message(SYNC_MSG).end_message())
 * cdef bytes FLUSH_MESSAGE = bytes(             # <<<<<<<<<<<<<<
 *     WriteBuffer.new_message(FLUSH_MSG).end_message())
 * 
 */
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_XGOTREF(__pyx_v_3gel_8protocol_8protocol_FLUSH_MESSAGE);
  __Pyx_DECREF_SET(__pyx_v_3gel_8protocol_8protocol_FLUSH_MESSAGE, ((PyObject*)__pyx_t_10));
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;

  /* "gel/protocol/protocol_v0.pyx":20
 * 
 * 
 * from gel import enums             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_INCREF(__pyx_n_s_enums);
  __Pyx_GIVEREF(__pyx_n_s_enums);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_n_s_enums)) __PYX_ERR(19, 20, __pyx_L1_error);
  __pyx_t_3 = __Pyx_Import(__pyx_n_s_gel, __pyx_t_10, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_enums); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_enums, __pyx_t_10) < 0) __PYX_ERR(19, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "gel/protocol/protocol_v0.pyx":37
 *         *,
 *         reg: CodecsRegistry,
 *         output_format: OutputFormat=OutputFormat.BINARY,             # <<<<<<<<<<<<<<
 *         expect_one: bint=False,
 *         required_one: bool=False,
 */
  __pyx_k__85 = __pyx_e_3gel_8protocol_8protocol_BINARY;

  /* "gel/protocol/protocol_v0.pyx":40
 *         expect_one: bint=False,
 *         required_one: bool=False,
 *         implicit_limit: int=0,             # <<<<<<<<<<<<<<
 *         inline_typenames: bool=False,
 *         inline_typeids: bool=False,
 */
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(19, 40, __pyx_L1_error)
  __Pyx_INCREF(__pyx_int_0);
  __pyx_k__84 = ((PyObject*)__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);

  /* "gel/protocol/protocol_v0.pyx":32
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):
 *     async def _legacy_parse(             # <<<<<<<<<<<<<<
 *         self,
 *         query: str,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_3)) __PYX_ERR(19, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "gel/protocol/protocol_v0.pyx":37
 *         *,
 *         reg: CodecsRegistry,
 *         output_format: OutputFormat=OutputFormat.BINARY,             # <<<<<<<<<<<<<<
 *         expect_one: bint=False,
 *         required_one: bool=False,
 */
  __pyx_t_10 = __Pyx_Enum_2f2df2__3gel_8protocol_8protocol_enum__dunderpyx_t_3ge__etc_to_py(__pyx_e_3gel_8protocol_8protocol_BINARY); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_output_format, __pyx_t_10) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol_v0.pyx":38
 *         reg: CodecsRegistry,
 *         output_format: OutputFormat=OutputFormat.BINARY,
 *         expect_one: bint=False,             # <<<<<<<<<<<<<<
 *         required_one: bool=False,
 *         implicit_limit: int=0,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_expect_one, Py_False) < 0) __PYX_ERR(19, 32, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":39
 *         output_format: OutputFormat=OutputFormat.BINARY,
 *         expect_one: bint=False,
 *         required_one: bool=False,             # <<<<<<<<<<<<<<
 *         implicit_limit: int=0,
 *         inline_typenames: bool=False,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_required_one, Py_False) < 0) __PYX_ERR(19, 32, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":40
 *         expect_one: bint=False,
 *         required_one: bool=False,
 *         implicit_limit: int=0,             # <<<<<<<<<<<<<<
 *         inline_typenames: bool=False,
 *         inline_typeids: bool=False,
 */
  if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(19, 40, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_implicit_limit, __pyx_int_0) < 0) __PYX_ERR(19, 32, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":41
 *         required_one: bool=False,
 *         implicit_limit: int=0,
 *         inline_typenames: bool=False,             # <<<<<<<<<<<<<<
 *         inline_typeids: bool=False,
 *         allow_capabilities: typing.Optional[int] = None,
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inline_typenames, Py_False) < 0) __PYX_ERR(19, 32, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":42
 *         implicit_limit: int=0,
 *         inline_typenames: bool=False,
 *         inline_typeids: bool=False,             # <<<<<<<<<<<<<<
 *         allow_capabilities: typing.Optional[int] = None,
 *     ):
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inline_typeids, Py_False) < 0) __PYX_ERR(19, 32, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":43
 *         inline_typenames: bool=False,
 *         inline_typeids: bool=False,
 *         allow_capabilities: typing.Optional[int] = None,             # <<<<<<<<<<<<<<
 *     ):
 *         cdef:
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allow_capabilities, Py_None) < 0) __PYX_ERR(19, 32, __pyx_L1_error)

  /* "gel/protocol/protocol_v0.pyx":32
 * 
 * cdef class SansIOProtocolBackwardsCompatible(SansIOProtocol):
 *     async def _legacy_parse(             # <<<<<<<<<<<<<<
 *         self,
 *         query: str,
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_query, __pyx_n_s_str_2) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_reg, __pyx_n_s_CodecsRegistry) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_output_format, __pyx_n_s_OutputFormat) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_expect_one, __pyx_n_s_bint) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_required_one, __pyx_n_s_bool) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_implicit_limit, __pyx_n_s_int) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_inline_typenames, __pyx_n_s_bool) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_inline_typeids, __pyx_n_s_bool) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_allow_capabilities, __pyx_kp_s_typing_Optional_int) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_1_legacy_parse, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocolBackwardsCompatibl, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_4, __pyx_t_3);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, __pyx_n_s_legacy_parse, __pyx_t_4) < 0) __PYX_ERR(19, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);

  /* "gel/protocol/protocol_v0.pyx":156
 *         return cardinality, in_dc, out_dc, attrs
 * 
 *     async def _legacy_execute(             # <<<<<<<<<<<<<<
 *         self, BaseCodec in_dc, BaseCodec out_dc, args, kwargs
 *     ):
 */
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_4_legacy_execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocolBackwardsCompatibl_2, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, __pyx_n_s_legacy_execute, __pyx_t_4) < 0) __PYX_ERR(19, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);

  /* "gel/protocol/protocol_v0.pyx":228
 *         return result
 * 
 *     async def _legacy_optimistic_execute(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             WriteBuffer packet
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ctx, __pyx_n_s_ExecuteContext) < 0) __PYX_ERR(19, 228, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_7_legacy_optimistic_execute, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocolBackwardsCompatibl_3, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, __pyx_n_s_legacy_optimistic_execute, __pyx_t_10) < 0) __PYX_ERR(19, 228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);

  /* "gel/protocol/protocol_v0.pyx":348
 *             return result
 * 
 *     async def legacy_execute_anonymous(self, ctx: ExecuteContext):             # <<<<<<<<<<<<<<
 *         cdef:
 *             BaseCodec in_dc
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_ctx, __pyx_n_s_ExecuteContext) < 0) __PYX_ERR(19, 348, __pyx_L1_error)
  __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_10legacy_execute_anonymous, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocolBackwardsCompatibl_4, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_4, __pyx_t_10);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, __pyx_n_s_legacy_execute_anonymous, __pyx_t_4) < 0) __PYX_ERR(19, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);

  /* "gel/protocol/protocol_v0.pyx":434
 *                     return ret
 * 
 *     async def legacy_simple_query(             # <<<<<<<<<<<<<<
 *         self, str query, capabilities: enums.Capability
 *     ):
 */
  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_capabilities, __pyx_kp_s_enums_Capability) < 0) __PYX_ERR(19, 434, __pyx_L1_error)
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_13legacy_simple_query, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_SansIOProtocolBackwardsCompatibl_5, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_10)) __PYX_ERR(19, 434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, __pyx_n_s_legacy_simple_query, __pyx_t_10) < 0) __PYX_ERR(19, 434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_16__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocolBackwardsCompatibl_7, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, __pyx_n_s_reduce_cython, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SansIOProtocolBackwardsCompatible, (type(self), 0x59f3fd8, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SansIOProtocolBackwardsCompatible__set_state(self, __pyx_state)
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_33SansIOProtocolBackwardsCompatible_18__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SansIOProtocolBackwardsCompatibl_8, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible, __pyx_n_s_setstate_cython, __pyx_t_10) < 0) __PYX_ERR(2, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  PyType_Modified(__pyx_ptype_3gel_8protocol_8protocol_SansIOProtocolBackwardsCompatible);

  /* "(tree fragment)":1
 * def __pyx_unpickle_LRUMapping(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_1__pyx_unpickle_LRUMapping, 0, __pyx_n_s_pyx_unpickle_LRUMapping, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_LRUMapping, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_LRUMapping__set_state(<LRUMapping> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_LRUMapping__set_state(LRUMapping __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result._dict = __pyx_state[0]; __pyx_result._dict_get = __pyx_state[1]; __pyx_result._dict_move_to_end = __pyx_state[2]; __pyx_result._maxsize = __pyx_state[3]
 *     if len(__pyx_state) > 4 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_3__pyx_unpickle_CodecsRegistry, 0, __pyx_n_s_pyx_unpickle_CodecsRegistry, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_CodecsRegistry, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_ExecuteContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_5__pyx_unpickle_ExecuteContext, 0, __pyx_n_s_pyx_unpickle_ExecuteContext, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_ExecuteContext, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_ExecuteContext__set_state(<ExecuteContext> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_ExecuteContext__set_state(ExecuteContext __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.allow_capabilities = __pyx_state[0]; __pyx_result.annotations = __pyx_state[1]; __pyx_result.args = __pyx_state[2]; __pyx_result.capabilities = __pyx_state[3]; __pyx_result.cardinality = __pyx_state[4]; __pyx_result.expect_one = __pyx_state[5]; __pyx_result.implicit_limit = __pyx_state[6]; __pyx_result.in_dc = __pyx_state[7]; __pyx_result.inline_typeids = __pyx_state[8]; __pyx_result.inline_typenames = __pyx_state[9]; __pyx_result.input_language = __pyx_state[10]; __pyx_result.kwargs = __pyx_state[11]; __pyx_result.out_dc = __pyx_state[12]; __pyx_result.output_format = __pyx_state[13]; __pyx_result.qc = __pyx_state[14]; __pyx_result.query = __pyx_state[15]; __pyx_result.reg = __pyx_state[16]; __pyx_result.required_one = __pyx_state[17]; __pyx_result.state = __pyx_state[18]; __pyx_result.warnings = __pyx_state[19]
 *     if len(__pyx_state) > 20 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_7__pyx_unpickle_SansIOProtocol, 0, __pyx_n_s_pyx_unpickle_SansIOProtocol, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SansIOProtocol, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SansIOProtocolBackwardsCompatible(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_3gel_8protocol_8protocol_9__pyx_unpickle_SansIOProtocolBackwardsCompatible, 0, __pyx_n_s_pyx_unpickle_SansIOProtocolBac, NULL, __pyx_n_s_gel_protocol_protocol, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SansIOProtocolBac, __pyx_t_10) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "gel/protocol/protocol.pyx":1
 * #             # <<<<<<<<<<<<<<
 * # This source file is part of the EdgeDB open source project.
 * #
 */
  __pyx_t_10 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_10) < 0) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  if (__pyx_m) {
    if (__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init gel.protocol.protocol", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init gel.protocol.protocol");
  }
  __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
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

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

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    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);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *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
}
#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

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        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;
}

/* 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 && PY_VERSION_HEX < 0x030d0000
    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;
    }
#elif CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
#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);
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
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;
}
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_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    #endif
    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

/* 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 PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    #if PY_MAJOR_VERSION < 3
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    #else
    if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
        return NULL;
    #endif
    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

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL
        #if PY_VERSION_HEX < 0x03090000
        vectorcallfunc f = _PyVectorcall_Function(func);
        #else
        vectorcallfunc f = PyVectorcall_Function(func);
        #endif
        if (f) {
            return f(func, args, (size_t)nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, (size_t)nargs, NULL);
        }
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *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_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    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_VERSION_HEX < 0x030B0000)
            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 || CYTHON_COMPILING_IN_LIMITED_API
    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
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
    PyObject *dict;
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject *const *kwvalues,
    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;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        Py_XDECREF(key); key = NULL;
        Py_XDECREF(value); value = NULL;
        if (kwds_is_tuple) {
            Py_ssize_t size;
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(kwds);
#else
            size = PyTuple_Size(kwds);
            if (size < 0) goto bad;
#endif
            if (pos >= size) break;
#if CYTHON_AVOID_BORROWED_REFS
            key = __Pyx_PySequence_ITEM(kwds, pos);
            if (!key) goto bad;
#elif CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kwds, pos);
#else
            key = PyTuple_GetItem(kwds, pos);
            if (!key) goto bad;
#endif
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
#endif
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
#if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(value);
            Py_DECREF(key);
#endif
            key = NULL;
            value = NULL;
            continue;
        }
#if !CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(key);
#endif
        Py_INCREF(value);
        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;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    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 = (
                #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;
#if CYTHON_AVOID_BORROWED_REFS
                    value = NULL;
#endif
                    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;
        }
    }
    Py_XDECREF(key);
    Py_XDECREF(value);
    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:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    Py_XDECREF(key);
    Py_XDECREF(value);
    return -1;
}

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

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!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 {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || !PyMapping_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr = NULL;
    Py_ssize_t key_value;
    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)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
        if (!meth) {
            PyErr_Clear();
        } else {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kw,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
        Py_ssize_t kwsize;
#if CYTHON_ASSUME_SAFE_MACROS
        kwsize = PyTuple_GET_SIZE(kw);
#else
        kwsize = PyTuple_Size(kw);
        if (kwsize < 0) return 0;
#endif
        if (unlikely(kwsize == 0))
            return 1;
        if (!kw_allowed) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, 0);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            goto invalid_keyword;
        }
#if PY_VERSION_HEX < 0x03090000
        for (pos = 0; pos < kwsize; pos++) {
#if CYTHON_ASSUME_SAFE_MACROS
            key = PyTuple_GET_ITEM(kw, pos);
#else
            key = PyTuple_GetItem(kw, pos);
            if (!key) return 0;
#endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
        }
#endif
        return 1;
    }
    while (PyDict_Next(kw, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if (!kw_allowed && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* GetAttr3 */
#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
#endif
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
    int res = PyObject_GetOptionalAttr(o, n, &r);
    return (res != 0) ? r : __Pyx_NewRef(d);
#else
  #if CYTHON_USE_TYPE_SLOTS
    if (likely(PyString_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
  #endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
#endif
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_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 PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
      #elif CYTHON_FAST_THREAD_STATE
        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);
        }
#else
        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);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (unlikely(!py_import))
        goto bad;
    if (!from_list) {
        empty_list = PyList_New(0);
        if (unlikely(!empty_list))
            goto bad;
        from_list = empty_list;
    }
    #endif
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
                module = PyImport_ImportModuleLevelObject(
                    name, __pyx_d, empty_dict, from_list, 1);
                if (unlikely(!module)) {
                    if (unlikely(!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 (unlikely(!py_level))
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_d, empty_dict, from_list, level);
            #endif
        }
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    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)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__3);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        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;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (!r) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    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;
    }
    type_name = __Pyx_PyType_GetName(type);
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* CIntToDigits */
static const char DIGIT_PAIRS_10[2*10*10+1] = {
    "00010203040506070809"
    "10111213141516171819"
    "20212223242526272829"
    "30313233343536373839"
    "40414243444546474849"
    "50515253545556575859"
    "60616263646566676869"
    "70717273747576777879"
    "80818283848586878889"
    "90919293949596979899"
};
static const char DIGIT_PAIRS_8[2*8*8+1] = {
    "0001020304050607"
    "1011121314151617"
    "2021222324252627"
    "3031323334353637"
    "4041424344454647"
    "5051525354555657"
    "6061626364656667"
    "7071727374757677"
};
static const char DIGITS_HEX[2*16+1] = {
    "0123456789abcdef"
    "0123456789ABCDEF"
};

/* BuildPyUnicode */
static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
                                                int prepend_sign, char padding_char) {
    PyObject *uval;
    Py_ssize_t uoffset = ulength - clength;
#if CYTHON_USE_UNICODE_INTERNALS
    Py_ssize_t i;
#if CYTHON_PEP393_ENABLED
    void *udata;
    uval = PyUnicode_New(ulength, 127);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_DATA(uval);
#else
    Py_UNICODE *udata;
    uval = PyUnicode_FromUnicode(NULL, ulength);
    if (unlikely(!uval)) return NULL;
    udata = PyUnicode_AS_UNICODE(uval);
#endif
    if (uoffset > 0) {
        i = 0;
        if (prepend_sign) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
            i++;
        }
        for (; i < uoffset; i++) {
            __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
        }
    }
    for (i=0; i < clength; i++) {
        __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
    }
#else
    {
        PyObject *sign = NULL, *padding = NULL;
        uval = NULL;
        if (uoffset > 0) {
            prepend_sign = !!prepend_sign;
            if (uoffset > prepend_sign) {
                padding = PyUnicode_FromOrdinal(padding_char);
                if (likely(padding) && uoffset > prepend_sign + 1) {
                    PyObject *tmp;
                    PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
                    if (unlikely(!repeat)) goto done_or_error;
                    tmp = PyNumber_Multiply(padding, repeat);
                    Py_DECREF(repeat);
                    Py_DECREF(padding);
                    padding = tmp;
                }
                if (unlikely(!padding)) goto done_or_error;
            }
            if (prepend_sign) {
                sign = PyUnicode_FromOrdinal('-');
                if (unlikely(!sign)) goto done_or_error;
            }
        }
        uval = PyUnicode_DecodeASCII(chars, clength, NULL);
        if (likely(uval) && padding) {
            PyObject *tmp = PyNumber_Add(padding, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
        if (likely(uval) && sign) {
            PyObject *tmp = PyNumber_Add(sign, uval);
            Py_DECREF(uval);
            uval = tmp;
        }
done_or_error:
        Py_XDECREF(padding);
        Py_XDECREF(sign);
    }
#endif
    return uval;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(int)*3+2];
    char *dpos, *end = digits + sizeof(int)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    int remaining;
#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 (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (int) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (int) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (int) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(Py_ssize_t)*3+2];
    char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    Py_ssize_t remaining;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (Py_ssize_t) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (Py_ssize_t) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (Py_ssize_t) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#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;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    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);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    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((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            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 << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif 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
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* DivInt[Py_ssize_t] */
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
    Py_ssize_t q = a / b;
    Py_ssize_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == 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 && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif 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;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    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
}
#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 = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C00A6
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
  #else
    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;
  #endif
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
    if (unlikely(tstate->current_exception))
#elif 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;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        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;
      #endif
    }
    #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;
}

/* 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 && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif 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

/* ImportDottedModule */
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
    if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
#if PY_MAJOR_VERSION < 3
        PyExc_ImportError,
        "No module named '%s'", PyString_AS_STRING(partial_name));
#else
#if PY_VERSION_HEX >= 0x030600B1
        PyExc_ModuleNotFoundError,
#else
        PyExc_ImportError,
#endif
        "No module named '%U'", partial_name);
#endif
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400)
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
#endif
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
    nparts = PyTuple_GET_SIZE(parts_tuple);
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = PySequence_ITEM(parts_tuple, i);
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
#endif
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if PY_MAJOR_VERSION < 3
    PyObject *module, *from_list, *star = __pyx_n_s__5;
    CYTHON_UNUSED_VAR(parts_tuple);
    from_list = PyList_New(1);
    if (unlikely(!from_list))
        return NULL;
    Py_INCREF(star);
    PyList_SET_ITEM(from_list, 0, star);
    module = __Pyx_Import(name, from_list, 0);
    Py_DECREF(from_list);
    return module;
#else
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
#endif
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        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);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, 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) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#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

/* PySequenceMultiply */
static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
    PyObject *result, *pymul = PyInt_FromSsize_t(mul);
    if (unlikely(!pymul))
        return NULL;
    result = PyNumber_Multiply(seq, pymul);
    Py_DECREF(pymul);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
#if CYTHON_USE_TYPE_SLOTS
    PyTypeObject *type = Py_TYPE(seq);
    if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
        return type->tp_as_sequence->sq_repeat(seq, mul);
    } else
#endif
    {
        return __Pyx_PySequence_Multiply_Generic(seq, mul);
    }
}

/* SetItemInt */
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (unlikely(!j)) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_ass_subscript) {
            int r;
            PyObject *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return -1;
            r = mm->mp_ass_subscript(o, key, v);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return sm->sq_ass_item(o, i, v);
        }
    }
#else
    if (is_list || !PyMapping_Check(o))
    {
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* RaiseUnboundLocalError */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* DivInt[long] */
static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
    long q = a / b;
    long r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* RaiseKeywordRequired */
static void __Pyx_RaiseKeywordRequired(const char* func_name, PyObject* kw_name) {
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() needs keyword-only argument %U", func_name, kw_name);
        #else
        "%s() needs keyword-only argument %s", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

/* PyUnicode_Unicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj) {
    if (unlikely(obj == Py_None))
        obj = __pyx_kp_u_None;
    return __Pyx_NewRef(obj);
}

/* UnicodeConcatInPlace */
# if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
static int
__Pyx_unicode_modifiable(PyObject *unicode)
{
    if (Py_REFCNT(unicode) != 1)
        return 0;
    if (!PyUnicode_CheckExact(unicode))
        return 0;
    if (PyUnicode_CHECK_INTERNED(unicode))
        return 0;
    return 1;
}
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
        #if CYTHON_REFNANNY
        , void* __pyx_refnanny
        #endif
    ) {
    PyObject *left = *p_left;
    Py_ssize_t left_len, right_len, new_len;
    if (unlikely(__Pyx_PyUnicode_READY(left) == -1))
        return NULL;
    if (unlikely(__Pyx_PyUnicode_READY(right) == -1))
        return NULL;
    left_len = PyUnicode_GET_LENGTH(left);
    if (left_len == 0) {
        Py_INCREF(right);
        return right;
    }
    right_len = PyUnicode_GET_LENGTH(right);
    if (right_len == 0) {
        Py_INCREF(left);
        return left;
    }
    if (unlikely(left_len > PY_SSIZE_T_MAX - right_len)) {
        PyErr_SetString(PyExc_OverflowError,
                        "strings are too large to concat");
        return NULL;
    }
    new_len = left_len + right_len;
    if (__Pyx_unicode_modifiable(left)
            && PyUnicode_CheckExact(right)
            && PyUnicode_KIND(right) <= PyUnicode_KIND(left)
            && !(PyUnicode_IS_ASCII(left) && !PyUnicode_IS_ASCII(right))) {
        int ret;
        __Pyx_GIVEREF(*p_left);
        ret = PyUnicode_Resize(p_left, new_len);
        __Pyx_GOTREF(*p_left);
        if (unlikely(ret != 0))
            return NULL;
        #if PY_VERSION_HEX >= 0x030d0000
        if (unlikely(PyUnicode_CopyCharacters(*p_left, left_len, right, 0, right_len) < 0)) return NULL;
        #else
        _PyUnicode_FastCopyCharacters(*p_left, left_len, right, 0, right_len);
        #endif
        __Pyx_INCREF(*p_left);
        __Pyx_GIVEREF(*p_left);
        return *p_left;
    } else {
        return __Pyx_PyUnicode_Concat(left, right);
    }
  }
#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, int wraparound) {
    __Pyx_TypeName obj_type_name;
#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);
    }
#else
    CYTHON_UNUSED_VAR(wraparound);
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#else
    CYTHON_UNUSED_VAR(wraparound);
#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;
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
bad:
    return NULL;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
        
            x = (long)((unsigned long)a + (unsigned long)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(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        if (unlikely(__Pyx_PyLong_IsZero(op2))) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_PyLong_IsCompact(op2))) {
            b = __Pyx_PyLong_CompactValue(op2);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op2);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (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) {
                        llb = (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) {
                        b = -(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) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #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(op2)) {
        const long a = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double b = __pyx_PyFloat_AsDouble(op2);
#else
        double b = PyFloat_AS_DOUBLE(op2);
#endif
            double result;
            
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(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 + (unsigned long)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
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op2);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            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;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            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

/* RaiseClosureNameError */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* pep479 */
static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) {
    PyObject *exc, *val, *tb, *cur_exc;
    __Pyx_PyThreadState_declare
    #ifdef __Pyx_StopAsyncIteration_USED
    int is_async_stopiteration = 0;
    #endif
    CYTHON_MAYBE_UNUSED_VAR(in_async_gen);
    cur_exc = PyErr_Occurred();
    if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) {
        #ifdef __Pyx_StopAsyncIteration_USED
        if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) {
            is_async_stopiteration = 1;
        } else
        #endif
            return;
    }
    __Pyx_PyThreadState_assign
    __Pyx_GetException(&exc, &val, &tb);
    Py_XDECREF(exc);
    Py_XDECREF(val);
    Py_XDECREF(tb);
    PyErr_SetString(PyExc_RuntimeError,
        #ifdef __Pyx_StopAsyncIteration_USED
        is_async_stopiteration ? "async generator raised StopAsyncIteration" :
        in_async_gen ? "async generator raised StopIteration" :
        #endif
        "generator raised StopIteration");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    return __Pyx_IterFinish();
}

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* 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
    __Pyx_TypeName type_name;
    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 defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_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 (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    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;
}

/* 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 = __Pyx_PyObject_GetIterNextFunc(iter);
    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 */
#if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
#include <string.h>
#endif
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;
}

/* 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;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* CIntToPyUnicode */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_long(long value, Py_ssize_t width, char padding_char, char format_char) {
    char digits[sizeof(long)*3+2];
    char *dpos, *end = digits + sizeof(long)*3+2;
    const char *hex_digits = DIGITS_HEX;
    Py_ssize_t length, ulength;
    int prepend_sign, last_one_off;
    long remaining;
#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 (format_char == 'X') {
        hex_digits += 16;
        format_char = 'x';
    }
    remaining = value;
    last_one_off = 0;
    dpos = end;
    do {
        int digit_pos;
        switch (format_char) {
        case 'o':
            digit_pos = abs((int)(remaining % (8*8)));
            remaining = (long) (remaining / (8*8));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 8);
            break;
        case 'd':
            digit_pos = abs((int)(remaining % (10*10)));
            remaining = (long) (remaining / (10*10));
            dpos -= 2;
            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
            last_one_off = (digit_pos < 10);
            break;
        case 'x':
            *(--dpos) = hex_digits[abs((int)(remaining % 16))];
            remaining = (long) (remaining / 16);
            break;
        default:
            assert(0);
            break;
        }
    } while (unlikely(remaining != 0));
    assert(!last_one_off || *dpos == '0');
    dpos += last_one_off;
    length = end - dpos;
    ulength = length;
    prepend_sign = 0;
    if (!is_unsigned && value <= neg_one) {
        if (padding_char == ' ' || width <= length + 1) {
            *(--dpos) = '-';
            ++length;
        } else {
            prepend_sign = 1;
        }
        ++ulength;
    }
    if (width > ulength) {
        ulength = width;
    }
    if (ulength == 1) {
        return PyUnicode_FromOrdinal(*dpos);
    }
    return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
}

/* UnpackUnboundCMethod */
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
     METH_VARARGS | METH_KEYWORDS,
     NULL
};
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)))
    #else
    if (likely(!__Pyx_CyOrPyCFunction_Check(method)))
    #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);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            target->method = unbound_method;
        }
    }
    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);
            #endif
        } 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 || PYPY_VERSION_NUM >= 0x07020000)
    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;
}

/* BufferIndexError */
static void __Pyx_RaiseBufferIndexError(int axis) {
  PyErr_Format(PyExc_IndexError,
     "Out of bounds on buffer access (axis %d)", axis);
}

/* PyIntCompare */
static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        return 1;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        return (a == b);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = __Pyx_PyLong_DigitCount(op1);
        const digit* digits = __Pyx_PyLong_Digits(op1);
        if (intval == 0) {
            return (__Pyx_PyLong_IsZero(op1) == 1);
        } else if (intval < 0) {
            if (__Pyx_PyLong_IsNonNeg(op1))
                return 0;
            intval = -intval;
        } else {
            if (__Pyx_PyLong_IsNeg(op1))
                return 0;
        }
        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));
        return (unequal == 0);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
        return ((double)a == (double)b);
    }
    return __Pyx_PyObject_IsTrueAndDecref(
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(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 = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #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
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            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_remainder(op1, op2);
            }
        }
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
                return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
            else {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
            return PyInt_FromLong(x);
    }
    #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
        if (unlikely(__Pyx_PyLong_IsZero(op1))) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_PyLong_IsCompact(op1))) {
            a = __Pyx_PyLong_CompactValue(op1);
        } else {
            const digit* digits = __Pyx_PyLong_Digits(op1);
            const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
            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_floor_divide(op1, op2);
            }
        }
                {
                    long q, r;
                    q = a / b;
                    r = a - q*b;
                    q -= ((r != 0) & ((r ^ b) < 0));
                    x = q;
                }
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                {
                    PY_LONG_LONG q, r;
                    q = lla / llb;
                    r = lla - q*llb;
                    q -= ((r != 0) & ((r ^ llb) < 0));
                    llx = q;
                }
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#endif

/* FixUpExtensionType */
#if CYTHON_USE_TYPE_SPECS
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}
#endif

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
#if !CYTHON_USE_TYPE_SPECS
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    const char* object_name;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    object_name = strrchr(type->tp_name, '.');
    object_name = object_name ? object_name+1 : type->tp_name;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              object_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#else
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *cached_type = NULL;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, object_name);
    if (cached_type) {
        Py_ssize_t basicsize;
#if CYTHON_COMPILING_IN_LIMITED_API
        PyObject *py_basicsize;
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (unlikely(!py_basicsize)) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
#else
        basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
#endif
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectCallMethod1 */
#if !(CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2)
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
#endif
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
#if CYTHON_VECTORCALL && __PYX_LIMITED_VERSION_HEX >= 0x030C00A2
    PyObject *args[2] = {obj, arg};
    (void) __Pyx_PyObject_GetMethod;
    (void) __Pyx_PyObject_CallOneArg;
    (void) __Pyx_PyObject_Call2Args;
    return PyObject_VectorcallMethod(method_name, args, 2 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
#else
    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);
#endif
}

/* CoroutineBase */
#include <frameobject.h>
#if PY_VERSION_HEX >= 0x030b00a6 && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    CYTHON_UNUSED_VAR(__pyx_tstate);
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (likely(__Pyx_IS_TYPE(ev, (PyTypeObject*)PyExc_StopIteration))) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_CLEAR(exc_state->exc_value);
#else
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
#endif
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(__pyx_CoroutineObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(PyObject *gen) {
    const char *msg;
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(PyObject *gen, PyObject *value, int closing) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    CYTHON_MAYBE_UNUSED_VAR(closing);
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_value) {
        #if CYTHON_COMPILING_IN_PYPY
        #else
        PyObject *exc_tb;
        #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
        exc_tb = PyException_GetTraceback(exc_state->exc_value);
        #elif PY_VERSION_HEX >= 0x030B00a4
        exc_tb = ((PyBaseExceptionObject*) exc_state->exc_value)->traceback;
        #else
        exc_tb = exc_state->exc_traceback;
        #endif
        if (exc_tb) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
            PyFrameObject *f = tb->tb_frame;
            assert(f->f_back == NULL);
            #if PY_VERSION_HEX >= 0x030B00A1
            f->f_back = PyThreadState_GetFrame(tstate);
            #else
            Py_XINCREF(tstate->frame);
            f->f_back = tstate->frame;
            #endif
            #if PY_VERSION_HEX >= 0x030B00a4 && !CYTHON_COMPILING_IN_CPYTHON
            Py_DECREF(exc_tb);
            #endif
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body(self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
#if CYTHON_COMPILING_IN_PYPY
    CYTHON_UNUSED_VAR(exc_state);
#else
    PyObject *exc_tb;
    #if PY_VERSION_HEX >= 0x030B00a4
    if (!exc_state->exc_value) return;
    exc_tb = PyException_GetTraceback(exc_state->exc_value);
    #else
    exc_tb = exc_state->exc_traceback;
    #endif
    if (likely(exc_tb)) {
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
        #if PY_VERSION_HEX >= 0x030B00a4
        Py_DECREF(exc_tb);
        #endif
    }
#endif
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject* gen, PyObject *retval) {
    CYTHON_MAYBE_UNUSED_VAR(gen);
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
static CYTHON_INLINE
PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
#if PY_VERSION_HEX <= 0x030A00A1
    return _PyGen_Send(gen, arg);
#else
    PyObject *result;
    if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
        if (PyAsyncGen_CheckExact(gen)) {
            assert(result == Py_None);
            PyErr_SetNone(PyExc_StopAsyncIteration);
        }
        else if (result == Py_None) {
            PyErr_SetNone(PyExc_StopIteration);
        }
        else {
#if PY_VERSION_HEX < 0x030d00A1
            _PyGen_SetStopIterationValue(result);
#else
            if (!PyTuple_Check(result) && !PyExceptionInstance_Check(result)) {
                PyErr_SetObject(PyExc_StopIteration, result);
            } else {
                PyObject *exc = __Pyx_PyObject_CallOneArg(PyExc_StopIteration, result);
                if (likely(exc != NULL)) {
                    PyErr_SetObject(PyExc_StopIteration, exc);
                    Py_DECREF(exc);
                }
            }
#endif
        }
        Py_DECREF(result);
        result = NULL;
    }
    return result;
#endif
}
#endif
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (unlikely(PyErr_Occurred())) {
                PyErr_WriteUnraisable(yf);
            }
        } else {
            retval = __Pyx_PyObject_CallNoArg(meth);
            Py_DECREF(meth);
            if (unlikely(!retval))
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = __Pyx_PyObject_GetIterNextFunc(yf)(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (unlikely(PyErr_Occurred())) {
                    gen->is_running = 0;
                    return NULL;
                }
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = __Pyx_PyObject_Call(meth, args, NULL);
            } else {
                PyObject *cargs[4] = {NULL, typ, val, tb};
                ret = __Pyx_PyObject_FastCall(meth, cargs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (unlikely(!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
#if PY_VERSION_HEX >= 0x030B00a4
    Py_VISIT(exc_state->exc_value);
#else
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
#endif
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_frame);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (unlikely(PyObject_CallFinalizerFromDealloc(self)))
#else
        Py_TYPE(gen)->tp_del(self);
        if (unlikely(Py_REFCNT(self) > 0))
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    __Pyx_PyHeapTypeObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    __Pyx_SET_REFCNT(self, 1);
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(Py_REFCNT(self) > 0);
    if (likely(--self->ob_refcnt == 0)) {
        return;
    }
    {
        Py_ssize_t refcnt = Py_REFCNT(self);
        _Py_NewReference(self);
        __Pyx_SET_REFCNT(self, refcnt);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(Py_TYPE(self)) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_name;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_name, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, void *context)
{
    PyObject *name = self->gi_qualname;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(self->gi_qualname, value);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, void *context)
{
    PyObject *frame = self->gi_frame;
    CYTHON_UNUSED_VAR(context);
    if (!frame) {
        if (unlikely(!self->gi_code)) {
            Py_RETURN_NONE;
        }
        frame = (PyObject *) PyFrame_New(
            PyThreadState_Get(),            /*PyThreadState *tstate,*/
            (PyCodeObject*) self->gi_code,  /*PyCodeObject *code,*/
            __pyx_d,                 /*PyObject *globals,*/
            0                               /*PyObject *locals*/
        );
        if (unlikely(!frame))
            return NULL;
        self->gi_frame = frame;
    }
    Py_INCREF(frame);
    return frame;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    #if PY_VERSION_HEX >= 0x030B00a4
    gen->gi_exc_state.exc_value = NULL;
    #else
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
    #endif
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    gen->gi_frame = NULL;
    PyObject_GC_Track(gen);
    return gen;
}

/* PyObject_GenericGetAttrNoDict */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PatchModuleWithCoroutine */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
#ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (unlikely(!module)) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Coroutine */
static void __Pyx_CoroutineAwait_dealloc(PyObject *self) {
    PyObject_GC_UnTrack(self);
    Py_CLEAR(((__pyx_CoroutineAwaitObject*)self)->coroutine);
    __Pyx_PyHeapTypeObject_GC_Del(self);
}
static int __Pyx_CoroutineAwait_traverse(__pyx_CoroutineAwaitObject *self, visitproc visit, void *arg) {
    Py_VISIT(self->coroutine);
    return 0;
}
static int __Pyx_CoroutineAwait_clear(__pyx_CoroutineAwaitObject *self) {
    Py_CLEAR(self->coroutine);
    return 0;
}
static PyObject *__Pyx_CoroutineAwait_Next(__pyx_CoroutineAwaitObject *self) {
    return __Pyx_Generator_Next(self->coroutine);
}
static PyObject *__Pyx_CoroutineAwait_Send(__pyx_CoroutineAwaitObject *self, PyObject *value) {
    return __Pyx_Coroutine_Send(self->coroutine, value);
}
static PyObject *__Pyx_CoroutineAwait_Throw(__pyx_CoroutineAwaitObject *self, PyObject *args) {
    return __Pyx_Coroutine_Throw(self->coroutine, args);
}
static PyObject *__Pyx_CoroutineAwait_Close(__pyx_CoroutineAwaitObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    return __Pyx_Coroutine_Close(self->coroutine);
}
static PyObject *__Pyx_CoroutineAwait_self(PyObject *self) {
    Py_INCREF(self);
    return self;
}
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_CoroutineAwait_no_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) {
    CYTHON_UNUSED_VAR(type);
    CYTHON_UNUSED_VAR(args);
    CYTHON_UNUSED_VAR(kwargs);
    PyErr_SetString(PyExc_TypeError, "cannot instantiate type, use 'await coroutine' instead");
    return NULL;
}
#endif
static PyObject *__Pyx_CoroutineAwait_reduce_ex(__pyx_CoroutineAwaitObject *self, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    PyErr_Format(PyExc_TypeError, "cannot pickle '%.200s' object",
                         Py_TYPE(self)->tp_name);
    return NULL;
}
static PyMethodDef __pyx_CoroutineAwait_methods[] = {
    {"send", (PyCFunction) __Pyx_CoroutineAwait_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_CoroutineAwait_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_CoroutineAwait_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
    {"__reduce_ex__", (PyCFunction) __Pyx_CoroutineAwait_reduce_ex, METH_O, 0},
    {"__reduce__", (PyCFunction) __Pyx_CoroutineAwait_reduce_ex, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CoroutineAwaitType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CoroutineAwait_dealloc},
    {Py_tp_traverse, (void *)__Pyx_CoroutineAwait_traverse},
    {Py_tp_clear, (void *)__Pyx_CoroutineAwait_clear},
#if !CYTHON_COMPILING_IN_PYPY
    {Py_tp_new, (void *)__Pyx_CoroutineAwait_no_new},
#endif
    {Py_tp_methods, (void *)__pyx_CoroutineAwait_methods},
    {Py_tp_iter, (void *)__Pyx_CoroutineAwait_self},
    {Py_tp_iternext, (void *)__Pyx_CoroutineAwait_Next},
    {0, 0},
};
static PyType_Spec __pyx_CoroutineAwaitType_spec = {
    __PYX_TYPE_MODULE_PREFIX "coroutine_wrapper",
    sizeof(__pyx_CoroutineAwaitObject),
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    __pyx_CoroutineAwaitType_slots
};
#else
static PyTypeObject __pyx_CoroutineAwaitType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "coroutine_wrapper",
    sizeof(__pyx_CoroutineAwaitObject),
    0,
    (destructor) __Pyx_CoroutineAwait_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    PyDoc_STR("A wrapper object implementing __await__ for coroutines."),
    (traverseproc) __Pyx_CoroutineAwait_traverse,
    (inquiry) __Pyx_CoroutineAwait_clear,
    0,
    0,
    __Pyx_CoroutineAwait_self,
    (iternextfunc) __Pyx_CoroutineAwait_Next,
    __pyx_CoroutineAwait_methods,
    0                         ,
    0                      ,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if !CYTHON_COMPILING_IN_PYPY
    __Pyx_CoroutineAwait_no_new,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
#if PY_VERSION_HEX < 0x030500B1 || defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS
static CYTHON_INLINE PyObject *__Pyx__Coroutine_await(PyObject *coroutine) {
    __pyx_CoroutineAwaitObject *await = PyObject_GC_New(__pyx_CoroutineAwaitObject, __pyx_CoroutineAwaitType);
    if (unlikely(!await)) return NULL;
    Py_INCREF(coroutine);
    await->coroutine = coroutine;
    PyObject_GC_Track(await);
    return (PyObject*)await;
}
#endif
#if PY_VERSION_HEX < 0x030500B1
static PyObject *__Pyx_Coroutine_await_method(PyObject *coroutine, PyObject *arg) {
    CYTHON_UNUSED_VAR(arg);
    return __Pyx__Coroutine_await(coroutine);
}
#endif
#if defined(__Pyx_IterableCoroutine_USED) || CYTHON_USE_ASYNC_SLOTS
static PyObject *__Pyx_Coroutine_await(PyObject *coroutine) {
    if (unlikely(!coroutine || !__Pyx_Coroutine_Check(coroutine))) {
        PyErr_SetString(PyExc_TypeError, "invalid input, expected coroutine");
        return NULL;
    }
    return __Pyx__Coroutine_await(coroutine);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
static PyObject *__Pyx_Coroutine_compare(PyObject *obj, PyObject *other, int op) {
    PyObject* result;
    switch (op) {
        case Py_EQ: result = (other == obj) ? Py_True : Py_False; break;
        case Py_NE: result = (other != obj) ? Py_True : Py_False; break;
        default:
            result = Py_NotImplemented;
    }
    Py_INCREF(result);
    return result;
}
#endif
static PyMethodDef __pyx_Coroutine_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in coroutine,\nreturn next iterated value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside coroutine.")},
#if PY_VERSION_HEX < 0x030500B1
    {"__await__", (PyCFunction) __Pyx_Coroutine_await_method, METH_NOARGS,
     (char*) PyDoc_STR("__await__() -> return an iterator to be used in await expression.")},
#endif
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Coroutine_memberlist[] = {
    {(char *) "cr_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "cr_await", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being awaited, or None")},
    {(char*) "cr_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Coroutine_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the coroutine"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the coroutine"), 0},
    {(char *) "cr_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the coroutine"), 0},
    {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CoroutineType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_am_await, (void *)&__Pyx_Coroutine_await},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_methods, (void *)__pyx_Coroutine_methods},
    {Py_tp_members, (void *)__pyx_Coroutine_memberlist},
    {Py_tp_getset, (void *)__pyx_Coroutine_getsets},
    {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
    {0, 0},
};
static PyType_Spec __pyx_CoroutineType_spec = {
    __PYX_TYPE_MODULE_PREFIX "coroutine",
    sizeof(__pyx_CoroutineObject),
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    __pyx_CoroutineType_slots
};
#else
#if CYTHON_USE_ASYNC_SLOTS
static __Pyx_PyAsyncMethodsStruct __pyx_Coroutine_as_async = {
    __Pyx_Coroutine_await,
    0,
    0,
#if PY_VERSION_HEX >= 0x030A00A3
    0,
#endif
};
#endif
static PyTypeObject __pyx_CoroutineType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "coroutine",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
#if CYTHON_USE_ASYNC_SLOTS
    &__pyx_Coroutine_as_async,
#else
    0,
#endif
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
#if CYTHON_USE_ASYNC_SLOTS && CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 && PY_VERSION_HEX < 0x030500B1
    __Pyx_Coroutine_compare,
#else
    0,
#endif
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    0,
    __pyx_Coroutine_methods,
    __pyx_Coroutine_memberlist,
    __pyx_Coroutine_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_Coroutine_init(PyObject *module) {
    CYTHON_MAYBE_UNUSED_VAR(module);
#if CYTHON_USE_TYPE_SPECS
    __pyx_CoroutineType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CoroutineType_spec, NULL);
#else
    __pyx_CoroutineType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_CoroutineType = __Pyx_FetchCommonType(&__pyx_CoroutineType_type);
#endif
    if (unlikely(!__pyx_CoroutineType))
        return -1;
#ifdef __Pyx_IterableCoroutine_USED
    if (unlikely(__pyx_IterableCoroutine_init(module) == -1))
        return -1;
#endif
#if CYTHON_USE_TYPE_SPECS
    __pyx_CoroutineAwaitType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CoroutineAwaitType_spec, NULL);
#else
    __pyx_CoroutineAwaitType = __Pyx_FetchCommonType(&__pyx_CoroutineAwaitType_type);
#endif
    if (unlikely(!__pyx_CoroutineAwaitType))
        return -1;
    return 0;
}

/* GetAwaitIter */
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAwaitableIter(PyObject *o) {
#ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(o)) {
        return __Pyx_NewRef(o);
    }
#endif
    return __Pyx__Coroutine_GetAwaitableIter(o);
}
static void __Pyx_Coroutine_AwaitableIterError(PyObject *source) {
#if PY_VERSION_HEX >= 0x030600B3 && PY_VERSION_HEX < 0x030d0000 || defined(_PyErr_FormatFromCause)
    __Pyx_TypeName source_type_name = __Pyx_PyType_GetName(Py_TYPE(source));
    _PyErr_FormatFromCause(PyExc_TypeError,
        "'async for' received an invalid object from __anext__: " __Pyx_FMT_TYPENAME, source_type_name);
    __Pyx_DECREF_TypeName(source_type_name);
#elif PY_MAJOR_VERSION >= 3
    PyObject *exc, *val, *val2, *tb;
    __Pyx_TypeName source_type_name = __Pyx_PyType_GetName(Py_TYPE(source));
    assert(PyErr_Occurred());
    PyErr_Fetch(&exc, &val, &tb);
    PyErr_NormalizeException(&exc, &val, &tb);
    if (tb != NULL) {
        PyException_SetTraceback(val, tb);
        Py_DECREF(tb);
    }
    Py_DECREF(exc);
    assert(!PyErr_Occurred());
    PyErr_Format(PyExc_TypeError,
        "'async for' received an invalid object from __anext__: " __Pyx_FMT_TYPENAME, source_type_name);
    __Pyx_DECREF_TypeName(source_type_name);
    PyErr_Fetch(&exc, &val2, &tb);
    PyErr_NormalizeException(&exc, &val2, &tb);
    Py_INCREF(val);
    PyException_SetCause(val2, val);
    PyException_SetContext(val2, val);
    PyErr_Restore(exc, val2, tb);
#else
    CYTHON_UNUSED_VAR(source);
#endif
}
static PyObject *__Pyx__Coroutine_GetAwaitableIter(PyObject *obj) {
    PyObject *res;
#if CYTHON_USE_ASYNC_SLOTS
    __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj);
    if (likely(am && am->am_await)) {
        res = (*am->am_await)(obj);
    } else
#endif
#if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact)
    if (PyCoro_CheckExact(obj)) {
        return __Pyx_NewRef(obj);
    } else
#endif
#if CYTHON_COMPILING_IN_CPYTHON && defined(CO_ITERABLE_COROUTINE)
#if PY_VERSION_HEX >= 0x030C00A6
    if (PyGen_CheckExact(obj) && (PyGen_GetCode((PyGenObject*)obj)->co_flags & CO_ITERABLE_COROUTINE)) {
#else
    if (PyGen_CheckExact(obj) && ((PyGenObject*)obj)->gi_code && ((PyCodeObject *)((PyGenObject*)obj)->gi_code)->co_flags & CO_ITERABLE_COROUTINE) {
#endif
        return __Pyx_NewRef(obj);
    } else
#endif
    {
        PyObject *method = NULL;
        int is_method = __Pyx_PyObject_GetMethod(obj, __pyx_n_s_await, &method);
        if (likely(is_method)) {
            res = __Pyx_PyObject_CallOneArg(method, obj);
        } else if (likely(method)) {
            res = __Pyx_PyObject_CallNoArg(method);
        } else
            goto slot_error;
        Py_DECREF(method);
    }
    if (unlikely(!res)) {
        __Pyx_Coroutine_AwaitableIterError(obj);
        goto bad;
    }
    if (unlikely(!PyIter_Check(res))) {
        __Pyx_TypeName res_type_name = __Pyx_PyType_GetName(Py_TYPE(res));
        PyErr_Format(PyExc_TypeError,
            "__await__() returned non-iterator of type '" __Pyx_FMT_TYPENAME "'", res_type_name);
        __Pyx_DECREF_TypeName(res_type_name);
        Py_CLEAR(res);
    } else {
        int is_coroutine = 0;
        #ifdef __Pyx_Coroutine_USED
        is_coroutine |= __Pyx_Coroutine_Check(res);
        #endif
        #if PY_VERSION_HEX >= 0x030500B2 || defined(PyCoro_CheckExact)
        is_coroutine |= PyCoro_CheckExact(res);
        #endif
        if (unlikely(is_coroutine)) {
            /* __await__ must return an *iterator*, not
               a coroutine or another awaitable (see PEP 492) */
            PyErr_SetString(PyExc_TypeError,
                            "__await__() returned a coroutine");
            Py_CLEAR(res);
        }
    }
    return res;
slot_error:
    {
        __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
        PyErr_Format(PyExc_TypeError,
            "object " __Pyx_FMT_TYPENAME " can't be used in 'await' expression", obj_type_name);
        __Pyx_DECREF_TypeName(obj_type_name);
    }
bad:
    return NULL;
}

/* CoroutineYieldFrom */
  static PyObject* __Pyx__Coroutine_Yield_From_Generic(__pyx_CoroutineObject *gen, PyObject *source) {
    PyObject *retval;
    PyObject *source_gen = __Pyx__Coroutine_GetAwaitableIter(source);
    if (unlikely(!source_gen)) {
        return NULL;
    }
    if (__Pyx_Coroutine_Check(source_gen)) {
        retval = __Pyx_Generator_Next(source_gen);
    } else {
        retval = __Pyx_PyObject_GetIterNextFunc(source_gen)(source_gen);
    }
    if (retval) {
        gen->yieldfrom = source_gen;
        return retval;
    }
    Py_DECREF(source_gen);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_Coroutine_Yield_From(__pyx_CoroutineObject *gen, PyObject *source) {
    PyObject *retval;
    if (__Pyx_Coroutine_Check(source)) {
        if (unlikely(((__pyx_CoroutineObject*)source)->yieldfrom)) {
            PyErr_SetString(
                PyExc_RuntimeError,
                "coroutine is being awaited already");
            return NULL;
        }
        retval = __Pyx_Generator_Next(source);
#ifdef __Pyx_AsyncGen_USED
    } else if (__pyx_PyAsyncGenASend_CheckExact(source)) {
        retval = __Pyx_async_gen_asend_iternext(source);
#endif
    } else {
        return __Pyx__Coroutine_Yield_From_Generic(gen, source);
    }
    if (retval) {
        Py_INCREF(source);
        gen->yieldfrom = source;
    }
    return retval;
}

/* ReturnWithStopIteration */
  static void __Pyx__ReturnWithStopIteration(PyObject* value) {
    PyObject *exc, *args;
#if CYTHON_COMPILING_IN_CPYTHON
    __Pyx_PyThreadState_declare
    if (PY_VERSION_HEX >= 0x030C00A6
            || unlikely(PyTuple_Check(value) || PyExceptionInstance_Check(value))) {
        args = PyTuple_New(1);
        if (unlikely(!args)) return;
        Py_INCREF(value);
        PyTuple_SET_ITEM(args, 0, value);
        exc = PyType_Type.tp_call(PyExc_StopIteration, args, NULL);
        Py_DECREF(args);
        if (!exc) return;
    } else {
        Py_INCREF(value);
        exc = value;
    }
    #if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    #if CYTHON_USE_EXC_INFO_STACK
    if (!__pyx_tstate->exc_info->exc_value)
    #else
    if (!__pyx_tstate->exc_type)
    #endif
    {
        Py_INCREF(PyExc_StopIteration);
        __Pyx_ErrRestore(PyExc_StopIteration, exc, NULL);
        return;
    }
    #endif
#else
    args = PyTuple_Pack(1, value);
    if (unlikely(!args)) return;
    exc = PyObject_Call(PyExc_StopIteration, args, NULL);
    Py_DECREF(args);
    if (unlikely(!exc)) return;
#endif
    PyErr_SetObject(PyExc_StopIteration, exc);
    Py_DECREF(exc);
}

/* AsyncIter */
  static PyObject *__Pyx_Coroutine_GetAsyncIter_Generic(PyObject *obj) {
    __Pyx_TypeName obj_type_name;
#if PY_VERSION_HEX < 0x030500B1
    {
        PyObject *iter = __Pyx_PyObject_CallMethod0(obj, __pyx_n_s_aiter);
        if (likely(iter))
            return iter;
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            return NULL;
    }
#else
    (void)&__Pyx_PyObject_CallMethod0;
#endif
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
                 "'async for' requires an object with __aiter__ method, got " __Pyx_FMT_TYPENAME, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_Coroutine_GetAsyncIter(PyObject *obj) {
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(obj)) {
        return __Pyx_NewRef(obj);
    }
#endif
#if CYTHON_USE_ASYNC_SLOTS
    {
        __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj);
        if (likely(am && am->am_aiter)) {
            return (*am->am_aiter)(obj);
        }
    }
#endif
    return __Pyx_Coroutine_GetAsyncIter_Generic(obj);
}
static PyObject *__Pyx__Coroutine_AsyncIterNext(PyObject *obj) {
#if PY_VERSION_HEX < 0x030500B1
    {
        PyObject *value = __Pyx_PyObject_CallMethod0(obj, __pyx_n_s_anext);
        if (likely(value))
            return value;
    }
    if (PyErr_ExceptionMatches(PyExc_AttributeError))
#endif
    {
        __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
        PyErr_Format(PyExc_TypeError,
            "'async for' requires an object with __anext__ method, got " __Pyx_FMT_TYPENAME, obj_type_name);
        __Pyx_DECREF_TypeName(obj_type_name);
    }
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_Coroutine_AsyncIterNext(PyObject *obj) {
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(obj)) {
        return __Pyx_async_gen_anext(obj);
    }
#endif
#if CYTHON_USE_ASYNC_SLOTS
    {
        __Pyx_PyAsyncMethodsStruct* am = __Pyx_PyType_AsAsync(obj);
        if (likely(am && am->am_anext)) {
            return (*am->am_anext)(obj);
        }
    }
#endif
    return __Pyx__Coroutine_AsyncIterNext(obj);
}

/* StopAsyncIteration */
  #if PY_VERSION_HEX < 0x030500B1
#if CYTHON_USE_TYPE_SPECS
#error Using async coroutines with type specs requires Python 3.5 or later.
#else
static PyTypeObject __Pyx__PyExc_StopAsyncIteration_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "StopAsyncIteration",
    sizeof(PyBaseExceptionObject),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
    PyDoc_STR("Signal the end from iterator.__anext__()."),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
    0,
#endif
};
#endif
#endif
static int __pyx_StopAsyncIteration_init(PyObject *module) {
    CYTHON_UNUSED_VAR(module);
#if PY_VERSION_HEX >= 0x030500B1
    __Pyx_PyExc_StopAsyncIteration = PyExc_StopAsyncIteration;
#else
    PyObject *builtins = PyEval_GetBuiltins();
    if (likely(builtins)) {
        PyObject *exc = PyMapping_GetItemString(builtins, (char*) "StopAsyncIteration");
        if (exc) {
            __Pyx_PyExc_StopAsyncIteration = exc;
            return 0;
        }
    }
    PyErr_Clear();
    __Pyx__PyExc_StopAsyncIteration_type.tp_traverse = ((PyTypeObject*)PyExc_BaseException)->tp_traverse;
    __Pyx__PyExc_StopAsyncIteration_type.tp_clear = ((PyTypeObject*)PyExc_BaseException)->tp_clear;
    __Pyx__PyExc_StopAsyncIteration_type.tp_dictoffset = ((PyTypeObject*)PyExc_BaseException)->tp_dictoffset;
    __Pyx__PyExc_StopAsyncIteration_type.tp_base = (PyTypeObject*)PyExc_Exception;
    __Pyx_PyExc_StopAsyncIteration = (PyObject*) __Pyx_FetchCommonType(&__Pyx__PyExc_StopAsyncIteration_type);
    if (unlikely(!__Pyx_PyExc_StopAsyncIteration))
        return -1;
    if (likely(builtins) && unlikely(PyMapping_SetItemString(builtins, (char*) "StopAsyncIteration", __Pyx_PyExc_StopAsyncIteration) < 0))
        return -1;
#endif
    return 0;
}

/* decode_c_bytes */
  static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
         const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
         const char* encoding, const char* errors,
         PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
    if (unlikely((start < 0) | (stop < 0))) {
        if (start < 0) {
            start += length;
            if (start < 0)
                start = 0;
        }
        if (stop < 0)
            stop += length;
    }
    if (stop > length)
        stop = length;
    if (unlikely(stop <= start))
        return __Pyx_NewRef(__pyx_empty_unicode);
    length = stop - start;
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

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

/* CallNextTpTraverse */
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    traverseproc tp_traverse = NULL;
    while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    if (type && tp_traverse)
        return tp_traverse(obj, v, a);
    return 0;
}

/* CallNextTpClear */
  static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    inquiry tp_clear = NULL;
    while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    if (type && tp_clear)
        tp_clear(obj);
}

/* CallNextTpDealloc */
  static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
    PyTypeObject* type = Py_TYPE(obj);
    destructor tp_dealloc = NULL;
    while (type && __Pyx_PyType_GetSlot(type, tp_dealloc, destructor) != current_tp_dealloc)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    while (type && (tp_dealloc = __Pyx_PyType_GetSlot(type, tp_dealloc, destructor)) == current_tp_dealloc)
        type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
    if (type)
        tp_dealloc(obj);
}

/* PyObject_GenericGetAttr */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* ValidateBasesTuple */
  #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_MACROS
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (n < 0) return -1;
#endif
    for (i = 1; i < n; i++)
    {
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
        if (PyClass_Check(b0))
        {
            PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                         PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
  static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* SetVTable */
  static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
  static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
  #if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i;
    void** base_vtables;
    __Pyx_TypeName tp_base_name;
    __Pyx_TypeName base_name;
    void* unknown = (void*)-1;
    PyObject* bases = type->tp_bases;
    int base_depth = 0;
    {
        PyTypeObject* base = type->tp_base;
        while (base) {
            base_depth += 1;
            base = base->tp_base;
        }
    }
    base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
    for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
        void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = type->tp_base;
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = base->tp_base;
            }
        }
    }
    PyErr_Clear();
    free(base_vtables);
    return 0;
bad:
    tp_base_name = __Pyx_PyType_GetName(type->tp_base);
    base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
    free(base_vtables);
    return -1;
}
#endif

/* SetupReduce */
  #if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}
#endif

/* TypeImport */
  #ifndef __PYX_HAVE_RT_ImportType_3_0_12
#define __PYX_HAVE_RT_ImportType_3_0_12
static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name,
    size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size)
{
    PyObject *result = 0;
    char warning[200];
    Py_ssize_t basicsize;
    Py_ssize_t itemsize;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    PyObject *py_itemsize;
#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;
    }
#if !CYTHON_COMPILING_IN_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
    itemsize = ((PyTypeObject *)result)->tp_itemsize;
#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;
    py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
    if (!py_itemsize)
        goto bad;
    itemsize = PyLong_AsSsize_t(py_itemsize);
    Py_DECREF(py_itemsize);
    py_itemsize = 0;
    if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (itemsize) {
        if (size % alignment) {
            alignment = size % alignment;
        }
        if (itemsize < (Py_ssize_t)alignment)
            itemsize = (Py_ssize_t)alignment;
    }
    if ((size_t)(basicsize + itemsize) < 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+itemsize);
        goto bad;
    }
    if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 &&
            ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s size changed, may indicate binary incompatibility. "
            "Expected %zd from C header, got %zd-%zd from PyObject",
            module_name, class_name, size, basicsize, basicsize+itemsize);
        goto bad;
    }
    else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (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

/* PyVectorcallFastCallDict */
  #if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
  #if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#elif PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *
__Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_GetAttrString(op->func, "__module__");
}
static int
__Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    return PyObject_SetAttrString(op->func, "__module__", value);
}
#endif
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
#endif
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
#if !CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#endif
#endif
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyObject *py_name = NULL;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_MACROS
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
#if CYTHON_COMPILING_IN_LIMITED_API
            py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
            if (!py_name) return NULL;
            PyErr_Format(PyExc_TypeError,
                "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                py_name, size);
            Py_DECREF(py_name);
#else
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
#endif
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
    if (!py_name) return NULL;
    PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
                 py_name);
    Py_DECREF(py_name);
#else
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
#endif
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_MACROS
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(!argc) < 0) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
#if PY_MAJOR_VERSION > 2
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
#else
            PyErr_SetString(PyExc_TypeError,
                            "unbound method needs an argument");
#endif
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = ((PyCFunctionObject*)cyfunc)->m_self;
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(PyCFunctionObject, vectorcall),
#endif
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_PyMethod_New,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
  static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* Py3UpdateBases */
  static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
    size_bases = PyTuple_GET_SIZE(bases);
    for (i = 0; i < size_bases; i++) {
        base  = PyTuple_GET_ITEM(bases, i);
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                base = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base);
                Py_INCREF(base);
            }
        }
        j = PyList_GET_SIZE(new_bases);
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
    return result;
error:
    Py_XDECREF(new_bases);
    return NULL;
}

/* SetNewInClass */
  static int __Pyx_SetNewInClass(PyObject *ns, PyObject *name, PyObject *value) {
#ifdef __Pyx_CyFunction_USED
    int ret;
    if (__Pyx_CyFunction_Check(value)) {
        PyObject *staticnew = PyStaticMethod_New(value);
        if (unlikely(!staticnew)) return -1;
        ret = __Pyx_SetNameInClass(ns, name, staticnew);
        Py_DECREF(staticnew);
        return ret;
    }
#endif
    return __Pyx_SetNameInClass(ns, name, value);
}

/* CalculateMetaclass */
  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_MACROS
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        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;
}

/* PyObjectLookupSpecial */
  #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* 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_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            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 PY_VERSION_HEX >= 0x03030000
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
#else
    CYTHON_MAYBE_UNUSED_VAR(qualname);
#endif
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *names_to_set, *key, *value, *set_name, *tmp;
    Py_ssize_t i = 0;
#if CYTHON_USE_TYPE_SLOTS
    names_to_set = PyDict_Copy(type->tp_dict);
#else
    {
        PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
        names_to_set = NULL;
        if (likely(d)) {
            PyObject *names_to_set = PyDict_New();
            int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
            Py_DECREF(d);
            if (unlikely(ret < 0))
                Py_CLEAR(names_to_set);
        }
    }
#endif
    if (unlikely(names_to_set == NULL))
        goto bad;
    while (PyDict_Next(names_to_set, &i, &key, &value)) {
        set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
        if (unlikely(set_name != NULL)) {
            tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
            Py_DECREF(set_name);
            if (unlikely(tmp == NULL)) {
                __Pyx_TypeName value_type_name =
                    __Pyx_PyType_GetName(Py_TYPE(value));
                __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
                PyErr_Format(PyExc_RuntimeError,
#if PY_MAJOR_VERSION >= 3
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name, key, type_name);
#else
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name,
                    PyString_Check(key) ? PyString_AS_STRING(key) : "?",
                    type_name);
#endif
                goto bad;
            } else {
                Py_DECREF(tmp);
            }
        }
        else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
    Py_DECREF(names_to_set);
    return 0;
bad:
    Py_XDECREF(names_to_set);
    return -1;
}
static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *mro = type->tp_mro;
    Py_ssize_t i, nbases;
    if (unlikely(!mro)) goto done;
    (void) &__Pyx_GetBuiltinName;
    Py_INCREF(mro);
    nbases = PyTuple_GET_SIZE(mro);
    assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
    for (i = 1; i < nbases-1; i++) {
        PyObject *base, *dict, *meth;
        base = PyTuple_GET_ITEM(mro, i);
        dict = ((PyTypeObject *)base)->tp_dict;
        meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
        if (unlikely(meth)) {
            descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
            PyObject *res;
            Py_INCREF(meth);
            if (likely(f)) {
                res = f(meth, NULL, type_obj);
                Py_DECREF(meth);
                if (unlikely(!res)) goto bad;
                meth = res;
            }
            res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
            Py_DECREF(meth);
            if (unlikely(!res)) goto bad;
            Py_DECREF(res);
            goto done;
        } else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
done:
    Py_XDECREF(mro);
    return type_obj;
bad:
    Py_XDECREF(mro);
    Py_DECREF(type_obj);
    return NULL;
#else
    PyObject *super_type, *super, *func, *res;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
#else
    super_type = (PyObject*) &PySuper_Type;
    (void) &__Pyx_GetBuiltinName;
#endif
    super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    Py_XDECREF(super_type);
#endif
    if (unlikely(!super)) {
        Py_CLEAR(type_obj);
        goto done;
    }
    func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
    Py_DECREF(super);
    if (likely(!func)) {
        if (unlikely(PyErr_Occurred()))
            Py_CLEAR(type_obj);
        goto done;
    }
    res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
    Py_DECREF(func);
    if (unlikely(!res))
        Py_CLEAR(type_obj);
    Py_XDECREF(res);
done:
    return type_obj;
#endif
}
#endif
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    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;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
#if PY_VERSION_HEX < 0x030600A4
        (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
#else
        mkw
#endif
    );
    Py_XDECREF(owned_metaclass);
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
    if (likely(result) && likely(PyType_Check(result))) {
        if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
            Py_CLEAR(result);
        } else {
            result = __Pyx_InitSubclassPEP487(result, mkw);
        }
    }
#else
    (void) &__Pyx_GetBuiltinName;
#endif
    return result;
}

/* Globals */
  static PyObject* __Pyx_Globals(void) {
    return __Pyx_NewRef(__pyx_d);
}

/* PatchInspect */
  static PyObject* __Pyx_patch_inspect(PyObject* module) {
#if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT)
    static int inspect_patched = 0;
    if (unlikely((!inspect_patched) && module)) {
        module = __Pyx_Coroutine_patch_module(
            module, ""
"old_types = getattr(_module.isgenerator, '_cython_generator_types', None)\n"
"if old_types is None or not isinstance(old_types, set):\n"
"    old_types = set()\n"
"    def cy_wrap(orig_func, type=type, cython_generator_types=old_types):\n"
"        def cy_isgenerator(obj): return type(obj) in cython_generator_types or orig_func(obj)\n"
"        cy_isgenerator._cython_generator_types = cython_generator_types\n"
"        return cy_isgenerator\n"
"    _module.isgenerator = cy_wrap(_module.isgenerator)\n"
"old_types.add(_cython_generator_type)\n"
        );
        inspect_patched = 1;
    }
#else
    if ((0)) return __Pyx_Coroutine_patch_module(module, NULL);
#endif
    return module;
}

/* PatchAsyncIO */
  static PyObject* __Pyx_patch_asyncio(PyObject* module) {
#if PY_VERSION_HEX < 0x030500B2 &&\
        (defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED)) &&\
        (!defined(CYTHON_PATCH_ASYNCIO) || CYTHON_PATCH_ASYNCIO)
    PyObject *patch_module = NULL;
    static int asyncio_patched = 0;
    if (unlikely((!asyncio_patched) && module)) {
        PyObject *package;
        package = __Pyx_Import(__pyx_n_s_asyncio_coroutines, NULL, 0);
        if (package) {
            patch_module = __Pyx_Coroutine_patch_module(
                PyObject_GetAttrString(package, "coroutines"), ""
"try:\n"
"    coro_types = _module._COROUTINE_TYPES\n"
"except AttributeError: pass\n"
"else:\n"
"    if _cython_coroutine_type is not None and _cython_coroutine_type not in coro_types:\n"
"        coro_types = tuple(coro_types) + (_cython_coroutine_type,)\n"
"    if _cython_generator_type is not None and _cython_generator_type not in coro_types:\n"
"        coro_types = tuple(coro_types) + (_cython_generator_type,)\n"
"_module._COROUTINE_TYPES = coro_types\n"
            );
        } else {
            PyErr_Clear();
            package = __Pyx_Import(__pyx_n_s_asyncio_tasks, NULL, 0);
            if (unlikely(!package)) goto asyncio_done;
            patch_module = __Pyx_Coroutine_patch_module(
                PyObject_GetAttrString(package, "tasks"), ""
"if hasattr(_module, 'iscoroutine'):\n"
"    old_types = getattr(_module.iscoroutine, '_cython_coroutine_types', None)\n"
"    if old_types is None or not isinstance(old_types, set):\n"
"        old_types = set()\n"
"        def cy_wrap(orig_func, type=type, cython_coroutine_types=old_types):\n"
"            def cy_iscoroutine(obj): return type(obj) in cython_coroutine_types or orig_func(obj)\n"
"            cy_iscoroutine._cython_coroutine_types = cython_coroutine_types\n"
"            return cy_iscoroutine\n"
"        _module.iscoroutine = cy_wrap(_module.iscoroutine)\n"
"    if _cython_coroutine_type is not None:\n"
"        old_types.add(_cython_coroutine_type)\n"
"    if _cython_generator_type is not None:\n"
"        old_types.add(_cython_generator_type)\n"
            );
        }
        Py_DECREF(package);
        if (unlikely(!patch_module)) goto ignore;
asyncio_done:
        PyErr_Clear();
        asyncio_patched = 1;
#ifdef __Pyx_Generator_USED
        {
            PyObject *inspect_module;
            if (patch_module) {
                inspect_module = PyObject_GetAttr(patch_module, __pyx_n_s_inspect);
                Py_DECREF(patch_module);
            } else {
                inspect_module = __Pyx_Import(__pyx_n_s_inspect, NULL, 0);
            }
            if (unlikely(!inspect_module)) goto ignore;
            inspect_module = __Pyx_patch_inspect(inspect_module);
            if (unlikely(!inspect_module)) {
                Py_DECREF(module);
                module = NULL;
            }
            Py_XDECREF(inspect_module);
        }
#else
        if ((0)) return __Pyx_patch_inspect(module);
#endif
    }
    return module;
ignore:
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch asyncio package with custom generator type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    if ((0)) return __Pyx_patch_inspect(__Pyx_Coroutine_patch_module(module, NULL));
#endif
    return module;
}

/* CLineInTraceback */
  #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    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_GetAttrStrNoError(__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 */
  #if !CYTHON_COMPILING_IN_LIMITED_API
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);
}
#endif

/* AddTraceback */
  #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result;
        result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    #if __PYX_LIMITED_VERSION_HEX < 0x030780000
    {
        PyObject *compiled = NULL, *result = NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
        if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
        compiled = Py_CompileString(
            "out = type(code)(\n"
            "  code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
            "  code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
            "  code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
            "  code.co_lnotab)\n", "<dummy>", Py_file_input);
        if (!compiled) return NULL;
        result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
        Py_DECREF(compiled);
        if (!result) PyErr_Print();
        Py_DECREF(result);
        result = PyDict_GetItemString(scratch_dict, "out");
        if (result) Py_INCREF(result);
        return result;
    }
    #else
    return NULL;
    #endif
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
    if (unlikely(!code_object)) goto bad;
    py_py_line = PyLong_FromLong(py_line);
    if (unlikely(!py_py_line)) goto bad;
    py_funcname = PyUnicode_FromString(funcname);
    if (unlikely(!py_funcname)) goto bad;
    dict = PyDict_New();
    if (unlikely(!dict)) goto bad;
    {
        PyObject *old_code_object = code_object;
        code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
        Py_DECREF(old_code_object);
    }
    if (unlikely(!code_object)) goto bad;
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
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,
        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);
    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;
    PyObject *ptype, *pvalue, *ptraceback;
    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) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __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);
}
#endif

#if PY_MAJOR_VERSION < 3
static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
    __Pyx_TypeName obj_type_name;
    if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
        if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
        if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
                 "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
                 obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return -1;
}
static void __Pyx_ReleaseBuffer(Py_buffer *view) {
    PyObject *obj = view->obj;
    if (!obj) return;
    if (PyObject_CheckBuffer(obj)) {
        PyBuffer_Release(view);
        return;
    }
    if ((0)) {}
    view->obj = NULL;
    Py_DECREF(obj);
}
#endif


  /* MemviewSliceIsContig */
  static int
__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
{
    int i, index, step, start;
    Py_ssize_t itemsize = mvs.memview->view.itemsize;
    if (order == 'F') {
        step = 1;
        start = 0;
    } else {
        step = -1;
        start = ndim - 1;
    }
    for (i = 0; i < ndim; i++) {
        index = start + step * i;
        if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
            return 0;
        itemsize *= mvs.shape[index];
    }
    return 1;
}

/* OverlappingSlices */
  static void
__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
                               void **out_start, void **out_end,
                               int ndim, size_t itemsize)
{
    char *start, *end;
    int i;
    start = end = slice->data;
    for (i = 0; i < ndim; i++) {
        Py_ssize_t stride = slice->strides[i];
        Py_ssize_t extent = slice->shape[i];
        if (extent == 0) {
            *out_start = *out_end = start;
            return;
        } else {
            if (stride > 0)
                end += stride * (extent - 1);
            else
                start += stride * (extent - 1);
        }
    }
    *out_start = start;
    *out_end = end + itemsize;
}
static int
__pyx_slices_overlap(__Pyx_memviewslice *slice1,
                     __Pyx_memviewslice *slice2,
                     int ndim, size_t itemsize)
{
    void *start1, *end1, *start2, *end2;
    __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
    __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
    return (start1 < end2) && (start2 < end1);
}

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

/* MemviewDtypeToObject */
  static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp) {
    return (PyObject *) PyFloat_FromDouble(*(float *) itemp);
}
static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
    float value = __pyx_PyFloat_AsFloat(obj);
    if (unlikely((value == (float)-1) && PyErr_Occurred()))
        return 0;
    *(float *) itemp = value;
    return 1;
}

/* IsLittleEndian */
  static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
{
  union {
    uint32_t u32;
    uint8_t u8[4];
  } S;
  S.u32 = 0x01020304;
  return S.u8[0] == 4;
}

/* BufferFormatCheck */
  static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
                              __Pyx_BufFmt_StackElem* stack,
                              __Pyx_TypeInfo* type) {
  stack[0].field = &ctx->root;
  stack[0].parent_offset = 0;
  ctx->root.type = type;
  ctx->root.name = "buffer dtype";
  ctx->root.offset = 0;
  ctx->head = stack;
  ctx->head->field = &ctx->root;
  ctx->fmt_offset = 0;
  ctx->head->parent_offset = 0;
  ctx->new_packmode = '@';
  ctx->enc_packmode = '@';
  ctx->new_count = 1;
  ctx->enc_count = 0;
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  ctx->is_valid_array = 0;
  ctx->struct_alignment = 0;
  while (type->typegroup == 'S') {
    ++ctx->head;
    ctx->head->field = type->fields;
    ctx->head->parent_offset = 0;
    type = type->fields->type;
  }
}
static int __Pyx_BufFmt_ParseNumber(const char** ts) {
    int count;
    const char* t = *ts;
    if (*t < '0' || *t > '9') {
      return -1;
    } else {
        count = *t++ - '0';
        while (*t >= '0' && *t <= '9') {
            count *= 10;
            count += *t++ - '0';
        }
    }
    *ts = t;
    return count;
}
static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
    int number = __Pyx_BufFmt_ParseNumber(ts);
    if (number == -1)
        PyErr_Format(PyExc_ValueError,\
                     "Does not understand character buffer dtype format string ('%c')", **ts);
    return number;
}
static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
  PyErr_Format(PyExc_ValueError,
               "Unexpected format string character: '%c'", ch);
}
static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
  switch (ch) {
    case '?': return "'bool'";
    case 'c': return "'char'";
    case 'b': return "'signed char'";
    case 'B': return "'unsigned char'";
    case 'h': return "'short'";
    case 'H': return "'unsigned short'";
    case 'i': return "'int'";
    case 'I': return "'unsigned int'";
    case 'l': return "'long'";
    case 'L': return "'unsigned long'";
    case 'q': return "'long long'";
    case 'Q': return "'unsigned long long'";
    case 'f': return (is_complex ? "'complex float'" : "'float'");
    case 'd': return (is_complex ? "'complex double'" : "'double'");
    case 'g': return (is_complex ? "'complex long double'" : "'long double'");
    case 'T': return "a struct";
    case 'O': return "Python object";
    case 'P': return "a pointer";
    case 's': case 'p': return "a string";
    case 0: return "end";
    default: return "unparsable format string";
  }
}
static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return 2;
    case 'i': case 'I': case 'l': case 'L': return 4;
    case 'q': case 'Q': return 8;
    case 'f': return (is_complex ? 8 : 4);
    case 'd': return (is_complex ? 16 : 8);
    case 'g': {
      PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
      return 0;
    }
    case 'O': case 'P': return sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(short);
    case 'i': case 'I': return sizeof(int);
    case 'l': case 'L': return sizeof(long);
    #ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(PY_LONG_LONG);
    #endif
    case 'f': return sizeof(float) * (is_complex ? 2 : 1);
    case 'd': return sizeof(double) * (is_complex ? 2 : 1);
    case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
    case 'O': case 'P': return sizeof(void*);
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
typedef struct { char c; short x; } __Pyx_st_short;
typedef struct { char c; int x; } __Pyx_st_int;
typedef struct { char c; long x; } __Pyx_st_long;
typedef struct { char c; float x; } __Pyx_st_float;
typedef struct { char c; double x; } __Pyx_st_double;
typedef struct { char c; long double x; } __Pyx_st_longdouble;
typedef struct { char c; void *x; } __Pyx_st_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
/* These are for computing the padding at the end of the struct to align
   on the first member of the struct. This will probably the same as above,
   but we don't have any guarantees.
 */
typedef struct { short x; char c; } __Pyx_pad_short;
typedef struct { int x; char c; } __Pyx_pad_int;
typedef struct { long x; char c; } __Pyx_pad_long;
typedef struct { float x; char c; } __Pyx_pad_float;
typedef struct { double x; char c; } __Pyx_pad_double;
typedef struct { long double x; char c; } __Pyx_pad_longdouble;
typedef struct { void *x; char c; } __Pyx_pad_void_p;
#ifdef HAVE_LONG_LONG
typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
#endif
static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
  CYTHON_UNUSED_VAR(is_complex);
  switch (ch) {
    case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
    case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
    case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
    case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
#ifdef HAVE_LONG_LONG
    case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
#endif
    case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
    case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
    case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
    case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
    default:
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
}
static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
  switch (ch) {
    case 'c':
        return 'H';
    case 'b': case 'h': case 'i':
    case 'l': case 'q': case 's': case 'p':
        return 'I';
    case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
        return 'U';
    case 'f': case 'd': case 'g':
        return (is_complex ? 'C' : 'R');
    case 'O':
        return 'O';
    case 'P':
        return 'P';
    default: {
      __Pyx_BufFmt_RaiseUnexpectedChar(ch);
      return 0;
    }
  }
}
static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
    const char* expected;
    const char* quote;
    if (ctx->head == NULL) {
      expected = "end";
      quote = "";
    } else {
      expected = ctx->head->field->type->name;
      quote = "'";
    }
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected %s%s%s but got %s",
                 quote, expected, quote,
                 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
  } else {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_StructField* parent = (ctx->head - 1)->field;
    PyErr_Format(PyExc_ValueError,
                 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
                 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
                 parent->type->name, field->name);
  }
}
static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
  char group;
  size_t size, offset, arraysize = 1;
  if (ctx->enc_type == 0) return 0;
  if (ctx->head->field->type->arraysize[0]) {
    int i, ndim = 0;
    if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
        ctx->is_valid_array = ctx->head->field->type->ndim == 1;
        ndim = 1;
        if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
            PyErr_Format(PyExc_ValueError,
                         "Expected a dimension of size %zu, got %zu",
                         ctx->head->field->type->arraysize[0], ctx->enc_count);
            return -1;
        }
    }
    if (!ctx->is_valid_array) {
      PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
                   ctx->head->field->type->ndim, ndim);
      return -1;
    }
    for (i = 0; i < ctx->head->field->type->ndim; i++) {
      arraysize *= ctx->head->field->type->arraysize[i];
    }
    ctx->is_valid_array = 0;
    ctx->enc_count = 1;
  }
  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
  do {
    __Pyx_StructField* field = ctx->head->field;
    __Pyx_TypeInfo* type = field->type;
    if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
      size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
    } else {
      size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
    }
    if (ctx->enc_packmode == '@') {
      size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
      size_t align_mod_offset;
      if (align_at == 0) return -1;
      align_mod_offset = ctx->fmt_offset % align_at;
      if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
      if (ctx->struct_alignment == 0)
          ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
                                                                 ctx->is_complex);
    }
    if (type->size != size || type->typegroup != group) {
      if (type->typegroup == 'C' && type->fields != NULL) {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        ++ctx->head;
        ctx->head->field = type->fields;
        ctx->head->parent_offset = parent_offset;
        continue;
      }
      if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
      } else {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
      }
    }
    offset = ctx->head->parent_offset + field->offset;
    if (ctx->fmt_offset != offset) {
      PyErr_Format(PyExc_ValueError,
                   "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                   (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
      return -1;
    }
    ctx->fmt_offset += size;
    if (arraysize)
      ctx->fmt_offset += (arraysize - 1) * size;
    --ctx->enc_count;
    while (1) {
      if (field == &ctx->root) {
        ctx->head = NULL;
        if (ctx->enc_count != 0) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return -1;
        }
        break;
      }
      ctx->head->field = ++field;
      if (field->type == NULL) {
        --ctx->head;
        field = ctx->head->field;
        continue;
      } else if (field->type->typegroup == 'S') {
        size_t parent_offset = ctx->head->parent_offset + field->offset;
        if (field->type->fields->type == NULL) continue;
        field = field->type->fields;
        ++ctx->head;
        ctx->head->field = field;
        ctx->head->parent_offset = parent_offset;
        break;
      } else {
        break;
      }
    }
  } while (ctx->enc_count);
  ctx->enc_type = 0;
  ctx->is_complex = 0;
  return 0;
}
static int
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
{
    const char *ts = *tsp;
    int i = 0, number, ndim;
    ++ts;
    if (ctx->new_count != 1) {
        PyErr_SetString(PyExc_ValueError,
                        "Cannot handle repeated arrays in format string");
        return -1;
    }
    if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
    ndim = ctx->head->field->type->ndim;
    while (*ts && *ts != ')') {
        switch (*ts) {
            case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
            default:  break;
        }
        number = __Pyx_BufFmt_ExpectNumber(&ts);
        if (number == -1) return -1;
        if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
            PyErr_Format(PyExc_ValueError,
                        "Expected a dimension of size %zu, got %d",
                        ctx->head->field->type->arraysize[i], number);
            return -1;
        }
        if (*ts != ',' && *ts != ')') {
            PyErr_Format(PyExc_ValueError,
                                "Expected a comma in format string, got '%c'", *ts);
            return -1;
        }
        if (*ts == ',') ts++;
        i++;
    }
    if (i != ndim) {
        PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
                            ctx->head->field->type->ndim, i);
        return -1;
    }
    if (!*ts) {
        PyErr_SetString(PyExc_ValueError,
                        "Unexpected end of format string, expected ')'");
        return -1;
    }
    ctx->is_valid_array = 1;
    ctx->new_count = 1;
    *tsp = ++ts;
    return 0;
}
static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
  int got_Z = 0;
  while (1) {
    switch(*ts) {
      case 0:
        if (ctx->enc_type != 0 && ctx->head == NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        if (ctx->head != NULL) {
          __Pyx_BufFmt_RaiseExpected(ctx);
          return NULL;
        }
        return ts;
      case ' ':
      case '\r':
      case '\n':
        ++ts;
        break;
      case '<':
        if (!__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '>':
      case '!':
        if (__Pyx_Is_Little_Endian()) {
          PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
          return NULL;
        }
        ctx->new_packmode = '=';
        ++ts;
        break;
      case '=':
      case '@':
      case '^':
        ctx->new_packmode = *ts++;
        break;
      case 'T':
        {
          const char* ts_after_sub;
          size_t i, struct_count = ctx->new_count;
          size_t struct_alignment = ctx->struct_alignment;
          ctx->new_count = 1;
          ++ts;
          if (*ts != '{') {
            PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
            return NULL;
          }
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          ctx->enc_count = 0;
          ctx->struct_alignment = 0;
          ++ts;
          ts_after_sub = ts;
          for (i = 0; i != struct_count; ++i) {
            ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
            if (!ts_after_sub) return NULL;
          }
          ts = ts_after_sub;
          if (struct_alignment) ctx->struct_alignment = struct_alignment;
        }
        break;
      case '}':
        {
          size_t alignment = ctx->struct_alignment;
          ++ts;
          if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
          ctx->enc_type = 0;
          if (alignment && ctx->fmt_offset % alignment) {
            ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
          }
        }
        return ts;
      case 'x':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->fmt_offset += ctx->new_count;
        ctx->new_count = 1;
        ctx->enc_count = 0;
        ctx->enc_type = 0;
        ctx->enc_packmode = ctx->new_packmode;
        ++ts;
        break;
      case 'Z':
        got_Z = 1;
        ++ts;
        if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
          __Pyx_BufFmt_RaiseUnexpectedChar('Z');
          return NULL;
        }
        CYTHON_FALLTHROUGH;
      case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
      case 'l': case 'L': case 'q': case 'Q':
      case 'f': case 'd': case 'g':
      case 'O': case 'p':
        if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
            (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
          ctx->enc_count += ctx->new_count;
          ctx->new_count = 1;
          got_Z = 0;
          ++ts;
          break;
        }
        CYTHON_FALLTHROUGH;
      case 's':
        if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
        ctx->enc_count = ctx->new_count;
        ctx->enc_packmode = ctx->new_packmode;
        ctx->enc_type = *ts;
        ctx->is_complex = got_Z;
        ++ts;
        ctx->new_count = 1;
        got_Z = 0;
        break;
      case ':':
        ++ts;
        while(*ts != ':') ++ts;
        ++ts;
        break;
      case '(':
        if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
        break;
      default:
        {
          int number = __Pyx_BufFmt_ExpectNumber(&ts);
          if (number == -1) return NULL;
          ctx->new_count = (size_t)number;
        }
    }
  }
}

/* TypeInfoCompare */
    static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
    int i;
    if (!a || !b)
        return 0;
    if (a == b)
        return 1;
    if (a->size != b->size || a->typegroup != b->typegroup ||
            a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
        if (a->typegroup == 'H' || b->typegroup == 'H') {
            return a->size == b->size;
        } else {
            return 0;
        }
    }
    if (a->ndim) {
        for (i = 0; i < a->ndim; i++)
            if (a->arraysize[i] != b->arraysize[i])
                return 0;
    }
    if (a->typegroup == 'S') {
        if (a->flags != b->flags)
            return 0;
        if (a->fields || b->fields) {
            if (!(a->fields && b->fields))
                return 0;
            for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
                __Pyx_StructField *field_a = a->fields + i;
                __Pyx_StructField *field_b = b->fields + i;
                if (field_a->offset != field_b->offset ||
                    !__pyx_typeinfo_cmp(field_a->type, field_b->type))
                    return 0;
            }
            return !a->fields[i].type && !b->fields[i].type;
        }
    }
    return 1;
}

/* MemviewSliceValidateAndInit */
    static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
    if (buf->shape[dim] <= 1)
        return 1;
    if (buf->strides) {
        if (spec & __Pyx_MEMVIEW_CONTIG) {
            if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
                if (unlikely(buf->strides[dim] != sizeof(void *))) {
                    PyErr_Format(PyExc_ValueError,
                                 "Buffer is not indirectly contiguous "
                                 "in dimension %d.", dim);
                    goto fail;
                }
            } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
        if (spec & __Pyx_MEMVIEW_FOLLOW) {
            Py_ssize_t stride = buf->strides[dim];
            if (stride < 0)
                stride = -stride;
            if (unlikely(stride < buf->itemsize)) {
                PyErr_SetString(PyExc_ValueError,
                                "Buffer and memoryview are not contiguous "
                                "in the same dimension.");
                goto fail;
            }
        }
    } else {
        if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not contiguous in "
                         "dimension %d", dim);
            goto fail;
        } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
            PyErr_Format(PyExc_ValueError,
                         "C-contiguous buffer is not indirect in "
                         "dimension %d", dim);
            goto fail;
        } else if (unlikely(buf->suboffsets)) {
            PyErr_SetString(PyExc_ValueError,
                            "Buffer exposes suboffsets but no strides");
            goto fail;
        }
    }
    return 1;
fail:
    return 0;
}
static int
__pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
{
    CYTHON_UNUSED_VAR(ndim);
    if (spec & __Pyx_MEMVIEW_DIRECT) {
        if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
            PyErr_Format(PyExc_ValueError,
                         "Buffer not compatible with direct access "
                         "in dimension %d.", dim);
            goto fail;
        }
    }
    if (spec & __Pyx_MEMVIEW_PTR) {
        if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
            PyErr_Format(PyExc_ValueError,
                         "Buffer is not indirectly accessible "
                         "in dimension %d.", dim);
            goto fail;
        }
    }
    return 1;
fail:
    return 0;
}
static int
__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
{
    int i;
    if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
        Py_ssize_t stride = 1;
        for (i = 0; i < ndim; i++) {
            if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
                PyErr_SetString(PyExc_ValueError,
                    "Buffer not fortran contiguous.");
                goto fail;
            }
            stride = stride * buf->shape[i];
        }
    } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
        Py_ssize_t stride = 1;
        for (i = ndim - 1; i >- 1; i--) {
            if (unlikely(stride * buf->itemsize != buf->strides[i]  &&  buf->shape[i] > 1)) {
                PyErr_SetString(PyExc_ValueError,
                    "Buffer not C contiguous.");
                goto fail;
            }
            stride = stride * buf->shape[i];
        }
    }
    return 1;
fail:
    return 0;
}
static int __Pyx_ValidateAndInit_memviewslice(
                int *axes_specs,
                int c_or_f_flag,
                int buf_flags,
                int ndim,
                __Pyx_TypeInfo *dtype,
                __Pyx_BufFmt_StackElem stack[],
                __Pyx_memviewslice *memviewslice,
                PyObject *original_obj)
{
    struct __pyx_memoryview_obj *memview, *new_memview;
    __Pyx_RefNannyDeclarations
    Py_buffer *buf;
    int i, spec = 0, retval = -1;
    __Pyx_BufFmt_Context ctx;
    int from_memoryview = __pyx_memoryview_check(original_obj);
    __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
    if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
                                                            original_obj)->typeinfo)) {
        memview = (struct __pyx_memoryview_obj *) original_obj;
        new_memview = NULL;
    } else {
        memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                            original_obj, buf_flags, 0, dtype);
        new_memview = memview;
        if (unlikely(!memview))
            goto fail;
    }
    buf = &memview->view;
    if (unlikely(buf->ndim != ndim)) {
        PyErr_Format(PyExc_ValueError,
                "Buffer has wrong number of dimensions (expected %d, got %d)",
                ndim, buf->ndim);
        goto fail;
    }
    if (new_memview) {
        __Pyx_BufFmt_Init(&ctx, stack, dtype);
        if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
    }
    if (unlikely((unsigned) buf->itemsize != dtype->size)) {
        PyErr_Format(PyExc_ValueError,
                     "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
                     "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
                     buf->itemsize,
                     (buf->itemsize > 1) ? "s" : "",
                     dtype->name,
                     dtype->size,
                     (dtype->size > 1) ? "s" : "");
        goto fail;
    }
    if (buf->len > 0) {
        for (i = 0; i < ndim; i++) {
            spec = axes_specs[i];
            if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
                goto fail;
            if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
                goto fail;
        }
        if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
            goto fail;
    }
    if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
                                         new_memview != NULL) == -1)) {
        goto fail;
    }
    retval = 0;
    goto no_fail;
fail:
    Py_XDECREF(new_memview);
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}

/* ObjectToMemviewSlice */
    static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS_RO | writable_flag, 1,
                                                 &__Pyx_TypeInfo_float, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* ObjectToMemviewSlice */
    static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_short(PyObject *obj, int writable_flag) {
    __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
    __Pyx_BufFmt_StackElem stack[1];
    int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
    int retcode;
    if (obj == Py_None) {
        result.memview = (struct __pyx_memoryview_obj *) Py_None;
        return result;
    }
    retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
                                                 PyBUF_RECORDS_RO | writable_flag, 1,
                                                 &__Pyx_TypeInfo_unsigned_short, stack,
                                                 &result, obj);
    if (unlikely(retcode == -1))
        goto __pyx_fail;
    return result;
__pyx_fail:
    result.memview = NULL;
    result.data = NULL;
    return result;
}

/* MemviewSliceCopyTemplate */
    static __Pyx_memviewslice
__pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
                                 const char *mode, int ndim,
                                 size_t sizeof_dtype, int contig_flag,
                                 int dtype_is_object)
{
    __Pyx_RefNannyDeclarations
    int i;
    __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
    struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
    Py_buffer *buf = &from_memview->view;
    PyObject *shape_tuple = NULL;
    PyObject *temp_int = NULL;
    struct __pyx_array_obj *array_obj = NULL;
    struct __pyx_memoryview_obj *memview_obj = NULL;
    __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
    for (i = 0; i < ndim; i++) {
        if (unlikely(from_mvs->suboffsets[i] >= 0)) {
            PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
                                           "indirect dimensions (axis %d)", i);
            goto fail;
        }
    }
    shape_tuple = PyTuple_New(ndim);
    if (unlikely(!shape_tuple)) {
        goto fail;
    }
    __Pyx_GOTREF(shape_tuple);
    for(i = 0; i < ndim; i++) {
        temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
        if(unlikely(!temp_int)) {
            goto fail;
        } else {
            PyTuple_SET_ITEM(shape_tuple, i, temp_int);
            temp_int = NULL;
        }
    }
    array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
    if (unlikely(!array_obj)) {
        goto fail;
    }
    __Pyx_GOTREF(array_obj);
    memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
                                    (PyObject *) array_obj, contig_flag,
                                    dtype_is_object,
                                    from_mvs->memview->typeinfo);
    if (unlikely(!memview_obj))
        goto fail;
    if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
        goto fail;
    if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
                                                dtype_is_object) < 0))
        goto fail;
    goto no_fail;
fail:
    __Pyx_XDECREF(new_mvs.memview);
    new_mvs.memview = NULL;
    new_mvs.data = NULL;
no_fail:
    __Pyx_XDECREF(shape_tuple);
    __Pyx_XDECREF(temp_int);
    __Pyx_XDECREF(array_obj);
    __Pyx_RefNannyFinishContext();
    return new_mvs;
}

/* MemviewSliceInit */
    static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
                        int ndim,
                        __Pyx_memviewslice *memviewslice,
                        int memview_is_new_reference)
{
    __Pyx_RefNannyDeclarations
    int i, retval=-1;
    Py_buffer *buf = &memview->view;
    __Pyx_RefNannySetupContext("init_memviewslice", 0);
    if (unlikely(memviewslice->memview || memviewslice->data)) {
        PyErr_SetString(PyExc_ValueError,
            "memviewslice is already initialized!");
        goto fail;
    }
    if (buf->strides) {
        for (i = 0; i < ndim; i++) {
            memviewslice->strides[i] = buf->strides[i];
        }
    } else {
        Py_ssize_t stride = buf->itemsize;
        for (i = ndim - 1; i >= 0; i--) {
            memviewslice->strides[i] = stride;
            stride *= buf->shape[i];
        }
    }
    for (i = 0; i < ndim; i++) {
        memviewslice->shape[i]   = buf->shape[i];
        if (buf->suboffsets) {
            memviewslice->suboffsets[i] = buf->suboffsets[i];
        } else {
            memviewslice->suboffsets[i] = -1;
        }
    }
    memviewslice->memview = memview;
    memviewslice->data = (char *)buf->buf;
    if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
        Py_INCREF(memview);
    }
    retval = 0;
    goto no_fail;
fail:
    memviewslice->memview = 0;
    memviewslice->data = 0;
    retval = -1;
no_fail:
    __Pyx_RefNannyFinishContext();
    return retval;
}
#ifndef Py_NO_RETURN
#define Py_NO_RETURN
#endif
static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
    va_list vargs;
    char msg[200];
#if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
    va_start(vargs, fmt);
#else
    va_start(vargs);
#endif
    vsnprintf(msg, 200, fmt, vargs);
    va_end(vargs);
    Py_FatalError(msg);
}
static CYTHON_INLINE int
__pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)++;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE int
__pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
                                   PyThread_type_lock lock)
{
    int result;
    PyThread_acquire_lock(lock, 1);
    result = (*acquisition_count)--;
    PyThread_release_lock(lock);
    return result;
}
static CYTHON_INLINE void
__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
{
    __pyx_nonatomic_int_type old_acquisition_count;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (unlikely(!memview || (PyObject *) memview == Py_None)) {
        return;
    }
    old_acquisition_count = __pyx_add_acquisition_count(memview);
    if (unlikely(old_acquisition_count <= 0)) {
        if (likely(old_acquisition_count == 0)) {
            if (have_gil) {
                Py_INCREF((PyObject *) memview);
            } else {
                PyGILState_STATE _gilstate = PyGILState_Ensure();
                Py_INCREF((PyObject *) memview);
                PyGILState_Release(_gilstate);
            }
        } else {
            __pyx_fatalerror("Acquisition count is %d (line %d)",
                             old_acquisition_count+1, lineno);
        }
    }
}
static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
                                             int have_gil, int lineno) {
    __pyx_nonatomic_int_type old_acquisition_count;
    struct __pyx_memoryview_obj *memview = memslice->memview;
    if (unlikely(!memview || (PyObject *) memview == Py_None)) {
        memslice->memview = NULL;
        return;
    }
    old_acquisition_count = __pyx_sub_acquisition_count(memview);
    memslice->data = NULL;
    if (likely(old_acquisition_count > 1)) {
        memslice->memview = NULL;
    } else if (likely(old_acquisition_count == 1)) {
        if (have_gil) {
            Py_CLEAR(memslice->memview);
        } else {
            PyGILState_STATE _gilstate = PyGILState_Ensure();
            Py_CLEAR(memslice->memview);
            PyGILState_Release(_gilstate);
        }
    } else {
        __pyx_fatalerror("Acquisition count is %d (line %d)",
                         old_acquisition_count-1, lineno);
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#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 (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* 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;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        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;
}

/* 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
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
    static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) {
#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 PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(uint64_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint64_t) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        uint64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint64_t) -1;
        val = __Pyx_PyInt_As_uint64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) >= 2 * PyLong_SHIFT)) {
                            return (uint64_t) (((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) >= 3 * PyLong_SHIFT)) {
                            return (uint64_t) (((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) >= 4 * PyLong_SHIFT)) {
                            return (uint64_t) (((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (uint64_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(uint64_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(uint64_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint64_t) (((uint64_t)-1)*(((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(uint64_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint64_t) ((((((uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(uint64_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint64_t) (((uint64_t)-1)*(((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint64_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint64_t) ((((((((uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(uint64_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint64_t) (((uint64_t)-1)*(((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint64_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint64_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint64_t) ((((((((((uint64_t)digits[3]) << PyLong_SHIFT) | (uint64_t)digits[2]) << PyLong_SHIFT) | (uint64_t)digits[1]) << PyLong_SHIFT) | (uint64_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(uint64_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(uint64_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        uint64_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (uint64_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (uint64_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (uint64_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (uint64_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(uint64_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((uint64_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(uint64_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((uint64_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((uint64_t) 1) << (sizeof(uint64_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (uint64_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint64_t");
    return (uint64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint64_t");
    return (uint64_t) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE enum __pyx_t_3gel_8protocol_8protocol_InputLanguage __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_3gel_8protocol_8protocol_InputLanguage neg_one = (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) -1, const_zero = (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) 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(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        enum __pyx_t_3gel_8protocol_8protocol_InputLanguage val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) -1;
        val = __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) >= 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) (((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) >= 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) (((((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, 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(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) >= 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) (((((((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) (((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)-1)*(((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) ((((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) (((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)-1)*(((((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) ((((((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, 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(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) (((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)-1)*(((((((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, 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(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) - 1 > 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) ((((((((((enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        enum __pyx_t_3gel_8protocol_8protocol_InputLanguage val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
        val = (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) -1;
#endif
        if (unlikely(ret))
            return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum __pyx_t_3gel_8protocol_8protocol_InputLanguage");
    return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum __pyx_t_3gel_8protocol_8protocol_InputLanguage");
    return (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE enum __pyx_t_3gel_8protocol_8protocol_OutputFormat __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_3gel_8protocol_8protocol_OutputFormat neg_one = (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) -1, const_zero = (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) 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(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        enum __pyx_t_3gel_8protocol_8protocol_OutputFormat val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) -1;
        val = __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) >= 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) (((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) >= 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) (((((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, 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(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) >= 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) (((((((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) (((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)-1)*(((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) ((((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) (((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)-1)*(((((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) ((((((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, 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(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) (((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)-1)*(((((((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, 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(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) - 1 > 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) ((((((((((enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        enum __pyx_t_3gel_8protocol_8protocol_OutputFormat val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
        val = (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) -1;
#endif
        if (unlikely(ret))
            return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum __pyx_t_3gel_8protocol_8protocol_OutputFormat");
    return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum __pyx_t_3gel_8protocol_8protocol_OutputFormat");
    return (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) -1;
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus neg_one = (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) -1, const_zero = (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
    static CYTHON_INLINE enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus neg_one = (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) -1, const_zero = (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) 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(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) -1;
        val = __Pyx_PyInt_As_enum____pyx_t_3gel_8protocol_8protocol_TransactionStatus(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) >= 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) (((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) >= 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) (((((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, 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(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) >= 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) (((((((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)-1)*(((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) ((((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)-1)*(((((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) ((((((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, 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(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) (((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)-1)*(((((((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, 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(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) - 1 > 4 * PyLong_SHIFT)) {
                            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) ((((((((((enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[3]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[2]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[1]) << PyLong_SHIFT) | (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyErr_SetString(PyExc_RuntimeError,
                        "_PyLong_AsByteArray() or PyLong_AsNativeBytes() not available, cannot convert large enums");
        val = (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) -1;
#endif
        if (unlikely(ret))
            return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus");
    return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus");
    return (enum __pyx_t_3gel_8protocol_8protocol_TransactionStatus) -1;
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_EdgeFieldCardinality(EdgeFieldCardinality value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const EdgeFieldCardinality neg_one = (EdgeFieldCardinality) -1, const_zero = (EdgeFieldCardinality) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(EdgeFieldCardinality) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(EdgeFieldCardinality) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(EdgeFieldCardinality) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(EdgeFieldCardinality) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(EdgeFieldCardinality) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(EdgeFieldCardinality),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(EdgeFieldCardinality));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* 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;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                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 && PY_VERSION_HEX < 0x030C00A7
        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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                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
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 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(int32_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int32_t) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int32_t) -1;
        val = __Pyx_PyInt_As_int32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) >= 2 * PyLong_SHIFT)) {
                            return (int32_t) (((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) >= 3 * PyLong_SHIFT)) {
                            return (int32_t) (((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) >= 4 * PyLong_SHIFT)) {
                            return (int32_t) (((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (int32_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int32_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int32_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (int32_t) (((int32_t)-1)*(((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int32_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (int32_t) ((((((int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int32_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (int32_t) (((int32_t)-1)*(((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int32_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (int32_t) ((((((((int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int32_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (int32_t) (((int32_t)-1)*(((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int32_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int32_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (int32_t) ((((((((((int32_t)digits[3]) << PyLong_SHIFT) | (int32_t)digits[2]) << PyLong_SHIFT) | (int32_t)digits[1]) << PyLong_SHIFT) | (int32_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int32_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int32_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int32_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int32_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int32_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int32_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int32_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int32_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int32_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int32_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int32_t");
    return (int32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int32_t");
    return (int32_t) -1;
}

/* 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
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_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(int32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_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(uint16_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint16_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint16_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint16_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint16_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint16_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
    static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 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(uint16_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(uint16_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint16_t) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        uint16_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint16_t) -1;
        val = __Pyx_PyInt_As_uint16_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) >= 2 * PyLong_SHIFT)) {
                            return (uint16_t) (((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) >= 3 * PyLong_SHIFT)) {
                            return (uint16_t) (((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) >= 4 * PyLong_SHIFT)) {
                            return (uint16_t) (((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (uint16_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(uint16_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(uint16_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(uint16_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint16_t) (((uint16_t)-1)*(((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(uint16_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint16_t) ((((((uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(uint16_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint16_t) (((uint16_t)-1)*(((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint16_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint16_t) ((((((((uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(uint16_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint16_t) (((uint16_t)-1)*(((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint16_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint16_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint16_t) ((((((((((uint16_t)digits[3]) << PyLong_SHIFT) | (uint16_t)digits[2]) << PyLong_SHIFT) | (uint16_t)digits[1]) << PyLong_SHIFT) | (uint16_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(uint16_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint16_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(uint16_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint16_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        uint16_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (uint16_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (uint16_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (uint16_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (uint16_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(uint16_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((uint16_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(uint16_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((uint16_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((uint16_t) 1) << (sizeof(uint16_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (uint16_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint16_t");
    return (uint16_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint16_t");
    return (uint16_t) -1;
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_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(uint8_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_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(uint32_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint32_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
    static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
#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 PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(int64_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int64_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int64_t) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyInt_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) >= 2 * PyLong_SHIFT)) {
                            return (int64_t) (((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) >= 3 * PyLong_SHIFT)) {
                            return (int64_t) (((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) >= 4 * PyLong_SHIFT)) {
                            return (int64_t) (((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (int64_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int64_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int64_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int64_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (int64_t) (((int64_t)-1)*(((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int64_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (int64_t) ((((((int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int64_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (int64_t) (((int64_t)-1)*(((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int64_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (int64_t) ((((((((int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int64_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (int64_t) (((int64_t)-1)*(((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int64_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int64_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int64_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (int64_t) ((((((((((int64_t)digits[3]) << PyLong_SHIFT) | (int64_t)digits[2]) << PyLong_SHIFT) | (int64_t)digits[1]) << PyLong_SHIFT) | (int64_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int64_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int64_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int64_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int64_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int64_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int64_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int64_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int64_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int64_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int64_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int64_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int64_t");
    return (int64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int64_t");
    return (int64_t) -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
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
    static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 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(uint32_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint32_t) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        uint32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint32_t) -1;
        val = __Pyx_PyInt_As_uint32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) {
                            return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) {
                            return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) {
                            return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (uint32_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(uint32_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(uint32_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        uint32_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (uint32_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (uint32_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (uint32_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (uint32_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(uint32_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((uint32_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(uint32_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((uint32_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((uint32_t) 1) << (sizeof(uint32_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (uint32_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint32_t");
    return (uint32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint32_t");
    return (uint32_t) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE int16_t __Pyx_PyInt_As_int16_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 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(int16_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int16_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int16_t) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        int16_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int16_t) -1;
        val = __Pyx_PyInt_As_int16_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int16_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int16_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) >= 2 * PyLong_SHIFT)) {
                            return (int16_t) (((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int16_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) >= 3 * PyLong_SHIFT)) {
                            return (int16_t) (((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int16_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) >= 4 * PyLong_SHIFT)) {
                            return (int16_t) (((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (int16_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int16_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int16_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int16_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int16_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (int16_t) (((int16_t)-1)*(((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int16_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (int16_t) ((((((int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int16_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (int16_t) (((int16_t)-1)*(((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int16_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (int16_t) ((((((((int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int16_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (int16_t) (((int16_t)-1)*(((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int16_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int16_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int16_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (int16_t) ((((((((((int16_t)digits[3]) << PyLong_SHIFT) | (int16_t)digits[2]) << PyLong_SHIFT) | (int16_t)digits[1]) << PyLong_SHIFT) | (int16_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int16_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int16_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int16_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int16_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int16_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int16_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int16_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int16_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int16_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int16_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int16_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int16_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int16_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int16_t) 1) << (sizeof(int16_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int16_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int16_t");
    return (int16_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int16_t");
    return (int16_t) -1;
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int16_t neg_one = (int16_t) -1, const_zero = (int16_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(int16_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int16_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int16_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int16_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int16_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int16_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int16_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const char neg_one = (char) -1, const_zero = (char) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(char),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_InputLanguage(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_3gel_8protocol_8protocol_InputLanguage neg_one = (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) -1, const_zero = (enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_3gel_8protocol_8protocol_InputLanguage));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_3gel_8protocol_8protocol_OutputFormat(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum __pyx_t_3gel_8protocol_8protocol_OutputFormat neg_one = (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) -1, const_zero = (enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL;
        PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(enum __pyx_t_3gel_8protocol_8protocol_OutputFormat));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
        if (!arg_tuple) goto limited_bad;
        if (!is_unsigned) {
            kwds = PyDict_New();
            if (!kwds) goto limited_bad;
            if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
        }
        result = PyObject_Call(from_bytes, arg_tuple, kwds);
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(arg_tuple);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
    static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const char neg_one = (char) -1, const_zero = (char) 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(char) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (char) val;
        }
    }
#endif
    if (unlikely(!PyLong_Check(x))) {
        char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (char) -1;
        val = __Pyx_PyInt_As_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
                            return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
                            return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, 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(char) >= 4 * PyLong_SHIFT)) {
                            return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        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 (char) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(char) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
                            return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
                            return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
                            return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
                            return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, 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(char) - 1 > 4 * PyLong_SHIFT)) {
                            return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(char, 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(char) - 1 > 4 * PyLong_SHIFT)) {
                            return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(char) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        char val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (char) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (char) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (char) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (char) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((char) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((char) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (char) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to char");
    return (char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to char");
    return (char) -1;
}

/* FormatTypeName */
    #if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name_2);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XDECREF(name);
        name = __Pyx_NewRef(__pyx_n_s__254);
    }
    return name;
}
#endif

/* Generator */
    static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_modulename), 0, 0},
#if CYTHON_USE_TYPE_SPECS
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CoroutineObject, gi_weakreflist), READONLY, 0},
#endif
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
     (char*) PyDoc_STR("Frame of the generator"), 0},
    {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_GeneratorType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_Coroutine_dealloc},
    {Py_tp_traverse, (void *)__Pyx_Coroutine_traverse},
    {Py_tp_iter, (void *)PyObject_SelfIter},
    {Py_tp_iternext, (void *)__Pyx_Generator_Next},
    {Py_tp_methods, (void *)__pyx_Generator_methods},
    {Py_tp_members, (void *)__pyx_Generator_memberlist},
    {Py_tp_getset, (void *)__pyx_Generator_getsets},
    {Py_tp_getattro, (void *) __Pyx_PyObject_GenericGetAttrNoDict},
#if CYTHON_USE_TP_FINALIZE
    {Py_tp_finalize, (void *)__Pyx_Coroutine_del},
#endif
    {0, 0},
};
static PyType_Spec __pyx_GeneratorType_spec = {
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    __pyx_GeneratorType_slots
};
#else
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
    0,
#endif
#if __PYX_NEED_TP_PRINT_SLOT
    0,
#endif
#if PY_VERSION_HEX >= 0x030C0000
    0,
#endif
#if PY_VERSION_HEX >= 0x030d00A4
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
    0,
#endif
};
#endif
static int __pyx_Generator_init(PyObject *module) {
#if CYTHON_USE_TYPE_SPECS
    __pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_GeneratorType_spec, NULL);
#else
    CYTHON_UNUSED_VAR(module);
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
#endif
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
    static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
    return Py_Version & ~0xFFUL;
#else
    const char* rt_version = Py_GetVersion();
    unsigned long version = 0;
    unsigned long factor = 0x01000000UL;
    unsigned int digit = 0;
    int i = 0;
    while (factor) {
        while ('0' <= rt_version[i] && rt_version[i] <= '9') {
            digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
            ++i;
        }
        version += factor * digit;
        if (rt_version[i] != '.')
            break;
        digit = 0;
        factor >>= 8;
        ++i;
    }
    return version;
#endif
}
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* FunctionImport */
    #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12
#define __PYX_HAVE_RT_ImportFunction_3_0_12
static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%.200s does not export expected C function %.200s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

/* InitStrings */
    #if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        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);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
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 && !CYTHON_COMPILING_IN_LIMITED_API) || (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) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_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
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      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);
}


/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
