/* Generated by Cython 0.25.2 */

/* BEGIN: Cython Metadata
{
    "distutils": {}, 
    "module_name": "minipg.minipg"
}
END: Cython Metadata */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_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
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_FASTCALL
  #define METH_FASTCALL 0x80
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
                                              Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#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_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if 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
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

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

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


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

#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

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

#define __PYX_HAVE__minipg__minipg
#define __PYX_HAVE_API__minipg__minipg
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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


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

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


static const char *__pyx_f[] = {
  "minipg/minipg.py",
};

/*--- Type declarations ---*/
struct __pyx_obj_6minipg_6minipg_Connection;
struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute;
struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr;
struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults {
  PyObject *__pyx_arg_file;
};

/* "minipg/minipg.pxd":123
 * 
 * 
 * cdef class Connection:             # <<<<<<<<<<<<<<
 *     cdef user, password, database, host, port, timeout, use_ssl, sock
 *     cdef _ready_for_query
 */
struct __pyx_obj_6minipg_6minipg_Connection {
  PyObject_HEAD
  struct __pyx_vtabstruct_6minipg_6minipg_Connection *__pyx_vtab;
  PyObject *user;
  PyObject *password;
  PyObject *database;
  PyObject *host;
  PyObject *port;
  PyObject *timeout;
  PyObject *use_ssl;
  PyObject *sock;
  PyObject *_ready_for_query;
  PyObject *encoding;
  PyObject *encoders;
  PyObject *autocommit;
  PyObject *tzinfo;
};


/* "minipg/minipg.py":421
 *         pass
 * 
 *     def execute(self, query, args=()):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")
 */
struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute {
  PyObject_HEAD
  PyObject *__pyx_v_args;
  PyObject *__pyx_v_self;
};


/* "minipg/minipg.py":429
 *         if args:
 *             escaped_args = tuple(
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args             # <<<<<<<<<<<<<<
 *             )
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 */
struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr {
  PyObject_HEAD
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *__pyx_outer_scope;
  PyObject *__pyx_v_arg;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "minipg/minipg.py":798
 * 
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):             # <<<<<<<<<<<<<<
 *     def _ustr(c):
 *         if c is None:
 */
struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results {
  PyObject_HEAD
  PyObject *__pyx_v_null;
};



/* "minipg/minipg.py":489
 * 
 * 
 * class Connection(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, user, password, database, host, port, timeout, use_ssl, tzinfo):
 *         self.user = user
 */

struct __pyx_vtabstruct_6minipg_6minipg_Connection {
  PyObject *(*escape_parameter)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_process_messages)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *);
  void (*process_messages)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *);
  void (*_send_message)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *, PyObject *);
  PyObject *(*_read)(struct __pyx_obj_6minipg_6minipg_Connection *, int);
  void (*_write)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *);
  void (*_open)(struct __pyx_obj_6minipg_6minipg_Connection *);
  PyObject *(*begin)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch);
  void (*_execute)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *, PyObject *);
  PyObject *(*commit)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch);
  PyObject *(*rollback)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch);
  PyObject *(*reopen)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch);
  PyObject *(*close)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6minipg_6minipg_Connection *__pyx_vtabptr_6minipg_6minipg_Connection;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#endif

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

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

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

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

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

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

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

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

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

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

/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif

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

/* UnicodeAsUCS4.proto */
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);

/* object_ord.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Ord(c)\
    (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
#else
#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
#endif
static long __Pyx__PyObject_Ord(PyObject* c);

/* 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) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

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

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

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

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

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

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

/* 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)) {
    return __Pyx_decode_c_bytes(
        PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
        start, stop, encoding, errors, decode_func);
}

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

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

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

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

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

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

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

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

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

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);

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

/* CIntFromPy.proto */
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);

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

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

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

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

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static int __Pyx_Coroutine_clear(PyObject *self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

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

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

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

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

/* VoidPtrExport.proto */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);

/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

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

static void __pyx_f_6minipg_6minipg_10Connection__send_message(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_data); /* proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection__process_messages(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static void __pyx_f_6minipg_6minipg_10Connection_process_messages(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection__read(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, int __pyx_v_ln); /* proto*/
static void __pyx_f_6minipg_6minipg_10Connection__write(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_b); /* proto*/
static void __pyx_f_6minipg_6minipg_10Connection__open(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_escape_parameter(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_v, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_6minipg_6minipg_10Connection__execute(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_obj); /* proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_begin(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_commit(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_rollback(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_reopen(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_close(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/

/* Module declarations from 'cython' */

/* Module declarations from 'minipg.minipg' */
static PyTypeObject *__pyx_ptype_6minipg_6minipg_Connection = 0;
static PyTypeObject *__pyx_ptype_6minipg_6minipg___pyx_scope_struct__execute = 0;
static PyTypeObject *__pyx_ptype_6minipg_6minipg___pyx_scope_struct_1_genexpr = 0;
static PyTypeObject *__pyx_ptype_6minipg_6minipg___pyx_scope_struct_2_output_results = 0;
static int __pyx_v_6minipg_6minipg_PY2;
static int __pyx_v_6minipg_6minipg_DEBUG;
static int __pyx_v_6minipg_6minipg_PG_TYPE_BOOL;
static int __pyx_v_6minipg_6minipg_PG_TYPE_BYTEA;
static int __pyx_v_6minipg_6minipg_PG_TYPE_CHAR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_NAME;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INT8;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INT2;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INT2VECTOR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INT4;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGPROC;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TEXT;
static int __pyx_v_6minipg_6minipg_PG_TYPE_OID;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TID;
static int __pyx_v_6minipg_6minipg_PG_TYPE_XID;
static int __pyx_v_6minipg_6minipg_PG_TYPE_CID;
static int __pyx_v_6minipg_6minipg_PG_TYPE_VECTOROID;
static int __pyx_v_6minipg_6minipg_PG_TYPE_JSON;
static int __pyx_v_6minipg_6minipg_PG_TYPE_XML;
static int __pyx_v_6minipg_6minipg_PG_TYPE_PGNODETREE;
static int __pyx_v_6minipg_6minipg_PG_TYPE_POINT;
static int __pyx_v_6minipg_6minipg_PG_TYPE_LSEG;
static int __pyx_v_6minipg_6minipg_PG_TYPE_PATH;
static int __pyx_v_6minipg_6minipg_PG_TYPE_BOX;
static int __pyx_v_6minipg_6minipg_PG_TYPE_POLYGON;
static int __pyx_v_6minipg_6minipg_PG_TYPE_LINE;
static int __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT4;
static int __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT8;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ABSTIME;
static int __pyx_v_6minipg_6minipg_PG_TYPE_RELTIME;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TINTERVAL;
static int __pyx_v_6minipg_6minipg_PG_TYPE_UNKNOWN;
static int __pyx_v_6minipg_6minipg_PG_TYPE_CIRCLE;
static int __pyx_v_6minipg_6minipg_PG_TYPE_CASH;
static int __pyx_v_6minipg_6minipg_PG_TYPE_MACADDR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INET;
static int __pyx_v_6minipg_6minipg_PG_TYPE_CIDR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_NAMEARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INT2ARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INT4ARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TEXTARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ARRAYOID;
static int __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT4ARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ACLITEM;
static int __pyx_v_6minipg_6minipg_PG_TYPE_CSTRINGARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_BPCHAR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_VARCHAR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_DATE;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TIME;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TIMESTAMP;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TIMESTAMPTZ;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INTERVAL;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TIMETZ;
static int __pyx_v_6minipg_6minipg_PG_TYPE_BIT;
static int __pyx_v_6minipg_6minipg_PG_TYPE_VARBIT;
static int __pyx_v_6minipg_6minipg_PG_TYPE_NUMERIC;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REFCURSOR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGPROCEDURE;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGOPER;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGOPERATOR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGCLASS;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGTYPE;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGTYPEARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_UUID;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TSVECTOR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_GTSVECTOR;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TSQUERY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGCONFIG;
static int __pyx_v_6minipg_6minipg_PG_TYPE_REGDICTIONARY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INT4RANGE;
static int __pyx_v_6minipg_6minipg_PG_TYPE_RECORD;
static int __pyx_v_6minipg_6minipg_PG_TYPE_RECORDARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_CSTRING;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ANY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ANYARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_VOID;
static int __pyx_v_6minipg_6minipg_PG_TYPE_TRIGGER;
static int __pyx_v_6minipg_6minipg_PG_TYPE_EVTTRIGGER;
static int __pyx_v_6minipg_6minipg_PG_TYPE_LANGUAGE_HANDLER;
static int __pyx_v_6minipg_6minipg_PG_TYPE_INTERNAL;
static int __pyx_v_6minipg_6minipg_PG_TYPE_OPAQUE;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ANYELEMENT;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ANYNONARRAY;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ANYENUM;
static int __pyx_v_6minipg_6minipg_PG_TYPE_FDW_HANDLER;
static int __pyx_v_6minipg_6minipg_PG_TYPE_ANYRANGE;
static void __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(PyObject *); /*proto*/
static PyObject *__pyx_f_6minipg_6minipg__decode_column(PyObject *, int, PyObject *, PyObject *); /*proto*/
static PY_LONG_LONG __pyx_f_6minipg_6minipg__bytes_to_bint(PyObject *); /*proto*/
static PyObject *__pyx_f_6minipg_6minipg__bint_to_bytes(int); /*proto*/
#define __Pyx_MODULE_NAME "minipg.minipg"
int __pyx_module_is_main_minipg__minipg = 0;

/* Implementation of 'minipg.minipg' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_print;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_chr;
static PyObject *__pyx_builtin_eval;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_UnicodeDecodeError;
static const char __pyx_k_[] = " \n";
static const char __pyx_k_D[] = "-D";
static const char __pyx_k_E[] = "E";
static const char __pyx_k_F[] = "-F";
static const char __pyx_k_H[] = "H\000\000\000\004";
static const char __pyx_k_I[] = "I";
static const char __pyx_k_P[] = "-P";
static const char __pyx_k_Q[] = "Q";
static const char __pyx_k_S[] = "S";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_U[] = "-U";
static const char __pyx_k_W[] = "-W";
static const char __pyx_k_X[] = "X\000\000\000\004";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_f[] = "f";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_s[] = "s";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_v[] = "v";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_23[] = "23";
static const char __pyx_k_TE[] = "TE";
static const char __pyx_k__4[] = "+";
static const char __pyx_k__6[] = "-";
static const char __pyx_k__9[] = ",";
static const char __pyx_k_dt[] = "dt";
static const char __pyx_k_ia[] = "ia";
static const char __pyx_k_rs[] = "rs";
static const char __pyx_k_03o[] = "\\%03o";
static const char __pyx_k_2_0[] = "2.0";
static const char __pyx_k_H_2[] = "-H";
static const char __pyx_k_PY2[] = "PY2";
static const char __pyx_k_Q_2[] = "-Q";
static const char __pyx_k_UTC[] = "UTC";
static const char __pyx_k__16[] = ":";
static const char __pyx_k__18[] = ".";
static const char __pyx_k__26[] = "";
static const char __pyx_k__33[] = " ";
static const char __pyx_k__35[] = ")";
static const char __pyx_k__38[] = "%";
static const char __pyx_k__39[] = "%%";
static const char __pyx_k__50[] = "\000";
static const char __pyx_k__56[] = "\377\377\377\377";
static const char __pyx_k__66[] = "\000\003\000\000";
static const char __pyx_k__69[] = "'";
static const char __pyx_k__70[] = "''";
static const char __pyx_k__73[] = "]";
static const char __pyx_k__74[] = "\t";
static const char __pyx_k_big[] = "big";
static const char __pyx_k_c_S[] = "c\000\000\000\004S\000\000\000\004";
static const char __pyx_k_chr[] = "chr";
static const char __pyx_k_cli[] = "cli";
static const char __pyx_k_cmp[] = "__cmp__";
static const char __pyx_k_cur[] = "cur";
static const char __pyx_k_day[] = "day";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dst[] = "dst";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_exc[] = "exc";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_md5[] = "md5";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_oid[] = "oid";
static const char __pyx_k_s_2[] = "%%s";
static const char __pyx_k_s_3[] = "%s";
static const char __pyx_k_ssl[] = "ssl";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_x_2[] = "\\x";
static const char __pyx_k_DATE[] = "DATE";
static const char __pyx_k_Date[] = "Date";
static const char __pyx_k_NULL[] = "NULL";
static const char __pyx_k_SHOW[] = "SHOW";
static const char __pyx_k_TIME[] = "TIME";
static const char __pyx_k_TRUE[] = "TRUE";
static const char __pyx_k_Time[] = "Time";
static const char __pyx_k_UTF8[] = "UTF8";
static const char __pyx_k_UUID[] = "UUID";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_conn[] = "conn";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_days[] = "days";
static const char __pyx_k_dest[] = "dest";
static const char __pyx_k_eval[] = "eval";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_find[] = "find";
static const char __pyx_k_help[] = "help";
static const char __pyx_k_host[] = "host";
static const char __pyx_k_hour[] = "hour";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_next[] = "__next__";
static const char __pyx_k_null[] = "null";
static const char __pyx_k_port[] = "port";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_recv[] = "recv";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_rows[] = "_rows";
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_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_true[] = "true";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_user[] = "user";
static const char __pyx_k_ustr[] = "_ustr";
static const char __pyx_k_uuid[] = "uuid";
static const char __pyx_k_year[] = "year";
static const char __pyx_k_1_day[] = "1 day";
static const char __pyx_k_ARRAY[] = "ARRAY[";
static const char __pyx_k_BEGIN[] = "BEGIN";
static const char __pyx_k_DEBUG[] = "DEBUG";
static const char __pyx_k_Error[] = "Error";
static const char __pyx_k_FALSE[] = "FALSE";
static const char __pyx_k_H_M_S[] = "%H:%M:%S";
static const char __pyx_k_ROWID[] = "ROWID";
static const char __pyx_k_Y_m_d[] = "%Y-%m-%d";
static const char __pyx_k_ascii[] = "ascii";
static const char __pyx_k_begin[] = "begin";
static const char __pyx_k_bytea[] = "'::bytea";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_d_i_s[] = "%d\t%i\t%s";
static const char __pyx_k_deque[] = "deque";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_false[] = "false";
static const char __pyx_k_hours[] = "hours";
static const char __pyx_k_month[] = "month";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_query[] = "query";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rfind[] = "rfind";
static const char __pyx_k_s_s_s[] = "%s.%s.%s";
static const char __pyx_k_sizes[] = "sizes";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_stdin[] = "stdin";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_write[] = "write";
static const char __pyx_k_BINARY[] = "BINARY";
static const char __pyx_k_Binary[] = "Binary";
static const char __pyx_k_COMMIT[] = "COMMIT";
static const char __pyx_k_Cursor[] = "Cursor";
static const char __pyx_k_DELETE[] = "DELETE";
static const char __pyx_k_INSERT[] = "INSERT";
static const char __pyx_k_NUMBER[] = "NUMBER";
static const char __pyx_k_SELECT[] = "SELECT";
static const char __pyx_k_STRING[] = "STRING";
static const char __pyx_k_UPDATE[] = "UPDATE";
static const char __pyx_k_action[] = "action";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_closed[] = "closed";
static const char __pyx_k_column[] = "column";
static const char __pyx_k_commit[] = "commit";
static const char __pyx_k_cursor[] = "cursor";
static const char __pyx_k_date_2[] = "date '";
static const char __pyx_k_decode[] = "decode";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_header[] = "--header";
static const char __pyx_k_host_2[] = "--host";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_main_2[] = "main";
static const char __pyx_k_minute[] = "minute";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_next_2[] = "next";
static const char __pyx_k_null_2[] = "--null";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_offset[] = "offset";
static const char __pyx_k_params[] = "params";
static const char __pyx_k_parser[] = "parser";
static const char __pyx_k_port_2[] = "--port";
static const char __pyx_k_reopen[] = "reopen";
static const char __pyx_k_second[] = "second";
static const char __pyx_k_socket[] = "socket";
static const char __pyx_k_stderr[] = "stderr";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_tm_min[] = "tm_min";
static const char __pyx_k_tm_mon[] = "tm_mon";
static const char __pyx_k_tm_sec[] = "tm_sec";
static const char __pyx_k_tzinfo[] = "tzinfo";
static const char __pyx_k_tzname[] = "tzname";
static const char __pyx_k_user_2[] = "user\000";
static const char __pyx_k_user_3[] = "--user";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_AF_INET[] = "AF_INET";
static const char __pyx_k_BEGIN_2[] = "BEGIN\000";
static const char __pyx_k_Decimal[] = "Decimal";
static const char __pyx_k_H_M_S_f[] = "%H:%M:%S.%f";
static const char __pyx_k_UTC_dst[] = "UTC.dst";
static const char __pyx_k_VERSION[] = "VERSION";
static const char __pyx_k_Warning[] = "Warning";
static const char __pyx_k_b2a_hex[] = "b2a_hex";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_decimal[] = "decimal";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_execute[] = "execute";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_hashlib[] = "hashlib";
static const char __pyx_k_hex_str[] = "hex_str";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_metavar[] = "metavar";
static const char __pyx_k_minites[] = "minites";
static const char __pyx_k_minutes[] = "minutes";
static const char __pyx_k_nextset[] = "nextset";
static const char __pyx_k_popleft[] = "popleft";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_query_2[] = "--query";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_seconds[] = "seconds";
static const char __pyx_k_timeout[] = "timeout";
static const char __pyx_k_tm_hour[] = "tm_hour";
static const char __pyx_k_tm_mday[] = "tm_mday";
static const char __pyx_k_tm_year[] = "tm_year";
static const char __pyx_k_use_ssl[] = "use_ssl";
static const char __pyx_k_version[] = "__version__";
static const char __pyx_k_COMMIT_2[] = "COMMIT\000";
static const char __pyx_k_DATETIME[] = "DATETIME";
static const char __pyx_k_ROLLBACK[] = "ROLLBACK";
static const char __pyx_k_apilevel[] = "apilevel";
static const char __pyx_k_argparse[] = "argparse";
static const char __pyx_k_binascii[] = "binascii";
static const char __pyx_k_callproc[] = "callproc";
static const char __pyx_k_database[] = "database";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_encoding[] = "encoding";
static const char __pyx_k_fetchall[] = "fetchall";
static const char __pyx_k_fetchone[] = "fetchone";
static const char __pyx_k_interval[] = "interval '";
static const char __pyx_k_password[] = "password";
static const char __pyx_k_platform[] = "platform";
static const char __pyx_k_procname[] = "procname";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_required[] = "required";
static const char __pyx_k_rollback[] = "rollback";
static const char __pyx_k_rowcount[] = "_rowcount";
static const char __pyx_k_strptime[] = "strptime";
static const char __pyx_k_to_bytes[] = "to_bytes";
static const char __pyx_k_DataError[] = "DataError";
static const char __pyx_k_TimeDelta[] = "TimeDelta";
static const char __pyx_k_Timestamp[] = "Timestamp";
static const char __pyx_k_arraysize[] = "arraysize";
static const char __pyx_k_byteorder[] = "byteorder";
static const char __pyx_k_decimal_2[] = "decimal '";
static const char __pyx_k_fetchmany[] = "fetchmany";
static const char __pyx_k_hexdigest[] = "hexdigest";
static const char __pyx_k_host_name[] = "host name";
static const char __pyx_k_isoformat[] = "isoformat";
static const char __pyx_k_localhost[] = "localhost";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_no_header[] = "--no-header";
static const char __pyx_k_separator[] = "separator";
static const char __pyx_k_timedelta[] = "timedelta";
static const char __pyx_k_timestamp[] = "timestamp '";
static const char __pyx_k_traceback[] = "traceback";
static const char __pyx_k_utcoffset[] = "utcoffset";
static const char __pyx_k_ROLLBACK_2[] = "ROLLBACK\000";
static const char __pyx_k_UTC_tzname[] = "UTC.tzname";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_autocommit[] = "autocommit";
static const char __pyx_k_connection[] = "connection";
static const char __pyx_k_database_2[] = "database\000";
static const char __pyx_k_database_3[] = "--database";
static const char __pyx_k_from_bytes[] = "from_bytes";
static const char __pyx_k_is_connect[] = "is_connect";
static const char __pyx_k_login_user[] = "login user";
static const char __pyx_k_paramstyle[] = "paramstyle";
static const char __pyx_k_parse_args[] = "parse_args";
static const char __pyx_k_password_2[] = "--password";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_rowcount_2[] = "rowcount";
static const char __pyx_k_settimeout[] = "settimeout";
static const char __pyx_k_socket_s_d[] = "socket %s:%d";
static const char __pyx_k_store_true[] = "store_true";
static const char __pyx_k_Cursor_next[] = "Cursor.next";
static const char __pyx_k_Error___str[] = "Error.__str__";
static const char __pyx_k_PG_TYPE_ANY[] = "PG_TYPE_ANY";
static const char __pyx_k_PG_TYPE_BIT[] = "PG_TYPE_BIT";
static const char __pyx_k_PG_TYPE_BOX[] = "PG_TYPE_BOX";
static const char __pyx_k_PG_TYPE_CID[] = "PG_TYPE_CID";
static const char __pyx_k_PG_TYPE_OID[] = "PG_TYPE_OID";
static const char __pyx_k_PG_TYPE_TID[] = "PG_TYPE_TID";
static const char __pyx_k_PG_TYPE_XID[] = "PG_TYPE_XID";
static const char __pyx_k_PG_TYPE_XML[] = "PG_TYPE_XML";
static const char __pyx_k_SOCK_STREAM[] = "SOCK_STREAM";
static const char __pyx_k_Unknown_oid[] = "Unknown oid=";
static const char __pyx_k_Y_m_d_H_M_S[] = "%Y-%m-%d %H:%M:%S";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_description[] = "description";
static const char __pyx_k_executemany[] = "executemany";
static const char __pyx_k_microsecond[] = "microsecond";
static const char __pyx_k_parse_point[] = "_parse_point";
static const char __pyx_k_port_number[] = "port number";
static const char __pyx_k_store_false[] = "store_false";
static const char __pyx_k_struct_time[] = "struct_time";
static const char __pyx_k_with_header[] = "with_header";
static const char __pyx_k_wrap_socket[] = "wrap_socket";
static const char __pyx_k_Cursor_close[] = "Cursor.close";
static const char __pyx_k_Error___init[] = "Error.__init__";
static const char __pyx_k_Error___repr[] = "Error.__repr__";
static const char __pyx_k_PG_TYPE_BOOL[] = "PG_TYPE_BOOL";
static const char __pyx_k_PG_TYPE_CASH[] = "PG_TYPE_CASH";
static const char __pyx_k_PG_TYPE_CHAR[] = "PG_TYPE_CHAR";
static const char __pyx_k_PG_TYPE_CIDR[] = "PG_TYPE_CIDR";
static const char __pyx_k_PG_TYPE_DATE[] = "PG_TYPE_DATE";
static const char __pyx_k_PG_TYPE_INET[] = "PG_TYPE_INET";
static const char __pyx_k_PG_TYPE_INT2[] = "PG_TYPE_INT2";
static const char __pyx_k_PG_TYPE_INT4[] = "PG_TYPE_INT4";
static const char __pyx_k_PG_TYPE_INT8[] = "PG_TYPE_INT8";
static const char __pyx_k_PG_TYPE_JSON[] = "PG_TYPE_JSON";
static const char __pyx_k_PG_TYPE_LINE[] = "PG_TYPE_LINE";
static const char __pyx_k_PG_TYPE_LSEG[] = "PG_TYPE_LSEG";
static const char __pyx_k_PG_TYPE_NAME[] = "PG_TYPE_NAME";
static const char __pyx_k_PG_TYPE_PATH[] = "PG_TYPE_PATH";
static const char __pyx_k_PG_TYPE_TEXT[] = "PG_TYPE_TEXT";
static const char __pyx_k_PG_TYPE_TIME[] = "PG_TYPE_TIME";
static const char __pyx_k_PG_TYPE_UUID[] = "PG_TYPE_UUID";
static const char __pyx_k_PG_TYPE_VOID[] = "PG_TYPE_VOID";
static const char __pyx_k_add_argument[] = "add_argument";
static const char __pyx_k_escaped_args[] = "escaped_args";
static const char __pyx_k_microseconds[] = "microseconds";
static const char __pyx_k_query_string[] = "query string";
static const char __pyx_k_set_defaults[] = "set_defaults";
static const char __pyx_k_threadsafety[] = "threadsafety";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_Cursor___exit[] = "Cursor.__exit__";
static const char __pyx_k_Cursor___init[] = "Cursor.__init__";
static const char __pyx_k_Cursor___iter[] = "Cursor.__iter__";
static const char __pyx_k_Cursor___next[] = "Cursor.__next__";
static const char __pyx_k_Cursor_closed[] = "Cursor.closed";
static const char __pyx_k_DatabaseError[] = "DatabaseError";
static const char __pyx_k_InternalError[] = "InternalError";
static const char __pyx_k_Output_header[] = "Output header";
static const char __pyx_k_PG_TYPE_BYTEA[] = "PG_TYPE_BYTEA";
static const char __pyx_k_PG_TYPE_POINT[] = "PG_TYPE_POINT";
static const char __pyx_k_StandardError[] = "StandardError";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_UTC_utcoffset[] = "UTC.utcoffset";
static const char __pyx_k_Y_m_d_H_M_S_f[] = "%Y-%m-%d %H:%M:%S.%f";
static const char __pyx_k_database_name[] = "database name";
static const char __pyx_k_minipg_minipg[] = "minipg.minipg";
static const char __pyx_k_seq_of_params[] = "seq_of_params";
static const char __pyx_k_setinputsizes[] = "setinputsizes";
static const char __pyx_k_setoutputsize[] = "setoutputsize";
static const char __pyx_k_ArgumentParser[] = "ArgumentParser";
static const char __pyx_k_Cursor___enter[] = "Cursor.__enter__";
static const char __pyx_k_Cursor_execute[] = "Cursor.execute";
static const char __pyx_k_Cursor_nextset[] = "Cursor.nextset";
static const char __pyx_k_Database_Error[] = "Database Error";
static const char __pyx_k_IntegrityError[] = "IntegrityError";
static const char __pyx_k_InterfaceError[] = "InterfaceError";
static const char __pyx_k_PG_TYPE_BPCHAR[] = "PG_TYPE_BPCHAR";
static const char __pyx_k_PG_TYPE_CIRCLE[] = "PG_TYPE_CIRCLE";
static const char __pyx_k_PG_TYPE_FLOAT4[] = "PG_TYPE_FLOAT4";
static const char __pyx_k_PG_TYPE_FLOAT8[] = "PG_TYPE_FLOAT8";
static const char __pyx_k_PG_TYPE_OPAQUE[] = "PG_TYPE_OPAQUE";
static const char __pyx_k_PG_TYPE_RECORD[] = "PG_TYPE_RECORD";
static const char __pyx_k_PG_TYPE_TIMETZ[] = "PG_TYPE_TIMETZ";
static const char __pyx_k_PG_TYPE_VARBIT[] = "PG_TYPE_VARBIT";
static const char __pyx_k_login_password[] = "login password";
static const char __pyx_k_output_results[] = "output_results";
static const char __pyx_k_set_autocommit[] = "set_autocommit";
static const char __pyx_k_Cursor_callproc[] = "Cursor.callproc";
static const char __pyx_k_Cursor_fetchall[] = "Cursor.fetchall";
static const char __pyx_k_Cursor_fetchone[] = "Cursor.fetchone";
static const char __pyx_k_Cursor_rowcount[] = "Cursor.rowcount";
static const char __pyx_k_DBAPITypeObject[] = "DBAPITypeObject";
static const char __pyx_k_PG_TYPE_ABSTIME[] = "PG_TYPE_ABSTIME";
static const char __pyx_k_PG_TYPE_ACLITEM[] = "PG_TYPE_ACLITEM";
static const char __pyx_k_PG_TYPE_ANYENUM[] = "PG_TYPE_ANYENUM";
static const char __pyx_k_PG_TYPE_CSTRING[] = "PG_TYPE_CSTRING";
static const char __pyx_k_PG_TYPE_MACADDR[] = "PG_TYPE_MACADDR";
static const char __pyx_k_PG_TYPE_NUMERIC[] = "PG_TYPE_NUMERIC";
static const char __pyx_k_PG_TYPE_POLYGON[] = "PG_TYPE_POLYGON";
static const char __pyx_k_PG_TYPE_REGOPER[] = "PG_TYPE_REGOPER";
static const char __pyx_k_PG_TYPE_REGPROC[] = "PG_TYPE_REGPROC";
static const char __pyx_k_PG_TYPE_REGTYPE[] = "PG_TYPE_REGTYPE";
static const char __pyx_k_PG_TYPE_RELTIME[] = "PG_TYPE_RELTIME";
static const char __pyx_k_PG_TYPE_TRIGGER[] = "PG_TYPE_TRIGGER";
static const char __pyx_k_PG_TYPE_TSQUERY[] = "PG_TYPE_TSQUERY";
static const char __pyx_k_PG_TYPE_UNKNOWN[] = "PG_TYPE_UNKNOWN";
static const char __pyx_k_PG_TYPE_VARCHAR[] = "PG_TYPE_VARCHAR";
static const char __pyx_k_field_separator[] = "--field-separator";
static const char __pyx_k_server_encoding[] = "server_encoding";
static const char __pyx_k_Connection_begin[] = "Connection.begin";
static const char __pyx_k_Connection_close[] = "Connection::close()";
static const char __pyx_k_Cursor_fetchmany[] = "Cursor.fetchmany";
static const char __pyx_k_DisconnectByPeer[] = "DisconnectByPeer";
static const char __pyx_k_NO_DECODE_type_d[] = "NO DECODE type:%d";
static const char __pyx_k_No_output_header[] = "No output header";
static const char __pyx_k_OperationalError[] = "OperationalError";
static const char __pyx_k_PG_TYPE_ANYARRAY[] = "PG_TYPE_ANYARRAY";
static const char __pyx_k_PG_TYPE_ANYRANGE[] = "PG_TYPE_ANYRANGE";
static const char __pyx_k_PG_TYPE_ARRAYOID[] = "PG_TYPE_ARRAYOID";
static const char __pyx_k_PG_TYPE_INTERNAL[] = "PG_TYPE_INTERNAL";
static const char __pyx_k_PG_TYPE_INTERVAL[] = "PG_TYPE_INTERVAL";
static const char __pyx_k_PG_TYPE_REGCLASS[] = "PG_TYPE_REGCLASS";
static const char __pyx_k_PG_TYPE_TSVECTOR[] = "PG_TYPE_TSVECTOR";
static const char __pyx_k_ProgrammingError[] = "ProgrammingError";
static const char __pyx_k_escape_parameter[] = "escape_parameter";
static const char __pyx_k_Connection___exit[] = "Connection.__exit__";
static const char __pyx_k_Connection_commit[] = "Connection.commit";
static const char __pyx_k_Connection_cursor[] = "Connection.cursor";
static const char __pyx_k_Connection_reopen[] = "Connection.reopen";
static const char __pyx_k_NotSupportedError[] = "NotSupportedError";
static const char __pyx_k_PG_TYPE_GTSVECTOR[] = "PG_TYPE_GTSVECTOR";
static const char __pyx_k_PG_TYPE_INT2ARRAY[] = "PG_TYPE_INT2ARRAY";
static const char __pyx_k_PG_TYPE_INT4ARRAY[] = "PG_TYPE_INT4ARRAY";
static const char __pyx_k_PG_TYPE_INT4RANGE[] = "PG_TYPE_INT4RANGE";
static const char __pyx_k_PG_TYPE_NAMEARRAY[] = "PG_TYPE_NAMEARRAY";
static const char __pyx_k_PG_TYPE_REFCURSOR[] = "PG_TYPE_REFCURSOR";
static const char __pyx_k_PG_TYPE_REGCONFIG[] = "PG_TYPE_REGCONFIG";
static const char __pyx_k_PG_TYPE_TEXTARRAY[] = "PG_TYPE_TEXTARRAY";
static const char __pyx_k_PG_TYPE_TIMESTAMP[] = "PG_TYPE_TIMESTAMP";
static const char __pyx_k_PG_TYPE_TINTERVAL[] = "PG_TYPE_TINTERVAL";
static const char __pyx_k_PG_TYPE_VECTOROID[] = "PG_TYPE_VECTOROID";
static const char __pyx_k_field_separator_2[] = "field_separator";
static const char __pyx_k_field_separator_3[] = "field separator";
static const char __pyx_k_Connection___enter[] = "Connection.__enter__";
static const char __pyx_k_Connection_close_2[] = "Connection.close";
static const char __pyx_k_Connection_execute[] = "Connection.execute";
static const char __pyx_k_Cursor_executemany[] = "Cursor.executemany";
static const char __pyx_k_PG_TYPE_ANYELEMENT[] = "PG_TYPE_ANYELEMENT";
static const char __pyx_k_PG_TYPE_EVTTRIGGER[] = "PG_TYPE_EVTTRIGGER";
static const char __pyx_k_PG_TYPE_INT2VECTOR[] = "PG_TYPE_INT2VECTOR";
static const char __pyx_k_PG_TYPE_PGNODETREE[] = "PG_TYPE_PGNODETREE";
static const char __pyx_k_Server_refuses_SSL[] = "Server refuses SSL";
static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError";
static const char __pyx_k_Connection_rollback[] = "Connection.rollback";
static const char __pyx_k_PG_TYPE_ANYNONARRAY[] = "PG_TYPE_ANYNONARRAY";
static const char __pyx_k_PG_TYPE_FDW_HANDLER[] = "PG_TYPE_FDW_HANDLER";
static const char __pyx_k_PG_TYPE_FLOAT4ARRAY[] = "PG_TYPE_FLOAT4ARRAY";
static const char __pyx_k_PG_TYPE_RECORDARRAY[] = "PG_TYPE_RECORDARRAY";
static const char __pyx_k_PG_TYPE_REGOPERATOR[] = "PG_TYPE_REGOPERATOR";
static const char __pyx_k_PG_TYPE_TIMESTAMPTZ[] = "PG_TYPE_TIMESTAMPTZ";
static const char __pyx_k_get_timezone_offset[] = "_get_timezone_offset";
static const char __pyx_k_Cursor_setinputsizes[] = "Cursor.setinputsizes";
static const char __pyx_k_Cursor_setoutputsize[] = "Cursor.setoutputsize";
static const char __pyx_k_InternalError___init[] = "InternalError.__init__";
static const char __pyx_k_PG_TYPE_CSTRINGARRAY[] = "PG_TYPE_CSTRINGARRAY";
static const char __pyx_k_PG_TYPE_REGPROCEDURE[] = "PG_TYPE_REGPROCEDURE";
static const char __pyx_k_PG_TYPE_REGTYPEARRAY[] = "PG_TYPE_REGTYPEARRAY";
static const char __pyx_k_08003_Lost_connection[] = "08003:Lost connection";
static const char __pyx_k_Connection__execute_s[] = "Connection::_execute()\t%s";
static const char __pyx_k_Connection_is_connect[] = "Connection.is_connect";
static const char __pyx_k_DBAPITypeObject___cmp[] = "DBAPITypeObject.__cmp__";
static const char __pyx_k_PG_TYPE_REGDICTIONARY[] = "PG_TYPE_REGDICTIONARY";
static const char __pyx_k_DBAPITypeObject___init[] = "DBAPITypeObject.__init__";
static const char __pyx_k_04d_02d_02d_02d_02d_02d[] = "%04d-%02d-%02d %02d:%02d:%02d";
static const char __pyx_k_08003_Can_t_recv_packets[] = "08003:Can't recv packets";
static const char __pyx_k_NotSupportedError___init[] = "NotSupportedError.__init__";
static const char __pyx_k_PG_TYPE_LANGUAGE_HANDLER[] = "PG_TYPE_LANGUAGE_HANDLER";
static const char __pyx_k_timestamp_with_time_zone[] = "timestamp with time zone '";
static const char __pyx_k_Connection_set_autocommit[] = "Connection.set_autocommit";
static const char __pyx_k_Connection_escape_parameter[] = "Connection.escape_parameter";
static const char __pyx_k_output_results_locals__ustr[] = "output_results.<locals>._ustr";
static const char __pyx_k_Cursor_execute_locals_genexpr[] = "Cursor.execute.<locals>.genexpr";
static const char __pyx_k_null_value_replacement_string[] = "null value replacement string";
static const char __pyx_k_Execute_query_and_print_results[] = "Execute query and print results.";
static const char __pyx_k_decode_column_locals__get_timez[] = "_decode_column.<locals>._get_timezone_offset";
static const char __pyx_k_decode_column_locals__parse_poi[] = "_decode_column.<locals>._parse_point";
static const char __pyx_k_home_nakagami_minipg_minipg_min[] = "/home/nakagami/minipg/minipg/minipg.py";
static const char __pyx_k_Authentication_method_d_not_supp[] = "Authentication method %d not supported.";
static PyObject *__pyx_kp_s_;
static PyObject *__pyx_kp_s_03o;
static PyObject *__pyx_kp_u_04d_02d_02d_02d_02d_02d;
static PyObject *__pyx_kp_u_08003_Can_t_recv_packets;
static PyObject *__pyx_kp_u_08003_Lost_connection;
static PyObject *__pyx_kp_s_1_day;
static PyObject *__pyx_kp_b_23;
static PyObject *__pyx_kp_s_2_0;
static PyObject *__pyx_n_s_AF_INET;
static PyObject *__pyx_kp_u_ARRAY;
static PyObject *__pyx_n_s_ArgumentParser;
static PyObject *__pyx_kp_s_Authentication_method_d_not_supp;
static PyObject *__pyx_n_s_BEGIN;
static PyObject *__pyx_kp_b_BEGIN_2;
static PyObject *__pyx_n_s_BINARY;
static PyObject *__pyx_n_s_Binary;
static PyObject *__pyx_n_s_COMMIT;
static PyObject *__pyx_kp_b_COMMIT_2;
static PyObject *__pyx_n_s_Connection___enter;
static PyObject *__pyx_n_s_Connection___exit;
static PyObject *__pyx_kp_s_Connection__execute_s;
static PyObject *__pyx_n_s_Connection_begin;
static PyObject *__pyx_kp_s_Connection_close;
static PyObject *__pyx_n_s_Connection_close_2;
static PyObject *__pyx_n_s_Connection_commit;
static PyObject *__pyx_n_s_Connection_cursor;
static PyObject *__pyx_n_s_Connection_escape_parameter;
static PyObject *__pyx_n_s_Connection_execute;
static PyObject *__pyx_n_s_Connection_is_connect;
static PyObject *__pyx_n_s_Connection_reopen;
static PyObject *__pyx_n_s_Connection_rollback;
static PyObject *__pyx_n_s_Connection_set_autocommit;
static PyObject *__pyx_n_s_Cursor;
static PyObject *__pyx_n_s_Cursor___enter;
static PyObject *__pyx_n_s_Cursor___exit;
static PyObject *__pyx_n_s_Cursor___init;
static PyObject *__pyx_n_s_Cursor___iter;
static PyObject *__pyx_n_s_Cursor___next;
static PyObject *__pyx_n_s_Cursor_callproc;
static PyObject *__pyx_n_s_Cursor_close;
static PyObject *__pyx_n_s_Cursor_closed;
static PyObject *__pyx_n_s_Cursor_execute;
static PyObject *__pyx_n_s_Cursor_execute_locals_genexpr;
static PyObject *__pyx_n_s_Cursor_executemany;
static PyObject *__pyx_n_s_Cursor_fetchall;
static PyObject *__pyx_n_s_Cursor_fetchmany;
static PyObject *__pyx_n_s_Cursor_fetchone;
static PyObject *__pyx_n_s_Cursor_next;
static PyObject *__pyx_n_s_Cursor_nextset;
static PyObject *__pyx_n_s_Cursor_rowcount;
static PyObject *__pyx_n_s_Cursor_setinputsizes;
static PyObject *__pyx_n_s_Cursor_setoutputsize;
static PyObject *__pyx_kp_s_D;
static PyObject *__pyx_n_s_DATE;
static PyObject *__pyx_n_s_DATETIME;
static PyObject *__pyx_n_s_DBAPITypeObject;
static PyObject *__pyx_n_s_DBAPITypeObject___cmp;
static PyObject *__pyx_n_s_DBAPITypeObject___init;
static PyObject *__pyx_n_s_DEBUG;
static PyObject *__pyx_n_s_DELETE;
static PyObject *__pyx_n_s_DataError;
static PyObject *__pyx_n_s_DatabaseError;
static PyObject *__pyx_kp_b_Database_Error;
static PyObject *__pyx_n_s_Date;
static PyObject *__pyx_n_s_Decimal;
static PyObject *__pyx_n_s_DisconnectByPeer;
static PyObject *__pyx_n_b_E;
static PyObject *__pyx_n_s_Error;
static PyObject *__pyx_n_s_Error___init;
static PyObject *__pyx_n_s_Error___repr;
static PyObject *__pyx_n_s_Error___str;
static PyObject *__pyx_kp_s_Execute_query_and_print_results;
static PyObject *__pyx_kp_s_F;
static PyObject *__pyx_n_u_FALSE;
static PyObject *__pyx_kp_b_H;
static PyObject *__pyx_kp_s_H_2;
static PyObject *__pyx_kp_s_H_M_S;
static PyObject *__pyx_kp_s_H_M_S_f;
static PyObject *__pyx_n_b_I;
static PyObject *__pyx_n_s_INSERT;
static PyObject *__pyx_n_s_IntegrityError;
static PyObject *__pyx_n_s_InterfaceError;
static PyObject *__pyx_n_s_InternalError;
static PyObject *__pyx_n_s_InternalError___init;
static PyObject *__pyx_kp_s_NO_DECODE_type_d;
static PyObject *__pyx_n_s_NULL;
static PyObject *__pyx_n_s_NUMBER;
static PyObject *__pyx_kp_s_No_output_header;
static PyObject *__pyx_n_s_NotSupportedError;
static PyObject *__pyx_n_s_NotSupportedError___init;
static PyObject *__pyx_n_s_OperationalError;
static PyObject *__pyx_kp_s_Output_header;
static PyObject *__pyx_kp_s_P;
static PyObject *__pyx_n_s_PG_TYPE_ABSTIME;
static PyObject *__pyx_n_s_PG_TYPE_ACLITEM;
static PyObject *__pyx_n_s_PG_TYPE_ANY;
static PyObject *__pyx_n_s_PG_TYPE_ANYARRAY;
static PyObject *__pyx_n_s_PG_TYPE_ANYELEMENT;
static PyObject *__pyx_n_s_PG_TYPE_ANYENUM;
static PyObject *__pyx_n_s_PG_TYPE_ANYNONARRAY;
static PyObject *__pyx_n_s_PG_TYPE_ANYRANGE;
static PyObject *__pyx_n_s_PG_TYPE_ARRAYOID;
static PyObject *__pyx_n_s_PG_TYPE_BIT;
static PyObject *__pyx_n_s_PG_TYPE_BOOL;
static PyObject *__pyx_n_s_PG_TYPE_BOX;
static PyObject *__pyx_n_s_PG_TYPE_BPCHAR;
static PyObject *__pyx_n_s_PG_TYPE_BYTEA;
static PyObject *__pyx_n_s_PG_TYPE_CASH;
static PyObject *__pyx_n_s_PG_TYPE_CHAR;
static PyObject *__pyx_n_s_PG_TYPE_CID;
static PyObject *__pyx_n_s_PG_TYPE_CIDR;
static PyObject *__pyx_n_s_PG_TYPE_CIRCLE;
static PyObject *__pyx_n_s_PG_TYPE_CSTRING;
static PyObject *__pyx_n_s_PG_TYPE_CSTRINGARRAY;
static PyObject *__pyx_n_s_PG_TYPE_DATE;
static PyObject *__pyx_n_s_PG_TYPE_EVTTRIGGER;
static PyObject *__pyx_n_s_PG_TYPE_FDW_HANDLER;
static PyObject *__pyx_n_s_PG_TYPE_FLOAT4;
static PyObject *__pyx_n_s_PG_TYPE_FLOAT4ARRAY;
static PyObject *__pyx_n_s_PG_TYPE_FLOAT8;
static PyObject *__pyx_n_s_PG_TYPE_GTSVECTOR;
static PyObject *__pyx_n_s_PG_TYPE_INET;
static PyObject *__pyx_n_s_PG_TYPE_INT2;
static PyObject *__pyx_n_s_PG_TYPE_INT2ARRAY;
static PyObject *__pyx_n_s_PG_TYPE_INT2VECTOR;
static PyObject *__pyx_n_s_PG_TYPE_INT4;
static PyObject *__pyx_n_s_PG_TYPE_INT4ARRAY;
static PyObject *__pyx_n_s_PG_TYPE_INT4RANGE;
static PyObject *__pyx_n_s_PG_TYPE_INT8;
static PyObject *__pyx_n_s_PG_TYPE_INTERNAL;
static PyObject *__pyx_n_s_PG_TYPE_INTERVAL;
static PyObject *__pyx_n_s_PG_TYPE_JSON;
static PyObject *__pyx_n_s_PG_TYPE_LANGUAGE_HANDLER;
static PyObject *__pyx_n_s_PG_TYPE_LINE;
static PyObject *__pyx_n_s_PG_TYPE_LSEG;
static PyObject *__pyx_n_s_PG_TYPE_MACADDR;
static PyObject *__pyx_n_s_PG_TYPE_NAME;
static PyObject *__pyx_n_s_PG_TYPE_NAMEARRAY;
static PyObject *__pyx_n_s_PG_TYPE_NUMERIC;
static PyObject *__pyx_n_s_PG_TYPE_OID;
static PyObject *__pyx_n_s_PG_TYPE_OPAQUE;
static PyObject *__pyx_n_s_PG_TYPE_PATH;
static PyObject *__pyx_n_s_PG_TYPE_PGNODETREE;
static PyObject *__pyx_n_s_PG_TYPE_POINT;
static PyObject *__pyx_n_s_PG_TYPE_POLYGON;
static PyObject *__pyx_n_s_PG_TYPE_RECORD;
static PyObject *__pyx_n_s_PG_TYPE_RECORDARRAY;
static PyObject *__pyx_n_s_PG_TYPE_REFCURSOR;
static PyObject *__pyx_n_s_PG_TYPE_REGCLASS;
static PyObject *__pyx_n_s_PG_TYPE_REGCONFIG;
static PyObject *__pyx_n_s_PG_TYPE_REGDICTIONARY;
static PyObject *__pyx_n_s_PG_TYPE_REGOPER;
static PyObject *__pyx_n_s_PG_TYPE_REGOPERATOR;
static PyObject *__pyx_n_s_PG_TYPE_REGPROC;
static PyObject *__pyx_n_s_PG_TYPE_REGPROCEDURE;
static PyObject *__pyx_n_s_PG_TYPE_REGTYPE;
static PyObject *__pyx_n_s_PG_TYPE_REGTYPEARRAY;
static PyObject *__pyx_n_s_PG_TYPE_RELTIME;
static PyObject *__pyx_n_s_PG_TYPE_TEXT;
static PyObject *__pyx_n_s_PG_TYPE_TEXTARRAY;
static PyObject *__pyx_n_s_PG_TYPE_TID;
static PyObject *__pyx_n_s_PG_TYPE_TIME;
static PyObject *__pyx_n_s_PG_TYPE_TIMESTAMP;
static PyObject *__pyx_n_s_PG_TYPE_TIMESTAMPTZ;
static PyObject *__pyx_n_s_PG_TYPE_TIMETZ;
static PyObject *__pyx_n_s_PG_TYPE_TINTERVAL;
static PyObject *__pyx_n_s_PG_TYPE_TRIGGER;
static PyObject *__pyx_n_s_PG_TYPE_TSQUERY;
static PyObject *__pyx_n_s_PG_TYPE_TSVECTOR;
static PyObject *__pyx_n_s_PG_TYPE_UNKNOWN;
static PyObject *__pyx_n_s_PG_TYPE_UUID;
static PyObject *__pyx_n_s_PG_TYPE_VARBIT;
static PyObject *__pyx_n_s_PG_TYPE_VARCHAR;
static PyObject *__pyx_n_s_PG_TYPE_VECTOROID;
static PyObject *__pyx_n_s_PG_TYPE_VOID;
static PyObject *__pyx_n_s_PG_TYPE_XID;
static PyObject *__pyx_n_s_PG_TYPE_XML;
static PyObject *__pyx_n_s_PY2;
static PyObject *__pyx_n_s_ProgrammingError;
static PyObject *__pyx_n_b_Q;
static PyObject *__pyx_kp_s_Q_2;
static PyObject *__pyx_n_s_ROLLBACK;
static PyObject *__pyx_kp_b_ROLLBACK_2;
static PyObject *__pyx_n_s_ROWID;
static PyObject *__pyx_n_b_S;
static PyObject *__pyx_n_s_SELECT;
static PyObject *__pyx_n_s_SHOW;
static PyObject *__pyx_n_s_SOCK_STREAM;
static PyObject *__pyx_n_s_STRING;
static PyObject *__pyx_kp_s_Server_refuses_SSL;
static PyObject *__pyx_n_s_StandardError;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_n_b_T;
static PyObject *__pyx_n_b_TE;
static PyObject *__pyx_n_s_TIME;
static PyObject *__pyx_n_u_TRUE;
static PyObject *__pyx_n_s_Time;
static PyObject *__pyx_n_s_TimeDelta;
static PyObject *__pyx_n_s_Timestamp;
static PyObject *__pyx_kp_s_U;
static PyObject *__pyx_n_s_UPDATE;
static PyObject *__pyx_n_s_UTC;
static PyObject *__pyx_n_s_UTC_dst;
static PyObject *__pyx_n_s_UTC_tzname;
static PyObject *__pyx_n_s_UTC_utcoffset;
static PyObject *__pyx_n_s_UTF8;
static PyObject *__pyx_n_s_UUID;
static PyObject *__pyx_n_s_UnicodeDecodeError;
static PyObject *__pyx_kp_s_Unknown_oid;
static PyObject *__pyx_n_s_VERSION;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s_W;
static PyObject *__pyx_n_s_Warning;
static PyObject *__pyx_kp_b_X;
static PyObject *__pyx_kp_s_Y_m_d;
static PyObject *__pyx_kp_s_Y_m_d_H_M_S;
static PyObject *__pyx_kp_s_Y_m_d_H_M_S_f;
static PyObject *__pyx_kp_b__16;
static PyObject *__pyx_kp_s__16;
static PyObject *__pyx_kp_s__18;
static PyObject *__pyx_kp_b__26;
static PyObject *__pyx_kp_s__26;
static PyObject *__pyx_kp_s__33;
static PyObject *__pyx_kp_s__35;
static PyObject *__pyx_kp_u__38;
static PyObject *__pyx_kp_u__39;
static PyObject *__pyx_kp_s__4;
static PyObject *__pyx_kp_b__50;
static PyObject *__pyx_kp_b__56;
static PyObject *__pyx_kp_s__6;
static PyObject *__pyx_kp_b__66;
static PyObject *__pyx_kp_s__69;
static PyObject *__pyx_kp_u__69;
static PyObject *__pyx_kp_s__70;
static PyObject *__pyx_kp_u__70;
static PyObject *__pyx_kp_u__73;
static PyObject *__pyx_kp_s__74;
static PyObject *__pyx_kp_s__9;
static PyObject *__pyx_kp_u__9;
static PyObject *__pyx_n_s_action;
static PyObject *__pyx_n_s_add_argument;
static PyObject *__pyx_n_s_apilevel;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_argparse;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arraysize;
static PyObject *__pyx_n_s_ascii;
static PyObject *__pyx_n_s_autocommit;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_b2a_hex;
static PyObject *__pyx_n_s_begin;
static PyObject *__pyx_n_s_big;
static PyObject *__pyx_n_s_binascii;
static PyObject *__pyx_kp_s_bytea;
static PyObject *__pyx_n_s_byteorder;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_kp_b_c_S;
static PyObject *__pyx_n_s_callproc;
static PyObject *__pyx_n_s_chr;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_cli;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closed;
static PyObject *__pyx_n_s_cmp;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_column;
static PyObject *__pyx_n_s_commit;
static PyObject *__pyx_n_s_conn;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_n_s_connection;
static PyObject *__pyx_n_s_cur;
static PyObject *__pyx_n_s_cursor;
static PyObject *__pyx_n_b_d;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_kp_s_d_i_s;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_database;
static PyObject *__pyx_kp_b_database_2;
static PyObject *__pyx_kp_s_database_3;
static PyObject *__pyx_kp_s_database_name;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_kp_s_date_2;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_n_s_day;
static PyObject *__pyx_n_s_days;
static PyObject *__pyx_n_s_decimal;
static PyObject *__pyx_kp_s_decimal_2;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_decode_column_locals__get_timez;
static PyObject *__pyx_n_s_decode_column_locals__parse_poi;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_n_s_deque;
static PyObject *__pyx_n_s_description;
static PyObject *__pyx_n_s_dest;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_dst;
static PyObject *__pyx_n_s_dt;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_encoding;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_escape_parameter;
static PyObject *__pyx_n_s_escaped_args;
static PyObject *__pyx_n_s_eval;
static PyObject *__pyx_n_s_exc;
static PyObject *__pyx_n_s_execute;
static PyObject *__pyx_n_s_executemany;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_false;
static PyObject *__pyx_n_s_fetchall;
static PyObject *__pyx_n_s_fetchmany;
static PyObject *__pyx_n_s_fetchone;
static PyObject *__pyx_kp_s_field_separator;
static PyObject *__pyx_n_s_field_separator_2;
static PyObject *__pyx_kp_s_field_separator_3;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_find;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_from_bytes;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_timezone_offset;
static PyObject *__pyx_n_s_hashlib;
static PyObject *__pyx_kp_s_header;
static PyObject *__pyx_n_s_help;
static PyObject *__pyx_n_s_hex_str;
static PyObject *__pyx_n_s_hexdigest;
static PyObject *__pyx_kp_s_home_nakagami_minipg_minipg_min;
static PyObject *__pyx_n_s_host;
static PyObject *__pyx_kp_s_host_2;
static PyObject *__pyx_kp_s_host_name;
static PyObject *__pyx_n_s_hour;
static PyObject *__pyx_n_s_hours;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_ia;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_kp_u_interval;
static PyObject *__pyx_n_s_is_connect;
static PyObject *__pyx_n_s_isoformat;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_localhost;
static PyObject *__pyx_kp_s_login_password;
static PyObject *__pyx_kp_s_login_user;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_main_2;
static PyObject *__pyx_n_b_md5;
static PyObject *__pyx_n_s_md5;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metavar;
static PyObject *__pyx_n_s_microsecond;
static PyObject *__pyx_n_s_microseconds;
static PyObject *__pyx_n_s_minipg_minipg;
static PyObject *__pyx_n_s_minites;
static PyObject *__pyx_n_s_minute;
static PyObject *__pyx_n_s_minutes;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_month;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_next;
static PyObject *__pyx_n_s_next_2;
static PyObject *__pyx_n_s_nextset;
static PyObject *__pyx_kp_s_no_header;
static PyObject *__pyx_n_s_null;
static PyObject *__pyx_kp_s_null_2;
static PyObject *__pyx_kp_s_null_value_replacement_string;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_oid;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_output_results;
static PyObject *__pyx_n_s_output_results_locals__ustr;
static PyObject *__pyx_n_b_p;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_params;
static PyObject *__pyx_n_s_paramstyle;
static PyObject *__pyx_n_s_parse_args;
static PyObject *__pyx_n_s_parse_point;
static PyObject *__pyx_n_s_parser;
static PyObject *__pyx_n_s_password;
static PyObject *__pyx_kp_s_password_2;
static PyObject *__pyx_n_s_platform;
static PyObject *__pyx_n_s_popleft;
static PyObject *__pyx_n_s_port;
static PyObject *__pyx_kp_s_port_2;
static PyObject *__pyx_kp_s_port_number;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_procname;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_pyx_capi;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_query;
static PyObject *__pyx_kp_s_query_2;
static PyObject *__pyx_kp_s_query_string;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_read;
static PyObject *__pyx_n_s_recv;
static PyObject *__pyx_n_s_reopen;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_required;
static PyObject *__pyx_n_s_rfind;
static PyObject *__pyx_n_s_rollback;
static PyObject *__pyx_n_s_rowcount;
static PyObject *__pyx_n_s_rowcount_2;
static PyObject *__pyx_n_s_rows;
static PyObject *__pyx_n_s_rs;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_kp_u_s_2;
static PyObject *__pyx_kp_u_s_3;
static PyObject *__pyx_kp_s_s_s_s;
static PyObject *__pyx_n_s_second;
static PyObject *__pyx_n_s_seconds;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_separator;
static PyObject *__pyx_n_s_seq_of_params;
static PyObject *__pyx_n_b_server_encoding;
static PyObject *__pyx_n_s_set_autocommit;
static PyObject *__pyx_n_s_set_defaults;
static PyObject *__pyx_n_s_setinputsizes;
static PyObject *__pyx_n_s_setoutputsize;
static PyObject *__pyx_n_s_settimeout;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_sizes;
static PyObject *__pyx_n_s_socket;
static PyObject *__pyx_kp_s_socket_s_d;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_ssl;
static PyObject *__pyx_n_s_stderr;
static PyObject *__pyx_n_s_stdin;
static PyObject *__pyx_n_s_stdout;
static PyObject *__pyx_n_s_store_false;
static PyObject *__pyx_n_s_store_true;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_strptime;
static PyObject *__pyx_n_s_struct_time;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_threadsafety;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_timedelta;
static PyObject *__pyx_n_s_timeout;
static PyObject *__pyx_kp_s_timestamp;
static PyObject *__pyx_kp_s_timestamp_with_time_zone;
static PyObject *__pyx_n_s_tm_hour;
static PyObject *__pyx_n_s_tm_mday;
static PyObject *__pyx_n_s_tm_min;
static PyObject *__pyx_n_s_tm_mon;
static PyObject *__pyx_n_s_tm_sec;
static PyObject *__pyx_n_s_tm_year;
static PyObject *__pyx_n_s_to_bytes;
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_n_s_true;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_tzinfo;
static PyObject *__pyx_n_s_tzname;
static PyObject *__pyx_n_s_use_ssl;
static PyObject *__pyx_n_s_user;
static PyObject *__pyx_kp_b_user_2;
static PyObject *__pyx_kp_s_user_3;
static PyObject *__pyx_n_s_ustr;
static PyObject *__pyx_n_s_utcoffset;
static PyObject *__pyx_n_s_uuid;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_n_s_with_header;
static PyObject *__pyx_n_s_wrap_socket;
static PyObject *__pyx_n_s_write;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_kp_u_x_2;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_year;
static PyObject *__pyx_pf_6minipg_6minipg_3UTC_utcoffset(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dt); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_3UTC_2tzname(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dt); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_3UTC_4dst(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dt); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_14_decode_column__get_timezone_offset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_14_decode_column_2_parse_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_Binary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_15DBAPITypeObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_15DBAPITypeObject_2__cmp__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_5Error_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_5Error_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_13InternalError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_17NotSupportedError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_connection); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_2__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_6callproc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_procname, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_8nextset(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_procname, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_10setinputsizes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_sizes); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_12setoutputsize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_7execute_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_14execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_16executemany(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_seq_of_params); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_18fetchone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_20fetchmany(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_22fetchall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_24close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_26rowcount(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_28closed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_30__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_32__next__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_34next(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection___init__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_user, PyObject *__pyx_v_password, PyObject *__pyx_v_database, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_timeout, PyObject *__pyx_v_use_ssl, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_2__enter__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_4__exit__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_6escape_parameter(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_v); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_8is_dirty___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_8is_connect(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_10cursor(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_12execute(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_14set_autocommit(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_autocommit); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_16begin(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_18commit(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_20rollback(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_22reopen(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_24close(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_8encoding___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection_8encoding_2__set__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection_8encoding_4__del__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_8encoders___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection_8encoders_2__set__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection_8encoders_4__del__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_10autocommit___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection_10autocommit_2__set__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection_10autocommit_4__del__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_10Connection_6tzinfo___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection_6tzinfo_2__set__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6minipg_6minipg_10Connection_6tzinfo_4__del__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_2connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host, PyObject *__pyx_v_user, PyObject *__pyx_v_password, PyObject *__pyx_v_database, PyObject *__pyx_v_port, PyObject *__pyx_v_timeout, PyObject *__pyx_v_use_ssl, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_14output_results__ustr(PyObject *__pyx_self, PyObject *__pyx_v_c); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_4output_results(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_query, PyObject *__pyx_v_with_header, PyObject *__pyx_v_separator, PyObject *__pyx_v_null, PyObject *__pyx_v_file); /* proto */
static PyObject *__pyx_pf_6minipg_6minipg_6main(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file); /* proto */
static PyObject *__pyx_tp_new_6minipg_6minipg_Connection(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6minipg_6minipg___pyx_scope_struct__execute(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6minipg_6minipg___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6minipg_6minipg___pyx_scope_struct_2_output_results(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_7;
static PyObject *__pyx_int_16;
static PyObject *__pyx_int_3600;
static PyObject *__pyx_int_5432;
static PyObject *__pyx_int_8192;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_slice__8;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_slice__24;
static PyObject *__pyx_slice__25;
static PyObject *__pyx_slice__27;
static PyObject *__pyx_slice__29;
static PyObject *__pyx_slice__31;
static PyObject *__pyx_slice__58;
static PyObject *__pyx_slice__59;
static PyObject *__pyx_slice__60;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__180;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__14;
static PyObject *__pyx_codeobj__76;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__95;
static PyObject *__pyx_codeobj__97;
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__103;
static PyObject *__pyx_codeobj__105;
static PyObject *__pyx_codeobj__107;
static PyObject *__pyx_codeobj__109;
static PyObject *__pyx_codeobj__111;
static PyObject *__pyx_codeobj__113;
static PyObject *__pyx_codeobj__115;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__120;
static PyObject *__pyx_codeobj__123;
static PyObject *__pyx_codeobj__125;
static PyObject *__pyx_codeobj__128;
static PyObject *__pyx_codeobj__131;
static PyObject *__pyx_codeobj__133;
static PyObject *__pyx_codeobj__135;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__140;
static PyObject *__pyx_codeobj__142;
static PyObject *__pyx_codeobj__144;
static PyObject *__pyx_codeobj__146;
static PyObject *__pyx_codeobj__148;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__152;
static PyObject *__pyx_codeobj__154;
static PyObject *__pyx_codeobj__156;
static PyObject *__pyx_codeobj__158;
static PyObject *__pyx_codeobj__160;
static PyObject *__pyx_codeobj__162;
static PyObject *__pyx_codeobj__164;
static PyObject *__pyx_codeobj__166;
static PyObject *__pyx_codeobj__168;
static PyObject *__pyx_codeobj__170;
static PyObject *__pyx_codeobj__172;
static PyObject *__pyx_codeobj__174;
static PyObject *__pyx_codeobj__176;
static PyObject *__pyx_codeobj__179;
static PyObject *__pyx_codeobj__181;

/* "minipg/minipg.py":48
 * 
 * 
 * def DEBUG_OUTPUT(s):             # <<<<<<<<<<<<<<
 *     print(s, end=' \n', file=sys.stderr)
 * 
 */

static void __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(PyObject *__pyx_v_s) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("DEBUG_OUTPUT", 0);

  /* "minipg/minipg.py":49
 * 
 * def DEBUG_OUTPUT(s):
 *     print(s, end=' \n', file=sys.stderr)             # <<<<<<<<<<<<<<
 * 
 * #-----------------------------------------------------------------------------
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_end, __pyx_kp_s_) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stderr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_file, __pyx_t_4) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __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_4); __pyx_t_4 = 0;

  /* "minipg/minipg.py":48
 * 
 * 
 * def DEBUG_OUTPUT(s):             # <<<<<<<<<<<<<<
 *     print(s, end=' \n', file=sys.stderr)
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("minipg.minipg.DEBUG_OUTPUT", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "minipg/minipg.py":143
 * 
 * class UTC(datetime.tzinfo):
 *     def utcoffset(self, dt):             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(0)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_3UTC_1utcoffset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_3UTC_1utcoffset = {"utcoffset", (PyCFunction)__pyx_pw_6minipg_6minipg_3UTC_1utcoffset, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_3UTC_1utcoffset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dt = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("utcoffset (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dt,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("utcoffset", 1, 2, 2, 1); __PYX_ERR(0, 143, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "utcoffset") < 0)) __PYX_ERR(0, 143, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_dt = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("utcoffset", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 143, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.UTC.utcoffset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_3UTC_utcoffset(__pyx_self, __pyx_v_self, __pyx_v_dt);

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

static PyObject *__pyx_pf_6minipg_6minipg_3UTC_utcoffset(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("utcoffset", 0);

  /* "minipg/minipg.py":144
 * class UTC(datetime.tzinfo):
 *     def utcoffset(self, dt):
 *         return datetime.timedelta(0)             # <<<<<<<<<<<<<<
 * 
 *     def tzname(self, dt):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __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(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __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;

  /* "minipg/minipg.py":143
 * 
 * class UTC(datetime.tzinfo):
 *     def utcoffset(self, dt):             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(0)
 * 
 */

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

/* "minipg/minipg.py":146
 *         return datetime.timedelta(0)
 * 
 *     def tzname(self, dt):             # <<<<<<<<<<<<<<
 *         return "UTC"
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_3UTC_3tzname(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_3UTC_3tzname = {"tzname", (PyCFunction)__pyx_pw_6minipg_6minipg_3UTC_3tzname, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_3UTC_3tzname(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dt = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tzname (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dt,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tzname", 1, 2, 2, 1); __PYX_ERR(0, 146, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tzname") < 0)) __PYX_ERR(0, 146, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_dt = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tzname", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 146, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.UTC.tzname", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_3UTC_2tzname(__pyx_self, __pyx_v_self, __pyx_v_dt);

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

static PyObject *__pyx_pf_6minipg_6minipg_3UTC_2tzname(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tzname", 0);

  /* "minipg/minipg.py":147
 * 
 *     def tzname(self, dt):
 *         return "UTC"             # <<<<<<<<<<<<<<
 * 
 *     def dst(self, dt):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_s_UTC);
  __pyx_r = __pyx_n_s_UTC;
  goto __pyx_L0;

  /* "minipg/minipg.py":146
 *         return datetime.timedelta(0)
 * 
 *     def tzname(self, dt):             # <<<<<<<<<<<<<<
 *         return "UTC"
 * 
 */

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

/* "minipg/minipg.py":149
 *         return "UTC"
 * 
 *     def dst(self, dt):             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(0)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_3UTC_5dst(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_3UTC_5dst = {"dst", (PyCFunction)__pyx_pw_6minipg_6minipg_3UTC_5dst, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_3UTC_5dst(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dt = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dst (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dt,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dst", 1, 2, 2, 1); __PYX_ERR(0, 149, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dst") < 0)) __PYX_ERR(0, 149, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_dt = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dst", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 149, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.UTC.dst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_3UTC_4dst(__pyx_self, __pyx_v_self, __pyx_v_dt);

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

static PyObject *__pyx_pf_6minipg_6minipg_3UTC_4dst(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dt) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("dst", 0);

  /* "minipg/minipg.py":150
 * 
 *     def dst(self, dt):
 *         return datetime.timedelta(0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __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(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __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;

  /* "minipg/minipg.py":149
 *         return "UTC"
 * 
 *     def dst(self, dt):             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(0)
 * 
 */

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

/* "minipg/minipg.py":154
 * 
 * def _decode_column(data, oid, encoding, tzinfo):
 *     def _get_timezone_offset(data):             # <<<<<<<<<<<<<<
 *         n = data.rfind('+')
 *         if n == -1:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_14_decode_column_1_get_timezone_offset(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_14_decode_column_1_get_timezone_offset = {"_get_timezone_offset", (PyCFunction)__pyx_pw_6minipg_6minipg_14_decode_column_1_get_timezone_offset, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_14_decode_column_1_get_timezone_offset(PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_timezone_offset (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_14_decode_column__get_timezone_offset(__pyx_self, ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_6minipg_6minipg_14_decode_column__get_timezone_offset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_get_timezone_offset", 0);

  /* "minipg/minipg.py":155
 * def _decode_column(data, oid, encoding, tzinfo):
 *     def _get_timezone_offset(data):
 *         n = data.rfind('+')             # <<<<<<<<<<<<<<
 *         if n == -1:
 *             n = data.rfind('-')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_rfind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_n = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "minipg/minipg.py":156
 *     def _get_timezone_offset(data):
 *         n = data.rfind('+')
 *         if n == -1:             # <<<<<<<<<<<<<<
 *             n = data.rfind('-')
 *             s = data[:n]
 */
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "minipg/minipg.py":157
 *         n = data.rfind('+')
 *         if n == -1:
 *             n = data.rfind('-')             # <<<<<<<<<<<<<<
 *             s = data[:n]
 *             offset = int(data[n:]) * 3600 * -1
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_rfind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":158
 *         if n == -1:
 *             n = data.rfind('-')
 *             s = data[:n]             # <<<<<<<<<<<<<<
 *             offset = int(data[n:]) * 3600 * -1
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_s = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":159
 *             n = data.rfind('-')
 *             s = data[:n]
 *             offset = int(data[n:]) * 3600 * -1             # <<<<<<<<<<<<<<
 *         else:
 *             s = data[:n]
 */
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 0, &__pyx_v_n, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_int_3600); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_neg_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_offset = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "minipg/minipg.py":156
 *     def _get_timezone_offset(data):
 *         n = data.rfind('+')
 *         if n == -1:             # <<<<<<<<<<<<<<
 *             n = data.rfind('-')
 *             s = data[:n]
 */
    goto __pyx_L3;
  }

  /* "minipg/minipg.py":161
 *             offset = int(data[n:]) * 3600 * -1
 *         else:
 *             s = data[:n]             # <<<<<<<<<<<<<<
 *             offset = int(data[n:]) * 3600
 *         return s, datetime.timedelta(seconds=offset)
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 0, NULL, &__pyx_v_n, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_s = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "minipg/minipg.py":162
 *         else:
 *             s = data[:n]
 *             offset = int(data[n:]) * 3600             # <<<<<<<<<<<<<<
 *         return s, datetime.timedelta(seconds=offset)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 0, &__pyx_v_n, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_int_3600); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_offset = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "minipg/minipg.py":163
 *             s = data[:n]
 *             offset = int(data[n:]) * 3600
 *         return s, datetime.timedelta(seconds=offset)             # <<<<<<<<<<<<<<
 * 
 *     def _parse_point(data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seconds, __pyx_v_offset) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":154
 * 
 * def _decode_column(data, oid, encoding, tzinfo):
 *     def _get_timezone_offset(data):             # <<<<<<<<<<<<<<
 *         n = data.rfind('+')
 *         if n == -1:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("minipg.minipg._decode_column._get_timezone_offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":165
 *         return s, datetime.timedelta(seconds=offset)
 * 
 *     def _parse_point(data):             # <<<<<<<<<<<<<<
 *         x, y = data[1:-1].split(',')
 *         return (float(x), float(y))
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_14_decode_column_3_parse_point(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_14_decode_column_3_parse_point = {"_parse_point", (PyCFunction)__pyx_pw_6minipg_6minipg_14_decode_column_3_parse_point, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_14_decode_column_3_parse_point(PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_parse_point (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_14_decode_column_2_parse_point(__pyx_self, ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_6minipg_6minipg_14_decode_column_2_parse_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = 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)(PyObject *);
  __Pyx_RefNannySetupContext("_parse_point", 0);

  /* "minipg/minipg.py":166
 * 
 *     def _parse_point(data):
 *         x, y = data[1:-1].split(',')             # <<<<<<<<<<<<<<
 *         return (float(x), float(y))
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 1, -1L, NULL, NULL, &__pyx_slice__8, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __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;
    #if !CYTHON_COMPILING_IN_PYPY
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 166, __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_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_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(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 166, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "minipg/minipg.py":167
 *     def _parse_point(data):
 *         x, y = data[1:-1].split(',')
 *         return (float(x), float(y))             # <<<<<<<<<<<<<<
 * 
 *     if data is None:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":165
 *         return s, datetime.timedelta(seconds=offset)
 * 
 *     def _parse_point(data):             # <<<<<<<<<<<<<<
 *         x, y = data[1:-1].split(',')
 *         return (float(x), float(y))
 */

  /* 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("minipg.minipg._decode_column._parse_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":153
 * 
 * 
 * def _decode_column(data, oid, encoding, tzinfo):             # <<<<<<<<<<<<<<
 *     def _get_timezone_offset(data):
 *         n = data.rfind('+')
 */

static PyObject *__pyx_f_6minipg_6minipg__decode_column(PyObject *__pyx_v_data, int __pyx_v_oid, PyObject *__pyx_v_encoding, PyObject *__pyx_v_tzinfo) {
  PyObject *_get_timezone_offset = 0;
  PyObject *_parse_point = 0;
  PyObject *__pyx_v_dt = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_v_days = NULL;
  PyObject *__pyx_v_hours = NULL;
  PyObject *__pyx_v_minites = NULL;
  PyObject *__pyx_v_seconds = NULL;
  PyObject *__pyx_v_microseconds = NULL;
  PyObject *__pyx_v_hex_str = NULL;
  PyObject *__pyx_v_ia = NULL;
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_v_f = 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;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *(*__pyx_t_14)(PyObject *);
  __Pyx_RefNannySetupContext("_decode_column", 0);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_INCREF(__pyx_v_tzinfo);

  /* "minipg/minipg.py":154
 * 
 * def _decode_column(data, oid, encoding, tzinfo):
 *     def _get_timezone_offset(data):             # <<<<<<<<<<<<<<
 *         n = data.rfind('+')
 *         if n == -1:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_14_decode_column_1_get_timezone_offset, 0, __pyx_n_s_decode_column_locals__get_timez, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  _get_timezone_offset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":165
 *         return s, datetime.timedelta(seconds=offset)
 * 
 *     def _parse_point(data):             # <<<<<<<<<<<<<<
 *         x, y = data[1:-1].split(',')
 *         return (float(x), float(y))
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_14_decode_column_3_parse_point, 0, __pyx_n_s_decode_column_locals__parse_poi, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  _parse_point = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":169
 *         return (float(x), float(y))
 * 
 *     if data is None:             # <<<<<<<<<<<<<<
 *         return data
 *     data = data.decode(encoding)
 */
  __pyx_t_2 = (__pyx_v_data == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":170
 * 
 *     if data is None:
 *         return data             # <<<<<<<<<<<<<<
 *     data = data.decode(encoding)
 *     if oid in (PG_TYPE_BOOL,):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_data);
    __pyx_r = __pyx_v_data;
    goto __pyx_L0;

    /* "minipg/minipg.py":169
 *         return (float(x), float(y))
 * 
 *     if data is None:             # <<<<<<<<<<<<<<
 *         return data
 *     data = data.decode(encoding)
 */
  }

  /* "minipg/minipg.py":171
 *     if data is None:
 *         return data
 *     data = data.decode(encoding)             # <<<<<<<<<<<<<<
 *     if oid in (PG_TYPE_BOOL,):
 *         return data == 't'
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_encoding};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_encoding};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_encoding);
      __Pyx_GIVEREF(__pyx_v_encoding);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_encoding);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":172
 *         return data
 *     data = data.decode(encoding)
 *     if oid in (PG_TYPE_BOOL,):             # <<<<<<<<<<<<<<
 *         return data == 't'
 *     elif oid in (PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_INT8, PG_TYPE_OID,):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_BOOL) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":173
 *     data = data.decode(encoding)
 *     if oid in (PG_TYPE_BOOL,):
 *         return data == 't'             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_INT8, PG_TYPE_OID,):
 *         return int(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_data, __pyx_n_s_t, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":172
 *         return data
 *     data = data.decode(encoding)
 *     if oid in (PG_TYPE_BOOL,):             # <<<<<<<<<<<<<<
 *         return data == 't'
 *     elif oid in (PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_INT8, PG_TYPE_OID,):
 */
  }

  /* "minipg/minipg.py":174
 *     if oid in (PG_TYPE_BOOL,):
 *         return data == 't'
 *     elif oid in (PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_INT8, PG_TYPE_OID,):             # <<<<<<<<<<<<<<
 *         return int(data)
 *     elif oid in (PG_TYPE_FLOAT4, PG_TYPE_FLOAT8):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_INT2) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_INT4) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_INT8) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_OID) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":175
 *         return data == 't'
 *     elif oid in (PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_INT8, PG_TYPE_OID,):
 *         return int(data)             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_FLOAT4, PG_TYPE_FLOAT8):
 *         return float(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":174
 *     if oid in (PG_TYPE_BOOL,):
 *         return data == 't'
 *     elif oid in (PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_INT8, PG_TYPE_OID,):             # <<<<<<<<<<<<<<
 *         return int(data)
 *     elif oid in (PG_TYPE_FLOAT4, PG_TYPE_FLOAT8):
 */
  }

  /* "minipg/minipg.py":176
 *     elif oid in (PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_INT8, PG_TYPE_OID,):
 *         return int(data)
 *     elif oid in (PG_TYPE_FLOAT4, PG_TYPE_FLOAT8):             # <<<<<<<<<<<<<<
 *         return float(data)
 *     elif oid in (PG_TYPE_NUMERIC, ):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT4) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT8) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L9_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":177
 *         return int(data)
 *     elif oid in (PG_TYPE_FLOAT4, PG_TYPE_FLOAT8):
 *         return float(data)             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_NUMERIC, ):
 *         return decimal.Decimal(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":176
 *     elif oid in (PG_TYPE_INT2, PG_TYPE_INT4, PG_TYPE_INT8, PG_TYPE_OID,):
 *         return int(data)
 *     elif oid in (PG_TYPE_FLOAT4, PG_TYPE_FLOAT8):             # <<<<<<<<<<<<<<
 *         return float(data)
 *     elif oid in (PG_TYPE_NUMERIC, ):
 */
  }

  /* "minipg/minipg.py":178
 *     elif oid in (PG_TYPE_FLOAT4, PG_TYPE_FLOAT8):
 *         return float(data)
 *     elif oid in (PG_TYPE_NUMERIC, ):             # <<<<<<<<<<<<<<
 *         return decimal.Decimal(data)
 *     elif oid in (PG_TYPE_DATE, ):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_NUMERIC) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":179
 *         return float(data)
 *     elif oid in (PG_TYPE_NUMERIC, ):
 *         return decimal.Decimal(data)             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_DATE, ):
 *         dt = datetime.datetime.strptime(data, '%Y-%m-%d')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_data};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_data};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":178
 *     elif oid in (PG_TYPE_FLOAT4, PG_TYPE_FLOAT8):
 *         return float(data)
 *     elif oid in (PG_TYPE_NUMERIC, ):             # <<<<<<<<<<<<<<
 *         return decimal.Decimal(data)
 *     elif oid in (PG_TYPE_DATE, ):
 */
  }

  /* "minipg/minipg.py":180
 *     elif oid in (PG_TYPE_NUMERIC, ):
 *         return decimal.Decimal(data)
 *     elif oid in (PG_TYPE_DATE, ):             # <<<<<<<<<<<<<<
 *         dt = datetime.datetime.strptime(data, '%Y-%m-%d')
 *         return datetime.date(dt.year, dt.month, dt.day)
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_DATE) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":181
 *         return decimal.Decimal(data)
 *     elif oid in (PG_TYPE_DATE, ):
 *         dt = datetime.datetime.strptime(data, '%Y-%m-%d')             # <<<<<<<<<<<<<<
 *         return datetime.date(dt.year, dt.month, dt.day)
 *     elif oid in (PG_TYPE_TIME, ):
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strptime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_data, __pyx_kp_s_Y_m_d};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_data, __pyx_kp_s_Y_m_d};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_data);
      __Pyx_INCREF(__pyx_kp_s_Y_m_d);
      __Pyx_GIVEREF(__pyx_kp_s_Y_m_d);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_kp_s_Y_m_d);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_dt = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":182
 *     elif oid in (PG_TYPE_DATE, ):
 *         dt = datetime.datetime.strptime(data, '%Y-%m-%d')
 *         return datetime.date(dt.year, dt.month, dt.day)             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_TIME, ):
 *         if len(data) == 8:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_year); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_month); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_day); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_5, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_t_6, __pyx_t_5, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    } else
    #endif
    {
      __pyx_t_10 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_7, __pyx_t_8);
      __pyx_t_6 = 0;
      __pyx_t_5 = 0;
      __pyx_t_8 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":180
 *     elif oid in (PG_TYPE_NUMERIC, ):
 *         return decimal.Decimal(data)
 *     elif oid in (PG_TYPE_DATE, ):             # <<<<<<<<<<<<<<
 *         dt = datetime.datetime.strptime(data, '%Y-%m-%d')
 *         return datetime.date(dt.year, dt.month, dt.day)
 */
  }

  /* "minipg/minipg.py":183
 *         dt = datetime.datetime.strptime(data, '%Y-%m-%d')
 *         return datetime.date(dt.year, dt.month, dt.day)
 *     elif oid in (PG_TYPE_TIME, ):             # <<<<<<<<<<<<<<
 *         if len(data) == 8:
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S')
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_TIME) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":184
 *         return datetime.date(dt.year, dt.month, dt.day)
 *     elif oid in (PG_TYPE_TIME, ):
 *         if len(data) == 8:             # <<<<<<<<<<<<<<
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S')
 *         else:
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 184, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_t_11 == 8) != 0);
    if (__pyx_t_3) {

      /* "minipg/minipg.py":185
 *     elif oid in (PG_TYPE_TIME, ):
 *         if len(data) == 8:
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S')             # <<<<<<<<<<<<<<
 *         else:
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S.%f')
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strptime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_data, __pyx_kp_s_H_M_S};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_data, __pyx_kp_s_H_M_S};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_data);
        __Pyx_INCREF(__pyx_kp_s_H_M_S);
        __Pyx_GIVEREF(__pyx_kp_s_H_M_S);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_kp_s_H_M_S);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_dt = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "minipg/minipg.py":184
 *         return datetime.date(dt.year, dt.month, dt.day)
 *     elif oid in (PG_TYPE_TIME, ):
 *         if len(data) == 8:             # <<<<<<<<<<<<<<
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S')
 *         else:
 */
      goto __pyx_L11;
    }

    /* "minipg/minipg.py":187
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S')
 *         else:
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S.%f')             # <<<<<<<<<<<<<<
 *         dt = datetime.time(dt.hour, dt.minute, dt.second, dt.microsecond)
 *         if tzinfo:
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_strptime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_data, __pyx_kp_s_H_M_S_f};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_data, __pyx_kp_s_H_M_S_f};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_8) {
          __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
        }
        __Pyx_INCREF(__pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_v_data);
        __Pyx_INCREF(__pyx_kp_s_H_M_S_f);
        __Pyx_GIVEREF(__pyx_kp_s_H_M_S_f);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_kp_s_H_M_S_f);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_dt = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_L11:;

    /* "minipg/minipg.py":188
 *         else:
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S.%f')
 *         dt = datetime.time(dt.hour, dt.minute, dt.second, dt.microsecond)             # <<<<<<<<<<<<<<
 *         if tzinfo:
 *             dt = dt.replace(tzinfo=tzinfo)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_minute); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_second); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_microsecond); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_4, __pyx_t_8, __pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
      PyObject *__pyx_temp[5] = {__pyx_t_9, __pyx_t_4, __pyx_t_8, __pyx_t_5, __pyx_t_6};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 4+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_12 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_9) {
        __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_7, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_7, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_7, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_7, __pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_8 = 0;
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":189
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S.%f')
 *         dt = datetime.time(dt.hour, dt.minute, dt.second, dt.microsecond)
 *         if tzinfo:             # <<<<<<<<<<<<<<
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_tzinfo); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "minipg/minipg.py":190
 *         dt = datetime.time(dt.hour, dt.minute, dt.second, dt.microsecond)
 *         if tzinfo:
 *             dt = dt.replace(tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 *         return dt
 *     elif oid in (PG_TYPE_TIMESTAMP, ):
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "minipg/minipg.py":189
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S.%f')
 *         dt = datetime.time(dt.hour, dt.minute, dt.second, dt.microsecond)
 *         if tzinfo:             # <<<<<<<<<<<<<<
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 */
    }

    /* "minipg/minipg.py":191
 *         if tzinfo:
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_TIMESTAMP, ):
 *         if len(data) == 19:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "minipg/minipg.py":183
 *         dt = datetime.datetime.strptime(data, '%Y-%m-%d')
 *         return datetime.date(dt.year, dt.month, dt.day)
 *     elif oid in (PG_TYPE_TIME, ):             # <<<<<<<<<<<<<<
 *         if len(data) == 8:
 *             dt = datetime.datetime.strptime(data, '%H:%M:%S')
 */
  }

  /* "minipg/minipg.py":192
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 *     elif oid in (PG_TYPE_TIMESTAMP, ):             # <<<<<<<<<<<<<<
 *         if len(data) == 19:
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S')
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_TIMESTAMP) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":193
 *         return dt
 *     elif oid in (PG_TYPE_TIMESTAMP, ):
 *         if len(data) == 19:             # <<<<<<<<<<<<<<
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S')
 *         else:
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 193, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_t_11 == 19) != 0);
    if (__pyx_t_3) {

      /* "minipg/minipg.py":194
 *     elif oid in (PG_TYPE_TIMESTAMP, ):
 *         if len(data) == 19:
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S')             # <<<<<<<<<<<<<<
 *         else:
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S.%f')
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strptime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 194, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_kp_s_Y_m_d_H_M_S};
        __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 194, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_data, __pyx_kp_s_Y_m_d_H_M_S};
        __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 194, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_data);
        __Pyx_INCREF(__pyx_kp_s_Y_m_d_H_M_S);
        __Pyx_GIVEREF(__pyx_kp_s_Y_m_d_H_M_S);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_kp_s_Y_m_d_H_M_S);
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 194, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_dt = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "minipg/minipg.py":193
 *         return dt
 *     elif oid in (PG_TYPE_TIMESTAMP, ):
 *         if len(data) == 19:             # <<<<<<<<<<<<<<
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S')
 *         else:
 */
      goto __pyx_L13;
    }

    /* "minipg/minipg.py":196
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S')
 *         else:
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S.%f')             # <<<<<<<<<<<<<<
 *         if tzinfo:
 *             dt = dt.replace(tzinfo=tzinfo)
 */
    /*else*/ {
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strptime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_data, __pyx_kp_s_Y_m_d_H_M_S_f};
        __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 196, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_data, __pyx_kp_s_Y_m_d_H_M_S_f};
        __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 196, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_12);
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_data);
        __Pyx_INCREF(__pyx_kp_s_Y_m_d_H_M_S_f);
        __Pyx_GIVEREF(__pyx_kp_s_Y_m_d_H_M_S_f);
        PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_kp_s_Y_m_d_H_M_S_f);
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 196, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_v_dt = __pyx_t_12;
      __pyx_t_12 = 0;
    }
    __pyx_L13:;

    /* "minipg/minipg.py":197
 *         else:
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S.%f')
 *         if tzinfo:             # <<<<<<<<<<<<<<
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_tzinfo); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "minipg/minipg.py":198
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S.%f')
 *         if tzinfo:
 *             dt = dt.replace(tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 *         return dt
 *     elif oid in (PG_TYPE_TIMETZ, ):
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "minipg/minipg.py":197
 *         else:
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S.%f')
 *         if tzinfo:             # <<<<<<<<<<<<<<
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 */
    }

    /* "minipg/minipg.py":199
 *         if tzinfo:
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_TIMETZ, ):
 *         s, offset = _get_timezone_offset(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "minipg/minipg.py":192
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 *     elif oid in (PG_TYPE_TIMESTAMP, ):             # <<<<<<<<<<<<<<
 *         if len(data) == 19:
 *             dt = datetime.datetime.strptime(data, '%Y-%m-%d %H:%M:%S')
 */
  }

  /* "minipg/minipg.py":200
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 *     elif oid in (PG_TYPE_TIMETZ, ):             # <<<<<<<<<<<<<<
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_TIMETZ) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":201
 *         return dt
 *     elif oid in (PG_TYPE_TIMETZ, ):
 *         s, offset = _get_timezone_offset(data)             # <<<<<<<<<<<<<<
 *         if tzinfo is None:
 *             tzinfo = UTC()
 */
    __pyx_t_1 = __pyx_pf_6minipg_6minipg_14_decode_column__get_timezone_offset(_get_timezone_offset, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 201, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_12);
      #else
      __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_10);
      index = 1; __pyx_t_12 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_12)) goto __pyx_L15_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_12);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L16_unpacking_done;
      __pyx_L15_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 201, __pyx_L1_error)
      __pyx_L16_unpacking_done:;
    }
    __pyx_v_s = __pyx_t_10;
    __pyx_t_10 = 0;
    __pyx_v_offset = __pyx_t_12;
    __pyx_t_12 = 0;

    /* "minipg/minipg.py":202
 *     elif oid in (PG_TYPE_TIMETZ, ):
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:             # <<<<<<<<<<<<<<
 *             tzinfo = UTC()
 *         if len(s) == 8:
 */
    __pyx_t_3 = (__pyx_v_tzinfo == Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "minipg/minipg.py":203
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:
 *             tzinfo = UTC()             # <<<<<<<<<<<<<<
 *         if len(s) == 8:
 *             t = datetime.datetime.strptime(s, '%H:%M:%S')
 */
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_UTC); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
        }
      }
      if (__pyx_t_10) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF_SET(__pyx_v_tzinfo, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "minipg/minipg.py":202
 *     elif oid in (PG_TYPE_TIMETZ, ):
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:             # <<<<<<<<<<<<<<
 *             tzinfo = UTC()
 *         if len(s) == 8:
 */
    }

    /* "minipg/minipg.py":204
 *         if tzinfo is None:
 *             tzinfo = UTC()
 *         if len(s) == 8:             # <<<<<<<<<<<<<<
 *             t = datetime.datetime.strptime(s, '%H:%M:%S')
 *         else:
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 204, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_11 == 8) != 0);
    if (__pyx_t_2) {

      /* "minipg/minipg.py":205
 *             tzinfo = UTC()
 *         if len(s) == 8:
 *             t = datetime.datetime.strptime(s, '%H:%M:%S')             # <<<<<<<<<<<<<<
 *         else:
 *             t = datetime.datetime.strptime(s, '%H:%M:%S.%f')
 */
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_datetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strptime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 205, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_s, __pyx_kp_s_H_M_S};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_s, __pyx_kp_s_H_M_S};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_v_s);
        __Pyx_GIVEREF(__pyx_v_s);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_s);
        __Pyx_INCREF(__pyx_kp_s_H_M_S);
        __Pyx_GIVEREF(__pyx_kp_s_H_M_S);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_kp_s_H_M_S);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_t = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "minipg/minipg.py":204
 *         if tzinfo is None:
 *             tzinfo = UTC()
 *         if len(s) == 8:             # <<<<<<<<<<<<<<
 *             t = datetime.datetime.strptime(s, '%H:%M:%S')
 *         else:
 */
      goto __pyx_L18;
    }

    /* "minipg/minipg.py":207
 *             t = datetime.datetime.strptime(s, '%H:%M:%S')
 *         else:
 *             t = datetime.datetime.strptime(s, '%H:%M:%S.%f')             # <<<<<<<<<<<<<<
 *         t += tzinfo.utcoffset(t) - offset
 *         t = t.replace(tzinfo=tzinfo)
 */
    /*else*/ {
      __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strptime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_s, __pyx_kp_s_H_M_S_f};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_s, __pyx_kp_s_H_M_S_f};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_6) {
          __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
        }
        __Pyx_INCREF(__pyx_v_s);
        __Pyx_GIVEREF(__pyx_v_s);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_v_s);
        __Pyx_INCREF(__pyx_kp_s_H_M_S_f);
        __Pyx_GIVEREF(__pyx_kp_s_H_M_S_f);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_kp_s_H_M_S_f);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_t = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    __pyx_L18:;

    /* "minipg/minipg.py":208
 *         else:
 *             t = datetime.datetime.strptime(s, '%H:%M:%S.%f')
 *         t += tzinfo.utcoffset(t) - offset             # <<<<<<<<<<<<<<
 *         t = t.replace(tzinfo=tzinfo)
 *         return t
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_t};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_t};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __pyx_t_10 = NULL;
        __Pyx_INCREF(__pyx_v_t);
        __Pyx_GIVEREF(__pyx_v_t);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_t);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Subtract(__pyx_t_1, __pyx_v_offset); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_t, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":209
 *             t = datetime.datetime.strptime(s, '%H:%M:%S.%f')
 *         t += tzinfo.utcoffset(t) - offset
 *         t = t.replace(tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 *         return t
 *     elif oid in (PG_TYPE_TIMESTAMPTZ, ):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_t, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "minipg/minipg.py":210
 *         t += tzinfo.utcoffset(t) - offset
 *         t = t.replace(tzinfo=tzinfo)
 *         return t             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_TIMESTAMPTZ, ):
 *         s, offset = _get_timezone_offset(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_t);
    __pyx_r = __pyx_v_t;
    goto __pyx_L0;

    /* "minipg/minipg.py":200
 *             dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 *     elif oid in (PG_TYPE_TIMETZ, ):             # <<<<<<<<<<<<<<
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:
 */
  }

  /* "minipg/minipg.py":211
 *         t = t.replace(tzinfo=tzinfo)
 *         return t
 *     elif oid in (PG_TYPE_TIMESTAMPTZ, ):             # <<<<<<<<<<<<<<
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_2 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_TIMESTAMPTZ) != 0) != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":212
 *         return t
 *     elif oid in (PG_TYPE_TIMESTAMPTZ, ):
 *         s, offset = _get_timezone_offset(data)             # <<<<<<<<<<<<<<
 *         if tzinfo is None:
 *             tzinfo = UTC()
 */
    __pyx_t_6 = __pyx_pf_6minipg_6minipg_14_decode_column__get_timezone_offset(_get_timezone_offset, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
      PyObject* sequence = __pyx_t_6;
      #if !CYTHON_COMPILING_IN_PYPY
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 212, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_12 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_12)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_12);
      index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L19_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 2) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L20_unpacking_done;
      __pyx_L19_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 212, __pyx_L1_error)
      __pyx_L20_unpacking_done:;
    }
    __pyx_v_s = __pyx_t_12;
    __pyx_t_12 = 0;
    __pyx_v_offset = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":213
 *     elif oid in (PG_TYPE_TIMESTAMPTZ, ):
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:             # <<<<<<<<<<<<<<
 *             tzinfo = UTC()
 *         if len(s) == 19:
 */
    __pyx_t_2 = (__pyx_v_tzinfo == Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "minipg/minipg.py":214
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:
 *             tzinfo = UTC()             # <<<<<<<<<<<<<<
 *         if len(s) == 19:
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S')
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_UTC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_12) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF_SET(__pyx_v_tzinfo, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "minipg/minipg.py":213
 *     elif oid in (PG_TYPE_TIMESTAMPTZ, ):
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:             # <<<<<<<<<<<<<<
 *             tzinfo = UTC()
 *         if len(s) == 19:
 */
    }

    /* "minipg/minipg.py":215
 *         if tzinfo is None:
 *             tzinfo = UTC()
 *         if len(s) == 19:             # <<<<<<<<<<<<<<
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S')
 *         else:
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_s); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 215, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_t_11 == 19) != 0);
    if (__pyx_t_3) {

      /* "minipg/minipg.py":216
 *             tzinfo = UTC()
 *         if len(s) == 19:
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S')             # <<<<<<<<<<<<<<
 *         else:
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S.%f')
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_strptime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_s, __pyx_kp_s_Y_m_d_H_M_S};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_s, __pyx_kp_s_Y_m_d_H_M_S};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (__pyx_t_12) {
          __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); __pyx_t_12 = NULL;
        }
        __Pyx_INCREF(__pyx_v_s);
        __Pyx_GIVEREF(__pyx_v_s);
        PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_v_s);
        __Pyx_INCREF(__pyx_kp_s_Y_m_d_H_M_S);
        __Pyx_GIVEREF(__pyx_kp_s_Y_m_d_H_M_S);
        PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_kp_s_Y_m_d_H_M_S);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_dt = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "minipg/minipg.py":215
 *         if tzinfo is None:
 *             tzinfo = UTC()
 *         if len(s) == 19:             # <<<<<<<<<<<<<<
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S')
 *         else:
 */
      goto __pyx_L22;
    }

    /* "minipg/minipg.py":218
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S')
 *         else:
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S.%f')             # <<<<<<<<<<<<<<
 *         dt += tzinfo.utcoffset(dt) - offset
 *         dt = dt.replace(tzinfo=tzinfo)
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strptime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && 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_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_s, __pyx_kp_s_Y_m_d_H_M_S_f};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_s, __pyx_kp_s_Y_m_d_H_M_S_f};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_12 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 218, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_10) {
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
        }
        __Pyx_INCREF(__pyx_v_s);
        __Pyx_GIVEREF(__pyx_v_s);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_7, __pyx_v_s);
        __Pyx_INCREF(__pyx_kp_s_Y_m_d_H_M_S_f);
        __Pyx_GIVEREF(__pyx_kp_s_Y_m_d_H_M_S_f);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_7, __pyx_kp_s_Y_m_d_H_M_S_f);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_dt = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    __pyx_L22:;

    /* "minipg/minipg.py":219
 *         else:
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S.%f')
 *         dt += tzinfo.utcoffset(dt) - offset             # <<<<<<<<<<<<<<
 *         dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tzinfo, __pyx_n_s_utcoffset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_dt};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_v_dt};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GOTREF(__pyx_t_6);
      } else
      #endif
      {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); __pyx_t_12 = NULL;
        __Pyx_INCREF(__pyx_v_dt);
        __Pyx_GIVEREF(__pyx_v_dt);
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_dt);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_v_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_dt, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "minipg/minipg.py":220
 *             dt = datetime.datetime.strptime(s, '%Y-%m-%d %H:%M:%S.%f')
 *         dt += tzinfo.utcoffset(dt) - offset
 *         dt = dt.replace(tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 *         return dt
 *     elif oid in (PG_TYPE_INTERVAL, ):
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dt, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_dt, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "minipg/minipg.py":221
 *         dt += tzinfo.utcoffset(dt) - offset
 *         dt = dt.replace(tzinfo=tzinfo)
 *         return dt             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_INTERVAL, ):
 *         if data == '1 day':
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_dt);
    __pyx_r = __pyx_v_dt;
    goto __pyx_L0;

    /* "minipg/minipg.py":211
 *         t = t.replace(tzinfo=tzinfo)
 *         return t
 *     elif oid in (PG_TYPE_TIMESTAMPTZ, ):             # <<<<<<<<<<<<<<
 *         s, offset = _get_timezone_offset(data)
 *         if tzinfo is None:
 */
  }

  /* "minipg/minipg.py":222
 *         dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 *     elif oid in (PG_TYPE_INTERVAL, ):             # <<<<<<<<<<<<<<
 *         if data == '1 day':
 *             return datetime.timedelta(days=1)
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_INTERVAL) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":223
 *         return dt
 *     elif oid in (PG_TYPE_INTERVAL, ):
 *         if data == '1 day':             # <<<<<<<<<<<<<<
 *             return datetime.timedelta(days=1)
 *         dt = data.split('days')
 */
    __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_data, __pyx_kp_s_1_day, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 223, __pyx_L1_error)
    if (__pyx_t_3) {

      /* "minipg/minipg.py":224
 *     elif oid in (PG_TYPE_INTERVAL, ):
 *         if data == '1 day':
 *             return datetime.timedelta(days=1)             # <<<<<<<<<<<<<<
 *         dt = data.split('days')
 *         if len(dt) < 2:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_days, __pyx_int_1) < 0) __PYX_ERR(0, 224, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "minipg/minipg.py":223
 *         return dt
 *     elif oid in (PG_TYPE_INTERVAL, ):
 *         if data == '1 day':             # <<<<<<<<<<<<<<
 *             return datetime.timedelta(days=1)
 *         dt = data.split('days')
 */
    }

    /* "minipg/minipg.py":225
 *         if data == '1 day':
 *             return datetime.timedelta(days=1)
 *         dt = data.split('days')             # <<<<<<<<<<<<<<
 *         if len(dt) < 2:
 *             days = 0
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 225, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_dt = __pyx_t_10;
    __pyx_t_10 = 0;

    /* "minipg/minipg.py":226
 *             return datetime.timedelta(days=1)
 *         dt = data.split('days')
 *         if len(dt) < 2:             # <<<<<<<<<<<<<<
 *             days = 0
 *             hours, minites, seconds = dt[0].split(':')
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_dt); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 226, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_t_11 < 2) != 0);
    if (__pyx_t_3) {

      /* "minipg/minipg.py":227
 *         dt = data.split('days')
 *         if len(dt) < 2:
 *             days = 0             # <<<<<<<<<<<<<<
 *             hours, minites, seconds = dt[0].split(':')
 *             if seconds.find('.') != -1:
 */
      __Pyx_INCREF(__pyx_int_0);
      __pyx_v_days = __pyx_int_0;

      /* "minipg/minipg.py":228
 *         if len(dt) < 2:
 *             days = 0
 *             hours, minites, seconds = dt[0].split(':')             # <<<<<<<<<<<<<<
 *             if seconds.find('.') != -1:
 *                 seconds, microseconds = seconds.split('.')
 */
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_dt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
        PyObject* sequence = __pyx_t_10;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 228, __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_1 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 228, __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_5 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
        index = 0; __pyx_t_6 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L25_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L25_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 2; __pyx_t_12 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_12)) goto __pyx_L25_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 3) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L26_unpacking_done;
        __pyx_L25_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 228, __pyx_L1_error)
        __pyx_L26_unpacking_done:;
      }
      __pyx_v_hours = __pyx_t_6;
      __pyx_t_6 = 0;
      __pyx_v_minites = __pyx_t_1;
      __pyx_t_1 = 0;
      __pyx_v_seconds = __pyx_t_12;
      __pyx_t_12 = 0;

      /* "minipg/minipg.py":229
 *             days = 0
 *             hours, minites, seconds = dt[0].split(':')
 *             if seconds.find('.') != -1:             # <<<<<<<<<<<<<<
 *                 seconds, microseconds = seconds.split('.')
 *             else:
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_seconds, __pyx_n_s_find); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_3) {

        /* "minipg/minipg.py":230
 *             hours, minites, seconds = dt[0].split(':')
 *             if seconds.find('.') != -1:
 *                 seconds, microseconds = seconds.split('.')             # <<<<<<<<<<<<<<
 *             else:
 *                 microseconds = 0
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_seconds, __pyx_n_s_split); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 230, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 230, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
          PyObject* sequence = __pyx_t_12;
          #if !CYTHON_COMPILING_IN_PYPY
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 230, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_1);
          #else
          __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 230, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_6 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext;
          index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L28_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L28_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_1);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_6), 2) < 0) __PYX_ERR(0, 230, __pyx_L1_error)
          __pyx_t_13 = NULL;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L29_unpacking_done;
          __pyx_L28_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_13 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 230, __pyx_L1_error)
          __pyx_L29_unpacking_done:;
        }
        __Pyx_DECREF_SET(__pyx_v_seconds, __pyx_t_10);
        __pyx_t_10 = 0;
        __pyx_v_microseconds = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "minipg/minipg.py":229
 *             days = 0
 *             hours, minites, seconds = dt[0].split(':')
 *             if seconds.find('.') != -1:             # <<<<<<<<<<<<<<
 *                 seconds, microseconds = seconds.split('.')
 *             else:
 */
        goto __pyx_L27;
      }

      /* "minipg/minipg.py":232
 *                 seconds, microseconds = seconds.split('.')
 *             else:
 *                 microseconds = 0             # <<<<<<<<<<<<<<
 *         else:
 *             days = int(dt[0])
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_int_0);
        __pyx_v_microseconds = __pyx_int_0;
      }
      __pyx_L27:;

      /* "minipg/minipg.py":226
 *             return datetime.timedelta(days=1)
 *         dt = data.split('days')
 *         if len(dt) < 2:             # <<<<<<<<<<<<<<
 *             days = 0
 *             hours, minites, seconds = dt[0].split(':')
 */
      goto __pyx_L24;
    }

    /* "minipg/minipg.py":234
 *                 microseconds = 0
 *         else:
 *             days = int(dt[0])             # <<<<<<<<<<<<<<
 *             if dt[1]:
 *                 hours, minites, seconds = dt[1].split(':')
 */
    /*else*/ {
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_dt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_days = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "minipg/minipg.py":235
 *         else:
 *             days = int(dt[0])
 *             if dt[1]:             # <<<<<<<<<<<<<<
 *                 hours, minites, seconds = dt[1].split(':')
 *                 if seconds.find('.') != -1:
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __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(0, 235, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_3) {

        /* "minipg/minipg.py":236
 *             days = int(dt[0])
 *             if dt[1]:
 *                 hours, minites, seconds = dt[1].split(':')             # <<<<<<<<<<<<<<
 *                 if seconds.find('.') != -1:
 *                     seconds, microseconds = seconds.split('.')
 */
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_dt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
          PyObject* sequence = __pyx_t_1;
          #if !CYTHON_COMPILING_IN_PYPY
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            __PYX_ERR(0, 236, __pyx_L1_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_6);
          #else
          __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __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_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
          index = 0; __pyx_t_12 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_12)) goto __pyx_L31_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_12);
          index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_10)) goto __pyx_L31_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_10);
          index = 2; __pyx_t_6 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_6)) goto __pyx_L31_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_6);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 3) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
          __pyx_t_13 = NULL;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          goto __pyx_L32_unpacking_done;
          __pyx_L31_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_13 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(0, 236, __pyx_L1_error)
          __pyx_L32_unpacking_done:;
        }
        __pyx_v_hours = __pyx_t_12;
        __pyx_t_12 = 0;
        __pyx_v_minites = __pyx_t_10;
        __pyx_t_10 = 0;
        __pyx_v_seconds = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "minipg/minipg.py":237
 *             if dt[1]:
 *                 hours, minites, seconds = dt[1].split(':')
 *                 if seconds.find('.') != -1:             # <<<<<<<<<<<<<<
 *                     seconds, microseconds = seconds.split('.')
 *                 else:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_seconds, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_3) {

          /* "minipg/minipg.py":238
 *                 hours, minites, seconds = dt[1].split(':')
 *                 if seconds.find('.') != -1:
 *                     seconds, microseconds = seconds.split('.')             # <<<<<<<<<<<<<<
 *                 else:
 *                     microseconds = 0
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_seconds, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
            PyObject* sequence = __pyx_t_6;
            #if !CYTHON_COMPILING_IN_PYPY
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              __PYX_ERR(0, 238, __pyx_L1_error)
            }
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_10);
            #else
            __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 238, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            #endif
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 238, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
            index = 0; __pyx_t_1 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_1)) goto __pyx_L34_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_1);
            index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L34_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_10);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
            __pyx_t_13 = NULL;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            goto __pyx_L35_unpacking_done;
            __pyx_L34_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_13 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            __PYX_ERR(0, 238, __pyx_L1_error)
            __pyx_L35_unpacking_done:;
          }
          __Pyx_DECREF_SET(__pyx_v_seconds, __pyx_t_1);
          __pyx_t_1 = 0;
          __pyx_v_microseconds = __pyx_t_10;
          __pyx_t_10 = 0;

          /* "minipg/minipg.py":237
 *             if dt[1]:
 *                 hours, minites, seconds = dt[1].split(':')
 *                 if seconds.find('.') != -1:             # <<<<<<<<<<<<<<
 *                     seconds, microseconds = seconds.split('.')
 *                 else:
 */
          goto __pyx_L33;
        }

        /* "minipg/minipg.py":240
 *                     seconds, microseconds = seconds.split('.')
 *                 else:
 *                     microseconds = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 hours = minites = seconds = microseconds = 0
 */
        /*else*/ {
          __Pyx_INCREF(__pyx_int_0);
          __pyx_v_microseconds = __pyx_int_0;
        }
        __pyx_L33:;

        /* "minipg/minipg.py":235
 *         else:
 *             days = int(dt[0])
 *             if dt[1]:             # <<<<<<<<<<<<<<
 *                 hours, minites, seconds = dt[1].split(':')
 *                 if seconds.find('.') != -1:
 */
        goto __pyx_L30;
      }

      /* "minipg/minipg.py":242
 *                     microseconds = 0
 *             else:
 *                 hours = minites = seconds = microseconds = 0             # <<<<<<<<<<<<<<
 *         hours = int(hours)
 *         minites = int(minites)
 */
      /*else*/ {
        __Pyx_INCREF(__pyx_int_0);
        __pyx_v_hours = __pyx_int_0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_v_minites = __pyx_int_0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_v_seconds = __pyx_int_0;
        __Pyx_INCREF(__pyx_int_0);
        __pyx_v_microseconds = __pyx_int_0;
      }
      __pyx_L30:;
    }
    __pyx_L24:;

    /* "minipg/minipg.py":243
 *             else:
 *                 hours = minites = seconds = microseconds = 0
 *         hours = int(hours)             # <<<<<<<<<<<<<<
 *         minites = int(minites)
 *         seconds = int(seconds)
 */
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_hours); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_hours, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "minipg/minipg.py":244
 *                 hours = minites = seconds = microseconds = 0
 *         hours = int(hours)
 *         minites = int(minites)             # <<<<<<<<<<<<<<
 *         seconds = int(seconds)
 *         microseconds = int(microseconds)
 */
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_minites); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_minites, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "minipg/minipg.py":245
 *         hours = int(hours)
 *         minites = int(minites)
 *         seconds = int(seconds)             # <<<<<<<<<<<<<<
 *         microseconds = int(microseconds)
 *         return datetime.timedelta(microseconds=microseconds, seconds=seconds, minutes=minites, hours=hours, days=days)
 */
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_seconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_seconds, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "minipg/minipg.py":246
 *         minites = int(minites)
 *         seconds = int(seconds)
 *         microseconds = int(microseconds)             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(microseconds=microseconds, seconds=seconds, minutes=minites, hours=hours, days=days)
 *     elif oid in (PG_TYPE_BYTEA, ):
 */
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_v_microseconds); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_microseconds, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "minipg/minipg.py":247
 *         seconds = int(seconds)
 *         microseconds = int(microseconds)
 *         return datetime.timedelta(microseconds=microseconds, seconds=seconds, minutes=minites, hours=hours, days=days)             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_BYTEA, ):
 *         assert data[:2] == u'\\x'
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_microseconds, __pyx_v_microseconds) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_seconds, __pyx_v_seconds) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_minutes, __pyx_v_minites) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_hours, __pyx_v_hours) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_days, __pyx_v_days) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":222
 *         dt = dt.replace(tzinfo=tzinfo)
 *         return dt
 *     elif oid in (PG_TYPE_INTERVAL, ):             # <<<<<<<<<<<<<<
 *         if data == '1 day':
 *             return datetime.timedelta(days=1)
 */
  }

  /* "minipg/minipg.py":248
 *         microseconds = int(microseconds)
 *         return datetime.timedelta(microseconds=microseconds, seconds=seconds, minutes=minites, hours=hours, days=days)
 *     elif oid in (PG_TYPE_BYTEA, ):             # <<<<<<<<<<<<<<
 *         assert data[:2] == u'\\x'
 *         hex_str = data[2:]
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_BYTEA) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":249
 *         return datetime.timedelta(microseconds=microseconds, seconds=seconds, minutes=minites, hours=hours, days=days)
 *     elif oid in (PG_TYPE_BYTEA, ):
 *         assert data[:2] == u'\\x'             # <<<<<<<<<<<<<<
 *         hex_str = data[2:]
 *         ia = [int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2)]
 */
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, 2, NULL, NULL, &__pyx_slice__24, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_kp_u_x_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(0, 249, __pyx_L1_error)
      }
    }
    #endif

    /* "minipg/minipg.py":250
 *     elif oid in (PG_TYPE_BYTEA, ):
 *         assert data[:2] == u'\\x'
 *         hex_str = data[2:]             # <<<<<<<<<<<<<<
 *         ia = [int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2)]
 *         return b''.join([chr(c) for c in ia]) if PY2 else bytes(ia)
 */
    __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_data, 2, 0, NULL, NULL, &__pyx_slice__25, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_hex_str = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":251
 *         assert data[:2] == u'\\x'
 *         hex_str = data[2:]
 *         ia = [int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2)]             # <<<<<<<<<<<<<<
 *         return b''.join([chr(c) for c in ia]) if PY2 else bytes(ia)
 *     elif oid in (PG_TYPE_CHAR, PG_TYPE_TEXT, PG_TYPE_BPCHAR, PG_TYPE_VARCHAR, PG_TYPE_NAME, PG_TYPE_JSON):
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyObject_Length(__pyx_v_hex_str); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 251, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
    __Pyx_INCREF(__pyx_int_2);
    __Pyx_GIVEREF(__pyx_int_2);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_2);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_10 = __pyx_t_6; __Pyx_INCREF(__pyx_t_10); __pyx_t_11 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_14 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 251, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 251, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_10, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_14(__pyx_t_10);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 251, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_hex_str, 0, 0, &__pyx_v_i, &__pyx_t_6, NULL, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12);
      __Pyx_INCREF(__pyx_int_16);
      __Pyx_GIVEREF(__pyx_int_16);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_16);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyInt_Type)), __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_v_ia = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":252
 *         hex_str = data[2:]
 *         ia = [int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2)]
 *         return b''.join([chr(c) for c in ia]) if PY2 else bytes(ia)             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_CHAR, PG_TYPE_TEXT, PG_TYPE_BPCHAR, PG_TYPE_VARCHAR, PG_TYPE_NAME, PG_TYPE_JSON):
 *         return data
 */
    __Pyx_XDECREF(__pyx_r);
    if ((__pyx_v_6minipg_6minipg_PY2 != 0)) {
      __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = __pyx_v_ia; __Pyx_INCREF(__pyx_t_12); __pyx_t_11 = 0;
      for (;;) {
        if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_12)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_11); __Pyx_INCREF(__pyx_t_6); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_12, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_v_c);
        __Pyx_GIVEREF(__pyx_v_c);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_c);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 252, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyBytes_Join(__pyx_kp_b__26, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_1 = __pyx_t_12;
      __pyx_t_12 = 0;
    } else {
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_v_ia);
      __Pyx_GIVEREF(__pyx_v_ia);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_ia);
      __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_1 = __pyx_t_10;
      __pyx_t_10 = 0;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":248
 *         microseconds = int(microseconds)
 *         return datetime.timedelta(microseconds=microseconds, seconds=seconds, minutes=minites, hours=hours, days=days)
 *     elif oid in (PG_TYPE_BYTEA, ):             # <<<<<<<<<<<<<<
 *         assert data[:2] == u'\\x'
 *         hex_str = data[2:]
 */
  }

  /* "minipg/minipg.py":253
 *         ia = [int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2)]
 *         return b''.join([chr(c) for c in ia]) if PY2 else bytes(ia)
 *     elif oid in (PG_TYPE_CHAR, PG_TYPE_TEXT, PG_TYPE_BPCHAR, PG_TYPE_VARCHAR, PG_TYPE_NAME, PG_TYPE_JSON):             # <<<<<<<<<<<<<<
 *         return data
 *     elif oid in (PG_TYPE_UUID, ):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_CHAR) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L40_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_TEXT) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L40_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_BPCHAR) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L40_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_VARCHAR) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L40_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_NAME) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L40_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_JSON) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L40_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":254
 *         return b''.join([chr(c) for c in ia]) if PY2 else bytes(ia)
 *     elif oid in (PG_TYPE_CHAR, PG_TYPE_TEXT, PG_TYPE_BPCHAR, PG_TYPE_VARCHAR, PG_TYPE_NAME, PG_TYPE_JSON):
 *         return data             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_UUID, ):
 *         return uuid.UUID(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_data);
    __pyx_r = __pyx_v_data;
    goto __pyx_L0;

    /* "minipg/minipg.py":253
 *         ia = [int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2)]
 *         return b''.join([chr(c) for c in ia]) if PY2 else bytes(ia)
 *     elif oid in (PG_TYPE_CHAR, PG_TYPE_TEXT, PG_TYPE_BPCHAR, PG_TYPE_VARCHAR, PG_TYPE_NAME, PG_TYPE_JSON):             # <<<<<<<<<<<<<<
 *         return data
 *     elif oid in (PG_TYPE_UUID, ):
 */
  }

  /* "minipg/minipg.py":255
 *     elif oid in (PG_TYPE_CHAR, PG_TYPE_TEXT, PG_TYPE_BPCHAR, PG_TYPE_VARCHAR, PG_TYPE_NAME, PG_TYPE_JSON):
 *         return data
 *     elif oid in (PG_TYPE_UUID, ):             # <<<<<<<<<<<<<<
 *         return uuid.UUID(data)
 *     elif oid in (PG_TYPE_UNKNOWN, PG_TYPE_PGNODETREE, PG_TYPE_TSVECTOR, PG_TYPE_INET):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_2 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_UUID) != 0) != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":256
 *         return data
 *     elif oid in (PG_TYPE_UUID, ):
 *         return uuid.UUID(data)             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_UNKNOWN, PG_TYPE_PGNODETREE, PG_TYPE_TSVECTOR, PG_TYPE_INET):
 *         if DEBUG:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_uuid); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_UUID); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_10 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_data};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
        PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_data};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __pyx_t_10 = NULL;
        __Pyx_INCREF(__pyx_v_data);
        __Pyx_GIVEREF(__pyx_v_data);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_data);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":255
 *     elif oid in (PG_TYPE_CHAR, PG_TYPE_TEXT, PG_TYPE_BPCHAR, PG_TYPE_VARCHAR, PG_TYPE_NAME, PG_TYPE_JSON):
 *         return data
 *     elif oid in (PG_TYPE_UUID, ):             # <<<<<<<<<<<<<<
 *         return uuid.UUID(data)
 *     elif oid in (PG_TYPE_UNKNOWN, PG_TYPE_PGNODETREE, PG_TYPE_TSVECTOR, PG_TYPE_INET):
 */
  }

  /* "minipg/minipg.py":257
 *     elif oid in (PG_TYPE_UUID, ):
 *         return uuid.UUID(data)
 *     elif oid in (PG_TYPE_UNKNOWN, PG_TYPE_PGNODETREE, PG_TYPE_TSVECTOR, PG_TYPE_INET):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('NO DECODE type:%d' % (oid, ))
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_UNKNOWN) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L46_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_PGNODETREE) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L46_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_TSVECTOR) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L46_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_INET) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L46_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":258
 *         return uuid.UUID(data)
 *     elif oid in (PG_TYPE_UNKNOWN, PG_TYPE_PGNODETREE, PG_TYPE_TSVECTOR, PG_TYPE_INET):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('NO DECODE type:%d' % (oid, ))
 *         return data
 */
    __pyx_t_3 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
    if (__pyx_t_3) {

      /* "minipg/minipg.py":259
 *     elif oid in (PG_TYPE_UNKNOWN, PG_TYPE_PGNODETREE, PG_TYPE_TSVECTOR, PG_TYPE_INET):
 *         if DEBUG:
 *             DEBUG_OUTPUT('NO DECODE type:%d' % (oid, ))             # <<<<<<<<<<<<<<
 *         return data
 *     elif oid in (PG_TYPE_INT2ARRAY, PG_TYPE_INT4ARRAY):
 */
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_NO_DECODE_type_d, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 259, __pyx_L1_error)
      __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(((PyObject*)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "minipg/minipg.py":258
 *         return uuid.UUID(data)
 *     elif oid in (PG_TYPE_UNKNOWN, PG_TYPE_PGNODETREE, PG_TYPE_TSVECTOR, PG_TYPE_INET):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('NO DECODE type:%d' % (oid, ))
 *         return data
 */
    }

    /* "minipg/minipg.py":260
 *         if DEBUG:
 *             DEBUG_OUTPUT('NO DECODE type:%d' % (oid, ))
 *         return data             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_INT2ARRAY, PG_TYPE_INT4ARRAY):
 *         return [int(i) for i in data[1:-1].split(',')]
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_data);
    __pyx_r = __pyx_v_data;
    goto __pyx_L0;

    /* "minipg/minipg.py":257
 *     elif oid in (PG_TYPE_UUID, ):
 *         return uuid.UUID(data)
 *     elif oid in (PG_TYPE_UNKNOWN, PG_TYPE_PGNODETREE, PG_TYPE_TSVECTOR, PG_TYPE_INET):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('NO DECODE type:%d' % (oid, ))
 */
  }

  /* "minipg/minipg.py":261
 *             DEBUG_OUTPUT('NO DECODE type:%d' % (oid, ))
 *         return data
 *     elif oid in (PG_TYPE_INT2ARRAY, PG_TYPE_INT4ARRAY):             # <<<<<<<<<<<<<<
 *         return [int(i) for i in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_INT2ARRAY) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L51_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_INT4ARRAY) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L51_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":262
 *         return data
 *     elif oid in (PG_TYPE_INT2ARRAY, PG_TYPE_INT4ARRAY):
 *         return [int(i) for i in data[1:-1].split(',')]             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):
 *         return [s for s in data[1:-1].split(',')]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_data, 1, -1L, NULL, NULL, &__pyx_slice__27, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
      __pyx_t_5 = __pyx_t_12; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 262, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_12); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
          #else
          __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_12); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
          #else
          __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
        }
      } else {
        __pyx_t_12 = __pyx_t_14(__pyx_t_5);
        if (unlikely(!__pyx_t_12)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 262, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_12);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyNumber_Int(__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 262, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":261
 *             DEBUG_OUTPUT('NO DECODE type:%d' % (oid, ))
 *         return data
 *     elif oid in (PG_TYPE_INT2ARRAY, PG_TYPE_INT4ARRAY):             # <<<<<<<<<<<<<<
 *         return [int(i) for i in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):
 */
  }

  /* "minipg/minipg.py":263
 *     elif oid in (PG_TYPE_INT2ARRAY, PG_TYPE_INT4ARRAY):
 *         return [int(i) for i in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):             # <<<<<<<<<<<<<<
 *         return [s for s in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_NAMEARRAY) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L55_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_TEXTARRAY) != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L55_bool_binop_done:;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":264
 *         return [int(i) for i in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):
 *         return [s for s in data[1:-1].split(',')]             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):
 *         return [float(f) for f in data[1:-1].split(',')]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_data, 1, -1L, NULL, NULL, &__pyx_slice__29, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_12 = __pyx_t_5; __Pyx_INCREF(__pyx_t_12); __pyx_t_11 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_14 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 264, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_12))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_12)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_12, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_12, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_14(__pyx_t_12);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 264, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_5);
      __pyx_t_5 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_s))) __PYX_ERR(0, 264, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":263
 *     elif oid in (PG_TYPE_INT2ARRAY, PG_TYPE_INT4ARRAY):
 *         return [int(i) for i in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):             # <<<<<<<<<<<<<<
 *         return [s for s in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):
 */
  }

  /* "minipg/minipg.py":265
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):
 *         return [s for s in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):             # <<<<<<<<<<<<<<
 *         return [float(f) for f in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_INT2VECTOR, ):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT4ARRAY) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":266
 *         return [s for s in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):
 *         return [float(f) for f in data[1:-1].split(',')]             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_INT2VECTOR, ):
 *         return [int(i) for i in data.split(' ')]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_data, 1, -1L, NULL, NULL, &__pyx_slice__31, 1, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 266, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
      __pyx_t_5 = __pyx_t_12; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 266, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_12); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
          #else
          __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_12); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
          #else
          __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 266, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
        }
      } else {
        __pyx_t_12 = __pyx_t_14(__pyx_t_5);
        if (unlikely(!__pyx_t_12)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 266, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_12);
      }
      __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyNumber_Float(__pyx_v_f); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":265
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):
 *         return [s for s in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):             # <<<<<<<<<<<<<<
 *         return [float(f) for f in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_INT2VECTOR, ):
 */
  }

  /* "minipg/minipg.py":267
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):
 *         return [float(f) for f in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_INT2VECTOR, ):             # <<<<<<<<<<<<<<
 *         return [int(i) for i in data.split(' ')]
 *     elif oid in (PG_TYPE_POINT, ):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_INT2VECTOR) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":268
 *         return [float(f) for f in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_INT2VECTOR, ):
 *         return [int(i) for i in data.split(' ')]             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_POINT, ):
 *         return _parse_point(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
      __pyx_t_5 = __pyx_t_12; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
      __pyx_t_14 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_14 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    for (;;) {
      if (likely(!__pyx_t_14)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_12); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
          #else
          __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_12); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
          #else
          __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
        }
      } else {
        __pyx_t_12 = __pyx_t_14(__pyx_t_5);
        if (unlikely(!__pyx_t_12)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 268, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_12);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyNumber_Int(__pyx_v_i); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":267
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):
 *         return [float(f) for f in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_INT2VECTOR, ):             # <<<<<<<<<<<<<<
 *         return [int(i) for i in data.split(' ')]
 *     elif oid in (PG_TYPE_POINT, ):
 */
  }

  /* "minipg/minipg.py":269
 *     elif oid in (PG_TYPE_INT2VECTOR, ):
 *         return [int(i) for i in data.split(' ')]
 *     elif oid in (PG_TYPE_POINT, ):             # <<<<<<<<<<<<<<
 *         return _parse_point(data)
 *     elif oid in (PG_TYPE_CIRCLE, ):
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_POINT) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":270
 *         return [int(i) for i in data.split(' ')]
 *     elif oid in (PG_TYPE_POINT, ):
 *         return _parse_point(data)             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_CIRCLE, ):
 *         p = data[1:data.find(')')+1]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_pf_6minipg_6minipg_14_decode_column_2_parse_point(_parse_point, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":269
 *     elif oid in (PG_TYPE_INT2VECTOR, ):
 *         return [int(i) for i in data.split(' ')]
 *     elif oid in (PG_TYPE_POINT, ):             # <<<<<<<<<<<<<<
 *         return _parse_point(data)
 *     elif oid in (PG_TYPE_CIRCLE, ):
 */
  }

  /* "minipg/minipg.py":271
 *     elif oid in (PG_TYPE_POINT, ):
 *         return _parse_point(data)
 *     elif oid in (PG_TYPE_CIRCLE, ):             # <<<<<<<<<<<<<<
 *         p = data[1:data.find(')')+1]
 *         r = data[len(p)+2:-1]
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_3 = (((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_CIRCLE) != 0) != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":272
 *         return _parse_point(data)
 *     elif oid in (PG_TYPE_CIRCLE, ):
 *         p = data[1:data.find(')')+1]             # <<<<<<<<<<<<<<
 *         r = data[len(p)+2:-1]
 *         return (_parse_point(p), float(r))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_data, 1, 0, NULL, &__pyx_t_1, NULL, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_p = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "minipg/minipg.py":273
 *     elif oid in (PG_TYPE_CIRCLE, ):
 *         p = data[1:data.find(')')+1]
 *         r = data[len(p)+2:-1]             # <<<<<<<<<<<<<<
 *         return (_parse_point(p), float(r))
 *     elif oid in (PG_TYPE_LSEG, PG_TYPE_PATH, PG_TYPE_BOX, PG_TYPE_POLYGON, PG_TYPE_LINE):
 */
    __pyx_t_11 = PyObject_Length(__pyx_v_p); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 273, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_data, (__pyx_t_11 + 2), -1L, NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_r = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "minipg/minipg.py":274
 *         p = data[1:data.find(')')+1]
 *         r = data[len(p)+2:-1]
 *         return (_parse_point(p), float(r))             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_LSEG, PG_TYPE_PATH, PG_TYPE_BOX, PG_TYPE_POLYGON, PG_TYPE_LINE):
 *         return eval(data)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __pyx_pf_6minipg_6minipg_14_decode_column_2_parse_point(_parse_point, __pyx_v_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyNumber_Float(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1);
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_12;
    __pyx_t_12 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":271
 *     elif oid in (PG_TYPE_POINT, ):
 *         return _parse_point(data)
 *     elif oid in (PG_TYPE_CIRCLE, ):             # <<<<<<<<<<<<<<
 *         p = data[1:data.find(')')+1]
 *         r = data[len(p)+2:-1]
 */
  }

  /* "minipg/minipg.py":275
 *         r = data[len(p)+2:-1]
 *         return (_parse_point(p), float(r))
 *     elif oid in (PG_TYPE_LSEG, PG_TYPE_PATH, PG_TYPE_BOX, PG_TYPE_POLYGON, PG_TYPE_LINE):             # <<<<<<<<<<<<<<
 *         return eval(data)
 *     else:
 */
  __pyx_t_7 = __pyx_v_oid;
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_LSEG) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L63_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_PATH) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L63_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_BOX) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L63_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_POLYGON) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_t_2;
    goto __pyx_L63_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_t_7 == __pyx_v_6minipg_6minipg_PG_TYPE_LINE) != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L63_bool_binop_done:;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":276
 *         return (_parse_point(p), float(r))
 *     elif oid in (PG_TYPE_LSEG, PG_TYPE_PATH, PG_TYPE_BOX, PG_TYPE_POLYGON, PG_TYPE_LINE):
 *         return eval(data)             # <<<<<<<<<<<<<<
 *     else:
 *         if DEBUG:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_12 = __Pyx_Globals(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (_get_timezone_offset) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_get_timezone_offset, _get_timezone_offset) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (_parse_point) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_parse_point, _parse_point) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_c) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_c, __pyx_v_c) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_data) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_data, __pyx_v_data) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_days) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_days, __pyx_v_days) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_dt) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dt, __pyx_v_dt) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_encoding) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_encoding, __pyx_v_encoding) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_f) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_f, __pyx_v_f) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_hex_str) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hex_str, __pyx_v_hex_str) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_hours) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_hours, __pyx_v_hours) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_i) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i, __pyx_v_i) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_ia) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ia, __pyx_v_ia) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_microseconds) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_microseconds, __pyx_v_microseconds) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_minites) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_minites, __pyx_v_minites) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_offset) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_offset, __pyx_v_offset) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_oid); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_5) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_oid, __pyx_t_5) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_v_p) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_p, __pyx_v_p) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_r) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_r, __pyx_v_r) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_s) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_s, __pyx_v_s) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_seconds) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_seconds, __pyx_v_seconds) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_t) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_t, __pyx_v_t) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    if (__pyx_v_tzinfo) {
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_data);
    __Pyx_GIVEREF(__pyx_v_data);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_data);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_1);
    __pyx_t_12 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_eval, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":275
 *         r = data[len(p)+2:-1]
 *         return (_parse_point(p), float(r))
 *     elif oid in (PG_TYPE_LSEG, PG_TYPE_PATH, PG_TYPE_BOX, PG_TYPE_POLYGON, PG_TYPE_LINE):             # <<<<<<<<<<<<<<
 *         return eval(data)
 *     else:
 */
  }

  /* "minipg/minipg.py":278
 *         return eval(data)
 *     else:
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             raise ValueError('Unknown oid=' + str(oid) + ":" + data)
 *     return data
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
    if (__pyx_t_2) {

      /* "minipg/minipg.py":279
 *     else:
 *         if DEBUG:
 *             raise ValueError('Unknown oid=' + str(oid) + ":" + data)             # <<<<<<<<<<<<<<
 *     return data
 * 
 */
      __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_oid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_kp_s_Unknown_oid, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_kp_s__16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __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(0, 279, __pyx_L1_error)

      /* "minipg/minipg.py":278
 *         return eval(data)
 *     else:
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             raise ValueError('Unknown oid=' + str(oid) + ":" + data)
 *     return data
 */
    }
  }

  /* "minipg/minipg.py":280
 *         if DEBUG:
 *             raise ValueError('Unknown oid=' + str(oid) + ":" + data)
 *     return data             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------------
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_data);
  __pyx_r = __pyx_v_data;
  goto __pyx_L0;

  /* "minipg/minipg.py":153
 * 
 * 
 * def _decode_column(data, oid, encoding, tzinfo):             # <<<<<<<<<<<<<<
 *     def _get_timezone_offset(data):
 *         n = data.rfind('+')
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("minipg.minipg._decode_column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(_get_timezone_offset);
  __Pyx_XDECREF(_parse_point);
  __Pyx_XDECREF(__pyx_v_dt);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_days);
  __Pyx_XDECREF(__pyx_v_hours);
  __Pyx_XDECREF(__pyx_v_minites);
  __Pyx_XDECREF(__pyx_v_seconds);
  __Pyx_XDECREF(__pyx_v_microseconds);
  __Pyx_XDECREF(__pyx_v_hex_str);
  __Pyx_XDECREF(__pyx_v_ia);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_f);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_tzinfo);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":285
 * 
 * 
 * def _bytes_to_bint(b):     # Read as big endian             # <<<<<<<<<<<<<<
 *     if PY2:
 *         r = 0
 */

static PY_LONG_LONG __pyx_f_6minipg_6minipg__bytes_to_bint(PyObject *__pyx_v_b) {
  PY_LONG_LONG __pyx_v_r;
  PyObject *__pyx_v_n = NULL;
  PY_LONG_LONG __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  long __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PY_LONG_LONG __pyx_t_8;
  __Pyx_RefNannySetupContext("_bytes_to_bint", 0);

  /* "minipg/minipg.py":286
 * 
 * def _bytes_to_bint(b):     # Read as big endian
 *     if PY2:             # <<<<<<<<<<<<<<
 *         r = 0
 *         for n in b:
 */
  __pyx_t_1 = (__pyx_v_6minipg_6minipg_PY2 != 0);
  if (__pyx_t_1) {

    /* "minipg/minipg.py":287
 * def _bytes_to_bint(b):     # Read as big endian
 *     if PY2:
 *         r = 0             # <<<<<<<<<<<<<<
 *         for n in b:
 *             r = r * 256 + ord(n)
 */
    __pyx_v_r = 0;

    /* "minipg/minipg.py":288
 *     if PY2:
 *         r = 0
 *         for n in b:             # <<<<<<<<<<<<<<
 *             r = r * 256 + ord(n)
 *         return r
 */
    __pyx_t_2 = PyObject_GetIter(__pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
    for (;;) {
      {
        __pyx_t_4 = __pyx_t_3(__pyx_t_2);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 288, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "minipg/minipg.py":289
 *         r = 0
 *         for n in b:
 *             r = r * 256 + ord(n)             # <<<<<<<<<<<<<<
 *         return r
 *     else:
 */
      __pyx_t_5 = __Pyx_PyObject_Ord(__pyx_v_n); if (unlikely(__pyx_t_5 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 289, __pyx_L1_error)
      __pyx_v_r = ((__pyx_v_r * 0x100) + __pyx_t_5);

      /* "minipg/minipg.py":288
 *     if PY2:
 *         r = 0
 *         for n in b:             # <<<<<<<<<<<<<<
 *             r = r * 256 + ord(n)
 *         return r
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "minipg/minipg.py":290
 *         for n in b:
 *             r = r * 256 + ord(n)
 *         return r             # <<<<<<<<<<<<<<
 *     else:
 *         return int.from_bytes(b, byteorder='big')
 */
    __pyx_r = __pyx_v_r;
    goto __pyx_L0;

    /* "minipg/minipg.py":286
 * 
 * def _bytes_to_bint(b):     # Read as big endian
 *     if PY2:             # <<<<<<<<<<<<<<
 *         r = 0
 *         for n in b:
 */
  }

  /* "minipg/minipg.py":292
 *         return r
 *     else:
 *         return int.from_bytes(b, byteorder='big')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyInt_Type)), __pyx_n_s_from_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_b);
    __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_byteorder, __pyx_n_s_big) < 0) __PYX_ERR(0, 292, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_7); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(0, 292, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_r = __pyx_t_8;
    goto __pyx_L0;
  }

  /* "minipg/minipg.py":285
 * 
 * 
 * def _bytes_to_bint(b):     # Read as big endian             # <<<<<<<<<<<<<<
 *     if PY2:
 *         r = 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("minipg.minipg._bytes_to_bint", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":295
 * 
 * 
 * def _bint_to_bytes(val):    # Convert int value to big endian 4 bytes.             # <<<<<<<<<<<<<<
 *     if PY2:
 *         return chr((val >> 24) & 0xff) + chr((val >> 16) & 0xff) + chr((val >> 8) & 0xff) + chr(val & 0xff)
 */

static PyObject *__pyx_f_6minipg_6minipg__bint_to_bytes(int __pyx_v_val) {
  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;
  __Pyx_RefNannySetupContext("_bint_to_bytes", 0);

  /* "minipg/minipg.py":296
 * 
 * def _bint_to_bytes(val):    # Convert int value to big endian 4 bytes.
 *     if PY2:             # <<<<<<<<<<<<<<
 *         return chr((val >> 24) & 0xff) + chr((val >> 16) & 0xff) + chr((val >> 8) & 0xff) + chr(val & 0xff)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_6minipg_6minipg_PY2 != 0);
  if (__pyx_t_1) {

    /* "minipg/minipg.py":297
 * def _bint_to_bytes(val):    # Convert int value to big endian 4 bytes.
 *     if PY2:
 *         return chr((val >> 24) & 0xff) + chr((val >> 16) & 0xff) + chr((val >> 8) & 0xff) + chr(val & 0xff)             # <<<<<<<<<<<<<<
 *     else:
 *         return val.to_bytes(4, byteorder='big')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_long(((__pyx_v_val >> 24) & 0xff)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_long(((__pyx_v_val >> 16) & 0xff)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __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_t_3 = __Pyx_PyInt_From_long(((__pyx_v_val >> 8) & 0xff)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_val & 0xff)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_chr, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __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;
    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 297, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":296
 * 
 * def _bint_to_bytes(val):    # Convert int value to big endian 4 bytes.
 *     if PY2:             # <<<<<<<<<<<<<<
 *         return chr((val >> 24) & 0xff) + chr((val >> 16) & 0xff) + chr((val >> 8) & 0xff) + chr(val & 0xff)
 *     else:
 */
  }

  /* "minipg/minipg.py":299
 *         return chr((val >> 24) & 0xff) + chr((val >> 16) & 0xff) + chr((val >> 8) & 0xff) + chr(val & 0xff)
 *     else:
 *         return val.to_bytes(4, byteorder='big')             # <<<<<<<<<<<<<<
 * 
 * Date = datetime.date
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_to_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_byteorder, __pyx_n_s_big) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__37, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 299, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "minipg/minipg.py":295
 * 
 * 
 * def _bint_to_bytes(val):    # Convert int value to big endian 4 bytes.             # <<<<<<<<<<<<<<
 *     if PY2:
 *         return chr((val >> 24) & 0xff) + chr((val >> 16) & 0xff) + chr((val >> 8) & 0xff) + chr(val & 0xff)
 */

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

/* "minipg/minipg.py":307
 * 
 * 
 * def Binary(b):             # <<<<<<<<<<<<<<
 *     return bytearray(b)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_1Binary(PyObject *__pyx_self, PyObject *__pyx_v_b); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_1Binary = {"Binary", (PyCFunction)__pyx_pw_6minipg_6minipg_1Binary, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_1Binary(PyObject *__pyx_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Binary (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_Binary(__pyx_self, ((PyObject *)__pyx_v_b));

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

static PyObject *__pyx_pf_6minipg_6minipg_Binary(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("Binary", 0);

  /* "minipg/minipg.py":308
 * 
 * def Binary(b):
 *     return bytearray(b)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_b);
  __Pyx_GIVEREF(__pyx_v_b);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_b);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __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;

  /* "minipg/minipg.py":307
 * 
 * 
 * def Binary(b):             # <<<<<<<<<<<<<<
 *     return bytearray(b)
 * 
 */

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

/* "minipg/minipg.py":312
 * 
 * class DBAPITypeObject:
 *     def __init__(self, *values):             # <<<<<<<<<<<<<<
 *         self.values = values
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_15DBAPITypeObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_15DBAPITypeObject_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6minipg_6minipg_15DBAPITypeObject_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_15DBAPITypeObject_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_values = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_values)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_values);
  } else {
    __pyx_v_values = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 312, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 312, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_values); __pyx_v_values = 0;
  __Pyx_AddTraceback("minipg.minipg.DBAPITypeObject.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_15DBAPITypeObject___init__(__pyx_self, __pyx_v_self, __pyx_v_values);

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

static PyObject *__pyx_pf_6minipg_6minipg_15DBAPITypeObject___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "minipg/minipg.py":313
 * class DBAPITypeObject:
 *     def __init__(self, *values):
 *         self.values = values             # <<<<<<<<<<<<<<
 * 
 *     def __cmp__(self, other):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_values, __pyx_v_values) < 0) __PYX_ERR(0, 313, __pyx_L1_error)

  /* "minipg/minipg.py":312
 * 
 * class DBAPITypeObject:
 *     def __init__(self, *values):             # <<<<<<<<<<<<<<
 *         self.values = values
 * 
 */

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

/* "minipg/minipg.py":315
 *         self.values = values
 * 
 *     def __cmp__(self, other):             # <<<<<<<<<<<<<<
 *         if other in self.values:
 *             return 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_15DBAPITypeObject_3__cmp__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_15DBAPITypeObject_3__cmp__ = {"__cmp__", (PyCFunction)__pyx_pw_6minipg_6minipg_15DBAPITypeObject_3__cmp__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_15DBAPITypeObject_3__cmp__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cmp__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__cmp__", 1, 2, 2, 1); __PYX_ERR(0, 315, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cmp__") < 0)) __PYX_ERR(0, 315, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cmp__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 315, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.DBAPITypeObject.__cmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_15DBAPITypeObject_2__cmp__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_6minipg_6minipg_15DBAPITypeObject_2__cmp__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cmp__", 0);

  /* "minipg/minipg.py":316
 * 
 *     def __cmp__(self, other):
 *         if other in self.values:             # <<<<<<<<<<<<<<
 *             return 0
 *         if other < self.values:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_other, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "minipg/minipg.py":317
 *     def __cmp__(self, other):
 *         if other in self.values:
 *             return 0             # <<<<<<<<<<<<<<
 *         if other < self.values:
 *             return 1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;

    /* "minipg/minipg.py":316
 * 
 *     def __cmp__(self, other):
 *         if other in self.values:             # <<<<<<<<<<<<<<
 *             return 0
 *         if other < self.values:
 */
  }

  /* "minipg/minipg.py":318
 *         if other in self.values:
 *             return 0
 *         if other < self.values:             # <<<<<<<<<<<<<<
 *             return 1
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_other, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {

    /* "minipg/minipg.py":319
 *             return 0
 *         if other < self.values:
 *             return 1             # <<<<<<<<<<<<<<
 *         else:
 *             return -1
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_1);
    __pyx_r = __pyx_int_1;
    goto __pyx_L0;

    /* "minipg/minipg.py":318
 *         if other in self.values:
 *             return 0
 *         if other < self.values:             # <<<<<<<<<<<<<<
 *             return 1
 *         else:
 */
  }

  /* "minipg/minipg.py":321
 *             return 1
 *         else:
 *             return -1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_neg_1);
    __pyx_r = __pyx_int_neg_1;
    goto __pyx_L0;
  }

  /* "minipg/minipg.py":315
 *         self.values = values
 * 
 *     def __cmp__(self, other):             # <<<<<<<<<<<<<<
 *         if other in self.values:
 *             return 0
 */

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

/* "minipg/minipg.py":338
 * 
 * class Error(StandardError):
 *     def __init__(self, *args):             # <<<<<<<<<<<<<<
 *         if len(args) > 0:
 *             self.message = args[0]
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_5Error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_5Error_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6minipg_6minipg_5Error_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_5Error_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 338, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 338, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("minipg.minipg.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_5Error___init__(__pyx_self, __pyx_v_self, __pyx_v_args);

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

static PyObject *__pyx_pf_6minipg_6minipg_5Error___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "minipg/minipg.py":339
 * class Error(StandardError):
 *     def __init__(self, *args):
 *         if len(args) > 0:             # <<<<<<<<<<<<<<
 *             self.message = args[0]
 *         else:
 */
  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 339, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 > 0) != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":340
 *     def __init__(self, *args):
 *         if len(args) > 0:
 *             self.message = args[0]             # <<<<<<<<<<<<<<
 *         else:
 *             self.message = b'Database Error'
 */
    __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_t_3) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "minipg/minipg.py":339
 * class Error(StandardError):
 *     def __init__(self, *args):
 *         if len(args) > 0:             # <<<<<<<<<<<<<<
 *             self.message = args[0]
 *         else:
 */
    goto __pyx_L3;
  }

  /* "minipg/minipg.py":342
 *             self.message = args[0]
 *         else:
 *             self.message = b'Database Error'             # <<<<<<<<<<<<<<
 *         super(Error, self).__init__(*args)
 * 
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_kp_b_Database_Error) < 0) __PYX_ERR(0, 342, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "minipg/minipg.py":343
 *         else:
 *             self.message = b'Database Error'
 *         super(Error, self).__init__(*args)             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __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_v_args, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __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;

  /* "minipg/minipg.py":338
 * 
 * class Error(StandardError):
 *     def __init__(self, *args):             # <<<<<<<<<<<<<<
 *         if len(args) > 0:
 *             self.message = args[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_4);
  __Pyx_AddTraceback("minipg.minipg.Error.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":345
 *         super(Error, self).__init__(*args)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.message
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_5Error_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_5Error_3__str__ = {"__str__", (PyCFunction)__pyx_pw_6minipg_6minipg_5Error_3__str__, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_5Error_3__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_5Error_2__str__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_5Error_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "minipg/minipg.py":346
 * 
 *     def __str__(self):
 *         return self.message             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":345
 *         super(Error, self).__init__(*args)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.message
 * 
 */

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

/* "minipg/minipg.py":348
 *         return self.message
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.message
 * 
 */

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

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

static PyObject *__pyx_pf_6minipg_6minipg_5Error_4__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "minipg/minipg.py":349
 * 
 *     def __repr__(self):
 *         return self.message             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":348
 *         return self.message
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.message
 * 
 */

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

/* "minipg/minipg.py":369
 * 
 * class InternalError(DatabaseError):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         DatabaseError.__init__(self, 'InternalError')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_13InternalError_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_13InternalError_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6minipg_6minipg_13InternalError_1__init__, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_13InternalError_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_13InternalError___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_13InternalError___init__(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_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "minipg/minipg.py":370
 * class InternalError(DatabaseError):
 *     def __init__(self):
 *         DatabaseError.__init__(self, 'InternalError')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __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 && 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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_n_s_InternalError};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_n_s_InternalError};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_InternalError);
    __Pyx_GIVEREF(__pyx_n_s_InternalError);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_InternalError);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":369
 * 
 * class InternalError(DatabaseError):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         DatabaseError.__init__(self, 'InternalError')
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("minipg.minipg.InternalError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":390
 * 
 * class NotSupportedError(DatabaseError):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         DatabaseError.__init__(self, 'NotSupportedError')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_17NotSupportedError_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_17NotSupportedError_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6minipg_6minipg_17NotSupportedError_1__init__, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_17NotSupportedError_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_17NotSupportedError___init__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_17NotSupportedError___init__(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_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "minipg/minipg.py":391
 * class NotSupportedError(DatabaseError):
 *     def __init__(self):
 *         DatabaseError.__init__(self, 'NotSupportedError')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __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 && 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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_n_s_NotSupportedError};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_self, __pyx_n_s_NotSupportedError};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
    __Pyx_INCREF(__pyx_n_s_NotSupportedError);
    __Pyx_GIVEREF(__pyx_n_s_NotSupportedError);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_NotSupportedError);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":390
 * 
 * class NotSupportedError(DatabaseError):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         DatabaseError.__init__(self, 'NotSupportedError')
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("minipg.minipg.NotSupportedError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":395
 * 
 * class Cursor(object):
 *     def __init__(self, connection):             # <<<<<<<<<<<<<<
 *         self.connection = connection
 *         self.description = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_1__init__ = {"__init__", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_connection = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_connection,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_connection)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 395, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 395, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_connection = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 395, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor___init__(__pyx_self, __pyx_v_self, __pyx_v_connection);

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_connection) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "minipg/minipg.py":396
 * class Cursor(object):
 *     def __init__(self, connection):
 *         self.connection = connection             # <<<<<<<<<<<<<<
 *         self.description = []
 *         self._rows = collections.deque()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_connection, __pyx_v_connection) < 0) __PYX_ERR(0, 396, __pyx_L1_error)

  /* "minipg/minipg.py":397
 *     def __init__(self, connection):
 *         self.connection = connection
 *         self.description = []             # <<<<<<<<<<<<<<
 *         self._rows = collections.deque()
 *         self._rowcount = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_description, __pyx_t_1) < 0) __PYX_ERR(0, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":398
 *         self.connection = connection
 *         self.description = []
 *         self._rows = collections.deque()             # <<<<<<<<<<<<<<
 *         self._rowcount = 0
 *         self.arraysize = 1
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rows, __pyx_t_1) < 0) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":399
 *         self.description = []
 *         self._rows = collections.deque()
 *         self._rowcount = 0             # <<<<<<<<<<<<<<
 *         self.arraysize = 1
 *         self.query = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowcount, __pyx_int_0) < 0) __PYX_ERR(0, 399, __pyx_L1_error)

  /* "minipg/minipg.py":400
 *         self._rows = collections.deque()
 *         self._rowcount = 0
 *         self.arraysize = 1             # <<<<<<<<<<<<<<
 *         self.query = None
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_arraysize, __pyx_int_1) < 0) __PYX_ERR(0, 400, __pyx_L1_error)

  /* "minipg/minipg.py":401
 *         self._rowcount = 0
 *         self.arraysize = 1
 *         self.query = None             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_query, Py_None) < 0) __PYX_ERR(0, 401, __pyx_L1_error)

  /* "minipg/minipg.py":395
 * 
 * class Cursor(object):
 *     def __init__(self, connection):             # <<<<<<<<<<<<<<
 *         self.connection = connection
 *         self.description = []
 */

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

/* "minipg/minipg.py":403
 *         self.query = None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_3__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_3__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_3__enter__, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_3__enter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_2__enter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_2__enter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "minipg/minipg.py":404
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc, value, traceback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "minipg/minipg.py":403
 *         self.query = None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "minipg/minipg.py":406
 *         return self
 * 
 *     def __exit__(self, exc, value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_5__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_5__exit__ = {"__exit__", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_5__exit__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_5__exit__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_exc,&__pyx_n_s_value,&__pyx_n_s_traceback,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 1); __PYX_ERR(0, 406, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 2); __PYX_ERR(0, 406, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, 3); __PYX_ERR(0, 406, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 406, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_exc = values[1];
    __pyx_v_value = values[2];
    __pyx_v_traceback = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 406, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_4__exit__(__pyx_self, __pyx_v_self, __pyx_v_exc, __pyx_v_value, __pyx_v_traceback);

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_4__exit__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "minipg/minipg.py":407
 * 
 *     def __exit__(self, exc, value, traceback):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def callproc(self, procname, args=()):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __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;

  /* "minipg/minipg.py":406
 *         return self
 * 
 *     def __exit__(self, exc, value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("minipg.minipg.Cursor.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":409
 *         self.close()
 * 
 *     def callproc(self, procname, args=()):             # <<<<<<<<<<<<<<
 *         raise NotSupportedError()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_7callproc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_7callproc = {"callproc", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_7callproc, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_7callproc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_procname = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("callproc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_procname,&__pyx_n_s_args,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_procname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("callproc", 0, 2, 3, 1); __PYX_ERR(0, 409, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "callproc") < 0)) __PYX_ERR(0, 409, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_procname = values[1];
    __pyx_v_args = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("callproc", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 409, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.callproc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_6callproc(__pyx_self, __pyx_v_self, __pyx_v_procname, __pyx_v_args);

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_6callproc(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_procname, CYTHON_UNUSED PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("callproc", 0);

  /* "minipg/minipg.py":410
 * 
 *     def callproc(self, procname, args=()):
 *         raise NotSupportedError()             # <<<<<<<<<<<<<<
 * 
 *     def nextset(self, procname, args=()):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 410, __pyx_L1_error)

  /* "minipg/minipg.py":409
 *         self.close()
 * 
 *     def callproc(self, procname, args=()):             # <<<<<<<<<<<<<<
 *         raise NotSupportedError()
 * 
 */

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

/* "minipg/minipg.py":412
 *         raise NotSupportedError()
 * 
 *     def nextset(self, procname, args=()):             # <<<<<<<<<<<<<<
 *         raise NotSupportedError()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_9nextset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_9nextset = {"nextset", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_9nextset, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_9nextset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_procname = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("nextset (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_procname,&__pyx_n_s_args,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_procname)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("nextset", 0, 2, 3, 1); __PYX_ERR(0, 412, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nextset") < 0)) __PYX_ERR(0, 412, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_procname = values[1];
    __pyx_v_args = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("nextset", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 412, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.nextset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_8nextset(__pyx_self, __pyx_v_self, __pyx_v_procname, __pyx_v_args);

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_8nextset(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_procname, CYTHON_UNUSED PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("nextset", 0);

  /* "minipg/minipg.py":413
 * 
 *     def nextset(self, procname, args=()):
 *         raise NotSupportedError()             # <<<<<<<<<<<<<<
 * 
 *     def setinputsizes(sizes):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_NotSupportedError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 413, __pyx_L1_error)

  /* "minipg/minipg.py":412
 *         raise NotSupportedError()
 * 
 *     def nextset(self, procname, args=()):             # <<<<<<<<<<<<<<
 *         raise NotSupportedError()
 * 
 */

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

/* "minipg/minipg.py":415
 *         raise NotSupportedError()
 * 
 *     def setinputsizes(sizes):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_11setinputsizes(PyObject *__pyx_self, PyObject *__pyx_v_sizes); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_11setinputsizes = {"setinputsizes", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_11setinputsizes, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_11setinputsizes(PyObject *__pyx_self, PyObject *__pyx_v_sizes) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setinputsizes (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_10setinputsizes(__pyx_self, ((PyObject *)__pyx_v_sizes));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_10setinputsizes(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_sizes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setinputsizes", 0);

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

/* "minipg/minipg.py":418
 *         pass
 * 
 *     def setoutputsize(size, column=None):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_13setoutputsize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_13setoutputsize = {"setoutputsize", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_13setoutputsize, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_13setoutputsize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_size = 0;
  CYTHON_UNUSED PyObject *__pyx_v_column = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setoutputsize (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_size,&__pyx_n_s_column,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_column);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setoutputsize") < 0)) __PYX_ERR(0, 418, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_size = values[0];
    __pyx_v_column = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("setoutputsize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 418, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.setoutputsize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_12setoutputsize(__pyx_self, __pyx_v_size, __pyx_v_column);

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_12setoutputsize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_size, CYTHON_UNUSED PyObject *__pyx_v_column) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("setoutputsize", 0);

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

/* "minipg/minipg.py":421
 *         pass
 * 
 *     def execute(self, query, args=()):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_15execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_15execute = {"execute", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_15execute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_15execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_query,&__pyx_n_s_args,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_empty_tuple));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("execute", 0, 2, 3, 1); __PYX_ERR(0, 421, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 421, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_query = values[1];
    __pyx_v_args = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 421, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_14execute(__pyx_self, __pyx_v_self, __pyx_v_query, __pyx_v_args);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6minipg_6minipg_6Cursor_7execute_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "minipg/minipg.py":429
 *         if args:
 *             escaped_args = tuple(
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args             # <<<<<<<<<<<<<<
 *             )
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 */

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_7execute_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *)__pyx_tp_new_6minipg_6minipg___pyx_scope_struct_1_genexpr(__pyx_ptype_6minipg_6minipg___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 429, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6minipg_6minipg_6Cursor_7execute_2generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Cursor_execute_locals_genexpr, __pyx_n_s_minipg_minipg); if (unlikely(!gen)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.execute.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_6minipg_6minipg_6Cursor_7execute_2generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6minipg_6minipg___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)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 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(0, 429, __pyx_L1_error)

  /* "minipg/minipg.py":430
 *             escaped_args = tuple(
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args
 *             )             # <<<<<<<<<<<<<<
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 *             query = query % escaped_args
 */
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); __PYX_ERR(0, 430, __pyx_L1_error) }

  /* "minipg/minipg.py":429
 *         if args:
 *             escaped_args = tuple(
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args             # <<<<<<<<<<<<<<
 *             )
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 */
  if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) {
    __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) 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(0, 429, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) 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(0, 429, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 429, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_arg);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_arg, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 429, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_connection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_escape_parameter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_cur_scope->__pyx_v_arg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_arg};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_arg};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_cur_scope->__pyx_v_arg);
        __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_arg);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_cur_scope->__pyx_v_arg);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __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_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* 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;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 429, __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_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":421
 *         pass
 * 
 *     def execute(self, query, args=()):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")
 */

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_14execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_args) {
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *__pyx_cur_scope;
  PyObject *__pyx_v_escaped_args = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("execute", 0);
  __pyx_cur_scope = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *)__pyx_tp_new_6minipg_6minipg___pyx_scope_struct__execute(__pyx_ptype_6minipg_6minipg___pyx_scope_struct__execute, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 421, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
  __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_INCREF(__pyx_v_query);

  /* "minipg/minipg.py":422
 * 
 *     def execute(self, query, args=()):
 *         if not self.connection or not self.connection.is_connect():             # <<<<<<<<<<<<<<
 *             raise ProgrammingError(u"08003:Lost connection")
 *         self.description = []
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_connection); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_connection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_is_connect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = ((!__pyx_t_4) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "minipg/minipg.py":423
 *     def execute(self, query, args=()):
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")             # <<<<<<<<<<<<<<
 *         self.description = []
 *         self._rows.clear()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ProgrammingError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 423, __pyx_L1_error)

    /* "minipg/minipg.py":422
 * 
 *     def execute(self, query, args=()):
 *         if not self.connection or not self.connection.is_connect():             # <<<<<<<<<<<<<<
 *             raise ProgrammingError(u"08003:Lost connection")
 *         self.description = []
 */
  }

  /* "minipg/minipg.py":424
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")
 *         self.description = []             # <<<<<<<<<<<<<<
 *         self._rows.clear()
 *         self.args = args
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_description, __pyx_t_6) < 0) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "minipg/minipg.py":425
 *             raise ProgrammingError(u"08003:Lost connection")
 *         self.description = []
 *         self._rows.clear()             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if args:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "minipg/minipg.py":426
 *         self.description = []
 *         self._rows.clear()
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if args:
 *             escaped_args = tuple(
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_args, __pyx_cur_scope->__pyx_v_args) < 0) __PYX_ERR(0, 426, __pyx_L1_error)

  /* "minipg/minipg.py":427
 *         self._rows.clear()
 *         self.args = args
 *         if args:             # <<<<<<<<<<<<<<
 *             escaped_args = tuple(
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_args); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "minipg/minipg.py":429
 *         if args:
 *             escaped_args = tuple(
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args             # <<<<<<<<<<<<<<
 *             )
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 */
    __pyx_t_6 = __pyx_pf_6minipg_6minipg_6Cursor_7execute_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "minipg/minipg.py":428
 *         self.args = args
 *         if args:
 *             escaped_args = tuple(             # <<<<<<<<<<<<<<
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args
 *             )
 */
    __pyx_t_5 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_escaped_args = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "minipg/minipg.py":431
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args
 *             )
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')             # <<<<<<<<<<<<<<
 *             query = query % escaped_args
 *             query = query.replace(u'%%', u'%')
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_replace); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "minipg/minipg.py":432
 *             )
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 *             query = query % escaped_args             # <<<<<<<<<<<<<<
 *             query = query.replace(u'%%', u'%')
 *         self.query = query
 */
    __pyx_t_6 = PyNumber_Remainder(__pyx_v_query, __pyx_v_escaped_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "minipg/minipg.py":433
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 *             query = query % escaped_args
 *             query = query.replace(u'%%', u'%')             # <<<<<<<<<<<<<<
 *         self.query = query
 *         self.connection.execute(query, self)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_query, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "minipg/minipg.py":427
 *         self._rows.clear()
 *         self.args = args
 *         if args:             # <<<<<<<<<<<<<<
 *             escaped_args = tuple(
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args
 */
  }

  /* "minipg/minipg.py":434
 *             query = query % escaped_args
 *             query = query.replace(u'%%', u'%')
 *         self.query = query             # <<<<<<<<<<<<<<
 *         self.connection.execute(query, self)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_query, __pyx_v_query) < 0) __PYX_ERR(0, 434, __pyx_L1_error)

  /* "minipg/minipg.py":435
 *             query = query.replace(u'%%', u'%')
 *         self.query = query
 *         self.connection.execute(query, self)             # <<<<<<<<<<<<<<
 * 
 *     def executemany(self, query, seq_of_params):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_connection); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_execute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_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;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_query, __pyx_cur_scope->__pyx_v_self};
    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_query, __pyx_cur_scope->__pyx_v_self};
    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_5);
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_query);
    __Pyx_GIVEREF(__pyx_v_query);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_query);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_cur_scope->__pyx_v_self);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "minipg/minipg.py":421
 *         pass
 * 
 *     def execute(self, query, args=()):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("minipg.minipg.Cursor.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_escaped_args);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":437
 *         self.connection.execute(query, self)
 * 
 *     def executemany(self, query, seq_of_params):             # <<<<<<<<<<<<<<
 *         rowcount = 0
 *         for params in seq_of_params:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_17executemany(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_17executemany = {"executemany", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_17executemany, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_17executemany(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_seq_of_params = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("executemany (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_query,&__pyx_n_s_seq_of_params,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("executemany", 1, 3, 3, 1); __PYX_ERR(0, 437, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq_of_params)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("executemany", 1, 3, 3, 2); __PYX_ERR(0, 437, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "executemany") < 0)) __PYX_ERR(0, 437, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_query = values[1];
    __pyx_v_seq_of_params = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("executemany", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 437, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.executemany", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_16executemany(__pyx_self, __pyx_v_self, __pyx_v_query, __pyx_v_seq_of_params);

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_16executemany(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_seq_of_params) {
  PyObject *__pyx_v_rowcount = NULL;
  PyObject *__pyx_v_params = 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("executemany", 0);

  /* "minipg/minipg.py":438
 * 
 *     def executemany(self, query, seq_of_params):
 *         rowcount = 0             # <<<<<<<<<<<<<<
 *         for params in seq_of_params:
 *             self.execute(query, params)
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_rowcount = __pyx_int_0;

  /* "minipg/minipg.py":439
 *     def executemany(self, query, seq_of_params):
 *         rowcount = 0
 *         for params in seq_of_params:             # <<<<<<<<<<<<<<
 *             self.execute(query, params)
 *             rowcount += self._rowcount
 */
  if (likely(PyList_CheckExact(__pyx_v_seq_of_params)) || PyTuple_CheckExact(__pyx_v_seq_of_params)) {
    __pyx_t_1 = __pyx_v_seq_of_params; __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_seq_of_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) 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(0, 439, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) 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(0, 439, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __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(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 439, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_params, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "minipg/minipg.py":440
 *         rowcount = 0
 *         for params in seq_of_params:
 *             self.execute(query, params)             # <<<<<<<<<<<<<<
 *             rowcount += self._rowcount
 *         self._rowcount = rowcount
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_execute); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_query, __pyx_v_params};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_query, __pyx_v_params};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_query);
      __Pyx_GIVEREF(__pyx_v_query);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_query);
      __Pyx_INCREF(__pyx_v_params);
      __Pyx_GIVEREF(__pyx_v_params);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_params);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "minipg/minipg.py":441
 *         for params in seq_of_params:
 *             self.execute(query, params)
 *             rowcount += self._rowcount             # <<<<<<<<<<<<<<
 *         self._rowcount = rowcount
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowcount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_rowcount, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_rowcount, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "minipg/minipg.py":439
 *     def executemany(self, query, seq_of_params):
 *         rowcount = 0
 *         for params in seq_of_params:             # <<<<<<<<<<<<<<
 *             self.execute(query, params)
 *             rowcount += self._rowcount
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":442
 *             self.execute(query, params)
 *             rowcount += self._rowcount
 *         self._rowcount = rowcount             # <<<<<<<<<<<<<<
 * 
 *     def fetchone(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rowcount, __pyx_v_rowcount) < 0) __PYX_ERR(0, 442, __pyx_L1_error)

  /* "minipg/minipg.py":437
 *         self.connection.execute(query, self)
 * 
 *     def executemany(self, query, seq_of_params):             # <<<<<<<<<<<<<<
 *         rowcount = 0
 *         for params in seq_of_params:
 */

  /* 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_8);
  __Pyx_AddTraceback("minipg.minipg.Cursor.executemany", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rowcount);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":444
 *         self._rowcount = rowcount
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise OperationalError(u"08003:Lost connection")
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_19fetchone(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_19fetchone = {"fetchone", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_19fetchone, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_19fetchone(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fetchone (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_18fetchone(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_18fetchone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  __Pyx_RefNannySetupContext("fetchone", 0);

  /* "minipg/minipg.py":445
 * 
 *     def fetchone(self):
 *         if not self.connection or not self.connection.is_connect():             # <<<<<<<<<<<<<<
 *             raise OperationalError(u"08003:Lost connection")
 *         if len(self._rows):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connection); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_is_connect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = ((!__pyx_t_4) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "minipg/minipg.py":446
 *     def fetchone(self):
 *         if not self.connection or not self.connection.is_connect():
 *             raise OperationalError(u"08003:Lost connection")             # <<<<<<<<<<<<<<
 *         if len(self._rows):
 *             return self._rows.popleft()
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_OperationalError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(0, 446, __pyx_L1_error)

    /* "minipg/minipg.py":445
 * 
 *     def fetchone(self):
 *         if not self.connection or not self.connection.is_connect():             # <<<<<<<<<<<<<<
 *             raise OperationalError(u"08003:Lost connection")
 *         if len(self._rows):
 */
  }

  /* "minipg/minipg.py":447
 *         if not self.connection or not self.connection.is_connect():
 *             raise OperationalError(u"08003:Lost connection")
 *         if len(self._rows):             # <<<<<<<<<<<<<<
 *             return self._rows.popleft()
 *         return None
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rows); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = (__pyx_t_7 != 0);
  if (__pyx_t_1) {

    /* "minipg/minipg.py":448
 *             raise OperationalError(u"08003:Lost connection")
 *         if len(self._rows):
 *             return self._rows.popleft()             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rows); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_popleft); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 448, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 448, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":447
 *         if not self.connection or not self.connection.is_connect():
 *             raise OperationalError(u"08003:Lost connection")
 *         if len(self._rows):             # <<<<<<<<<<<<<<
 *             return self._rows.popleft()
 *         return None
 */
  }

  /* "minipg/minipg.py":449
 *         if len(self._rows):
 *             return self._rows.popleft()
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def fetchmany(self, size=1):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "minipg/minipg.py":444
 *         self._rowcount = rowcount
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise OperationalError(u"08003:Lost connection")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("minipg.minipg.Cursor.fetchone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":451
 *         return None
 * 
 *     def fetchmany(self, size=1):             # <<<<<<<<<<<<<<
 *         rs = []
 *         for i in range(size):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_21fetchmany(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_21fetchmany = {"fetchmany", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_21fetchmany, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_21fetchmany(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_size = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fetchmany (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_size,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fetchmany") < 0)) __PYX_ERR(0, 451, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_size = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fetchmany", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 451, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Cursor.fetchmany", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_20fetchmany(__pyx_self, __pyx_v_self, __pyx_v_size);

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_20fetchmany(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_size) {
  PyObject *__pyx_v_rs = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_r = 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)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("fetchmany", 0);

  /* "minipg/minipg.py":452
 * 
 *     def fetchmany(self, size=1):
 *         rs = []             # <<<<<<<<<<<<<<
 *         for i in range(size):
 *             r = self.fetchone()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":453
 *     def fetchmany(self, size=1):
 *         rs = []
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             r = self.fetchone()
 *             if not r:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_size);
  __Pyx_GIVEREF(__pyx_v_size);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_size);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 453, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 453, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 453, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 453, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "minipg/minipg.py":454
 *         rs = []
 *         for i in range(size):
 *             r = self.fetchone()             # <<<<<<<<<<<<<<
 *             if not r:
 *                 break
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fetchone); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "minipg/minipg.py":455
 *         for i in range(size):
 *             r = self.fetchone()
 *             if not r:             # <<<<<<<<<<<<<<
 *                 break
 *             rs.append(r)
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_r); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 455, __pyx_L1_error)
    __pyx_t_8 = ((!__pyx_t_7) != 0);
    if (__pyx_t_8) {

      /* "minipg/minipg.py":456
 *             r = self.fetchone()
 *             if not r:
 *                 break             # <<<<<<<<<<<<<<
 *             rs.append(r)
 *         return rs
 */
      goto __pyx_L4_break;

      /* "minipg/minipg.py":455
 *         for i in range(size):
 *             r = self.fetchone()
 *             if not r:             # <<<<<<<<<<<<<<
 *                 break
 *             rs.append(r)
 */
    }

    /* "minipg/minipg.py":457
 *             if not r:
 *                 break
 *             rs.append(r)             # <<<<<<<<<<<<<<
 *         return rs
 * 
 */
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_rs, __pyx_v_r); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 457, __pyx_L1_error)

    /* "minipg/minipg.py":453
 *     def fetchmany(self, size=1):
 *         rs = []
 *         for i in range(size):             # <<<<<<<<<<<<<<
 *             r = self.fetchone()
 *             if not r:
 */
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":458
 *                 break
 *             rs.append(r)
 *         return rs             # <<<<<<<<<<<<<<
 * 
 *     def fetchall(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rs);
  __pyx_r = __pyx_v_rs;
  goto __pyx_L0;

  /* "minipg/minipg.py":451
 *         return None
 * 
 *     def fetchmany(self, size=1):             # <<<<<<<<<<<<<<
 *         rs = []
 *         for i in range(size):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("minipg.minipg.Cursor.fetchmany", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rs);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":460
 *         return rs
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         r = list(self._rows)
 *         self._rows.clear()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_23fetchall(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_23fetchall = {"fetchall", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_23fetchall, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_23fetchall(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fetchall (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_22fetchall(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_22fetchall(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("fetchall", 0);

  /* "minipg/minipg.py":461
 * 
 *     def fetchall(self):
 *         r = list(self._rows)             # <<<<<<<<<<<<<<
 *         self._rows.clear()
 *         return r
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "minipg/minipg.py":462
 *     def fetchall(self):
 *         r = list(self._rows)
 *         self._rows.clear()             # <<<<<<<<<<<<<<
 *         return r
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rows); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __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;

  /* "minipg/minipg.py":463
 *         r = list(self._rows)
 *         self._rows.clear()
 *         return r             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_r);
  __pyx_r = __pyx_v_r;
  goto __pyx_L0;

  /* "minipg/minipg.py":460
 *         return rs
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         r = list(self._rows)
 *         self._rows.clear()
 */

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

/* "minipg/minipg.py":465
 *         return r
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         self.connection = None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_25close(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_25close = {"close", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_25close, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_25close(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_24close(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_24close(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close", 0);

  /* "minipg/minipg.py":466
 * 
 *     def close(self):
 *         self.connection = None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_connection, Py_None) < 0) __PYX_ERR(0, 466, __pyx_L1_error)

  /* "minipg/minipg.py":465
 *         return r
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         self.connection = None
 * 
 */

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

/* "minipg/minipg.py":469
 * 
 *     @property
 *     def rowcount(self):             # <<<<<<<<<<<<<<
 *         return self._rowcount
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_27rowcount(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_27rowcount = {"rowcount", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_27rowcount, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_27rowcount(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rowcount (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_26rowcount(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_26rowcount(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rowcount", 0);

  /* "minipg/minipg.py":470
 *     @property
 *     def rowcount(self):
 *         return self._rowcount             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rowcount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":469
 * 
 *     @property
 *     def rowcount(self):             # <<<<<<<<<<<<<<
 *         return self._rowcount
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("minipg.minipg.Cursor.rowcount", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":473
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         return self.connection is None or not self.connection.is_connect()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_29closed(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_29closed = {"closed", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_29closed, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_29closed(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("closed (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_28closed(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_28closed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("closed", 0);

  /* "minipg/minipg.py":474
 *     @property
 *     def closed(self):
 *         return self.connection is None or not self.connection.is_connect()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connection); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = (__pyx_t_2 == Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_connection); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_is_connect); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = (!__pyx_t_3);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":473
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         return self.connection is None or not self.connection.is_connect()
 * 
 */

  /* 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_5);
  __Pyx_AddTraceback("minipg.minipg.Cursor.closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":476
 *         return self.connection is None or not self.connection.is_connect()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_31__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_31__iter__ = {"__iter__", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_31__iter__, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_31__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_30__iter__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_30__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "minipg/minipg.py":477
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "minipg/minipg.py":476
 *         return self.connection is None or not self.connection.is_connect()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "minipg/minipg.py":479
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         r = self.fetchone()
 *         if not r:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_33__next__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_33__next__ = {"__next__", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_33__next__, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_33__next__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_32__next__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_32__next__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "minipg/minipg.py":480
 * 
 *     def __next__(self):
 *         r = self.fetchone()             # <<<<<<<<<<<<<<
 *         if not r:
 *             raise StopIteration()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fetchone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_r = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":481
 *     def __next__(self):
 *         r = self.fetchone()
 *         if not r:             # <<<<<<<<<<<<<<
 *             raise StopIteration()
 *         return r
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_r); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 481, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "minipg/minipg.py":482
 *         r = self.fetchone()
 *         if not r:
 *             raise StopIteration()             # <<<<<<<<<<<<<<
 *         return r
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_StopIteration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 482, __pyx_L1_error)

    /* "minipg/minipg.py":481
 *     def __next__(self):
 *         r = self.fetchone()
 *         if not r:             # <<<<<<<<<<<<<<
 *             raise StopIteration()
 *         return r
 */
  }

  /* "minipg/minipg.py":483
 *         if not r:
 *             raise StopIteration()
 *         return r             # <<<<<<<<<<<<<<
 * 
 *     def next(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_r);
  __pyx_r = __pyx_v_r;
  goto __pyx_L0;

  /* "minipg/minipg.py":479
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         r = self.fetchone()
 *         if not r:
 */

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

/* "minipg/minipg.py":485
 *         return r
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         return self.__next__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_35next(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_6Cursor_35next = {"next", (PyCFunction)__pyx_pw_6minipg_6minipg_6Cursor_35next, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_6Cursor_35next(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6Cursor_34next(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_6Cursor_34next(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;
  __Pyx_RefNannySetupContext("next", 0);

  /* "minipg/minipg.py":486
 * 
 *     def next(self):
 *         return self.__next__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_next); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __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;

  /* "minipg/minipg.py":485
 *         return r
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         return self.__next__()
 * 
 */

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

/* "minipg/minipg.py":490
 * 
 * class Connection(object):
 *     def __init__(self, user, password, database, host, port, timeout, use_ssl, tzinfo):             # <<<<<<<<<<<<<<
 *         self.user = user
 *         self.password = password
 */

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_user = 0;
  PyObject *__pyx_v_password = 0;
  PyObject *__pyx_v_database = 0;
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_v_use_ssl = 0;
  PyObject *__pyx_v_tzinfo = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_user,&__pyx_n_s_password,&__pyx_n_s_database,&__pyx_n_s_host,&__pyx_n_s_port,&__pyx_n_s_timeout,&__pyx_n_s_use_ssl,&__pyx_n_s_tzinfo,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_user)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_password)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 1); __PYX_ERR(0, 490, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_database)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 2); __PYX_ERR(0, 490, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_host)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 3); __PYX_ERR(0, 490, __pyx_L3_error)
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 4); __PYX_ERR(0, 490, __pyx_L3_error)
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 5); __PYX_ERR(0, 490, __pyx_L3_error)
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_ssl)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 6); __PYX_ERR(0, 490, __pyx_L3_error)
        }
        case  7:
        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tzinfo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 7); __PYX_ERR(0, 490, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 490, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
    }
    __pyx_v_user = values[0];
    __pyx_v_password = values[1];
    __pyx_v_database = values[2];
    __pyx_v_host = values[3];
    __pyx_v_port = values[4];
    __pyx_v_timeout = values[5];
    __pyx_v_use_ssl = values[6];
    __pyx_v_tzinfo = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 490, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Connection.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection___init__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), __pyx_v_user, __pyx_v_password, __pyx_v_database, __pyx_v_host, __pyx_v_port, __pyx_v_timeout, __pyx_v_use_ssl, __pyx_v_tzinfo);

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

static int __pyx_pf_6minipg_6minipg_10Connection___init__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_user, PyObject *__pyx_v_password, PyObject *__pyx_v_database, PyObject *__pyx_v_host, PyObject *__pyx_v_port, PyObject *__pyx_v_timeout, PyObject *__pyx_v_use_ssl, PyObject *__pyx_v_tzinfo) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "minipg/minipg.py":491
 * class Connection(object):
 *     def __init__(self, user, password, database, host, port, timeout, use_ssl, tzinfo):
 *         self.user = user             # <<<<<<<<<<<<<<
 *         self.password = password
 *         self.database = database
 */
  __Pyx_INCREF(__pyx_v_user);
  __Pyx_GIVEREF(__pyx_v_user);
  __Pyx_GOTREF(__pyx_v_self->user);
  __Pyx_DECREF(__pyx_v_self->user);
  __pyx_v_self->user = __pyx_v_user;

  /* "minipg/minipg.py":492
 *     def __init__(self, user, password, database, host, port, timeout, use_ssl, tzinfo):
 *         self.user = user
 *         self.password = password             # <<<<<<<<<<<<<<
 *         self.database = database
 *         self.host = host
 */
  __Pyx_INCREF(__pyx_v_password);
  __Pyx_GIVEREF(__pyx_v_password);
  __Pyx_GOTREF(__pyx_v_self->password);
  __Pyx_DECREF(__pyx_v_self->password);
  __pyx_v_self->password = __pyx_v_password;

  /* "minipg/minipg.py":493
 *         self.user = user
 *         self.password = password
 *         self.database = database             # <<<<<<<<<<<<<<
 *         self.host = host
 *         self.port = port
 */
  __Pyx_INCREF(__pyx_v_database);
  __Pyx_GIVEREF(__pyx_v_database);
  __Pyx_GOTREF(__pyx_v_self->database);
  __Pyx_DECREF(__pyx_v_self->database);
  __pyx_v_self->database = __pyx_v_database;

  /* "minipg/minipg.py":494
 *         self.password = password
 *         self.database = database
 *         self.host = host             # <<<<<<<<<<<<<<
 *         self.port = port
 *         self.timeout = timeout
 */
  __Pyx_INCREF(__pyx_v_host);
  __Pyx_GIVEREF(__pyx_v_host);
  __Pyx_GOTREF(__pyx_v_self->host);
  __Pyx_DECREF(__pyx_v_self->host);
  __pyx_v_self->host = __pyx_v_host;

  /* "minipg/minipg.py":495
 *         self.database = database
 *         self.host = host
 *         self.port = port             # <<<<<<<<<<<<<<
 *         self.timeout = timeout
 *         self.use_ssl = use_ssl
 */
  __Pyx_INCREF(__pyx_v_port);
  __Pyx_GIVEREF(__pyx_v_port);
  __Pyx_GOTREF(__pyx_v_self->port);
  __Pyx_DECREF(__pyx_v_self->port);
  __pyx_v_self->port = __pyx_v_port;

  /* "minipg/minipg.py":496
 *         self.host = host
 *         self.port = port
 *         self.timeout = timeout             # <<<<<<<<<<<<<<
 *         self.use_ssl = use_ssl
 *         self.tzinfo = tzinfo
 */
  __Pyx_INCREF(__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_v_timeout);
  __Pyx_GOTREF(__pyx_v_self->timeout);
  __Pyx_DECREF(__pyx_v_self->timeout);
  __pyx_v_self->timeout = __pyx_v_timeout;

  /* "minipg/minipg.py":497
 *         self.port = port
 *         self.timeout = timeout
 *         self.use_ssl = use_ssl             # <<<<<<<<<<<<<<
 *         self.tzinfo = tzinfo
 *         self.encoding = 'UTF8'
 */
  __Pyx_INCREF(__pyx_v_use_ssl);
  __Pyx_GIVEREF(__pyx_v_use_ssl);
  __Pyx_GOTREF(__pyx_v_self->use_ssl);
  __Pyx_DECREF(__pyx_v_self->use_ssl);
  __pyx_v_self->use_ssl = __pyx_v_use_ssl;

  /* "minipg/minipg.py":498
 *         self.timeout = timeout
 *         self.use_ssl = use_ssl
 *         self.tzinfo = tzinfo             # <<<<<<<<<<<<<<
 *         self.encoding = 'UTF8'
 *         self.autocommit = False
 */
  __Pyx_INCREF(__pyx_v_tzinfo);
  __Pyx_GIVEREF(__pyx_v_tzinfo);
  __Pyx_GOTREF(__pyx_v_self->tzinfo);
  __Pyx_DECREF(__pyx_v_self->tzinfo);
  __pyx_v_self->tzinfo = __pyx_v_tzinfo;

  /* "minipg/minipg.py":499
 *         self.use_ssl = use_ssl
 *         self.tzinfo = tzinfo
 *         self.encoding = 'UTF8'             # <<<<<<<<<<<<<<
 *         self.autocommit = False
 *         self._ready_for_query = b'I'
 */
  __Pyx_INCREF(__pyx_n_s_UTF8);
  __Pyx_GIVEREF(__pyx_n_s_UTF8);
  __Pyx_GOTREF(__pyx_v_self->encoding);
  __Pyx_DECREF(__pyx_v_self->encoding);
  __pyx_v_self->encoding = __pyx_n_s_UTF8;

  /* "minipg/minipg.py":500
 *         self.tzinfo = tzinfo
 *         self.encoding = 'UTF8'
 *         self.autocommit = False             # <<<<<<<<<<<<<<
 *         self._ready_for_query = b'I'
 *         self._open()
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF(__pyx_v_self->autocommit);
  __Pyx_DECREF(__pyx_v_self->autocommit);
  __pyx_v_self->autocommit = Py_False;

  /* "minipg/minipg.py":501
 *         self.encoding = 'UTF8'
 *         self.autocommit = False
 *         self._ready_for_query = b'I'             # <<<<<<<<<<<<<<
 *         self._open()
 *         self.encoders = {}
 */
  __Pyx_INCREF(__pyx_n_b_I);
  __Pyx_GIVEREF(__pyx_n_b_I);
  __Pyx_GOTREF(__pyx_v_self->_ready_for_query);
  __Pyx_DECREF(__pyx_v_self->_ready_for_query);
  __pyx_v_self->_ready_for_query = __pyx_n_b_I;

  /* "minipg/minipg.py":502
 *         self.autocommit = False
 *         self._ready_for_query = b'I'
 *         self._open()             # <<<<<<<<<<<<<<
 *         self.encoders = {}
 * 
 */
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_open(__pyx_v_self);

  /* "minipg/minipg.py":503
 *         self._ready_for_query = b'I'
 *         self._open()
 *         self.encoders = {}             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->encoders);
  __Pyx_DECREF(__pyx_v_self->encoders);
  __pyx_v_self->encoders = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":490
 * 
 * class Connection(object):
 *     def __init__(self, user, password, database, host, port, timeout, use_ssl, tzinfo):             # <<<<<<<<<<<<<<
 *         self.user = user
 *         self.password = password
 */

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

/* "minipg/minipg.py":505
 *         self.encoders = {}
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_3__enter__ = {"__enter__", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_3__enter__, METH_NOARGS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_2__enter__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_2__enter__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "minipg/minipg.py":506
 * 
 *     def __enter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc, value, traceback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "minipg/minipg.py":505
 *         self.encoders = {}
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "minipg/minipg.py":508
 *         return self
 * 
 *     def __exit__(self, exc, value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_5__exit__ = {"__exit__", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_5__exit__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc = 0;
  CYTHON_UNUSED PyObject *__pyx_v_value = 0;
  CYTHON_UNUSED PyObject *__pyx_v_traceback = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,&__pyx_n_s_value,&__pyx_n_s_traceback,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 508, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_traceback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 508, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(0, 508, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_exc = values[0];
    __pyx_v_value = values[1];
    __pyx_v_traceback = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 508, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Connection.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_4__exit__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), __pyx_v_exc, __pyx_v_value, __pyx_v_traceback);

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_4__exit__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc, CYTHON_UNUSED PyObject *__pyx_v_value, CYTHON_UNUSED PyObject *__pyx_v_traceback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "minipg/minipg.py":509
 * 
 *     def __exit__(self, exc, value, traceback):
 *         self.close()             # <<<<<<<<<<<<<<
 * 
 *     def _send_message(self, message, data):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->close(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":508
 *         return self
 * 
 *     def __exit__(self, exc, value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */

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

/* "minipg/minipg.py":511
 *         self.close()
 * 
 *     def _send_message(self, message, data):             # <<<<<<<<<<<<<<
 *         self._write(b''.join([message, _bint_to_bytes(len(data) + 4), data, b'H\x00\x00\x00\x04']))
 * 
 */

static void __pyx_f_6minipg_6minipg_10Connection__send_message(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_data) {
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_send_message", 0);

  /* "minipg/minipg.py":512
 * 
 *     def _send_message(self, message, data):
 *         self._write(b''.join([message, _bint_to_bytes(len(data) + 4), data, b'H\x00\x00\x00\x04']))             # <<<<<<<<<<<<<<
 * 
 *     def _process_messages(self, obj):
 */
  if (unlikely(__pyx_v_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(0, 512, __pyx_L1_error)
  }
  __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 512, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_6minipg_6minipg__bint_to_bytes((__pyx_t_1 + 4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_message);
  __Pyx_GIVEREF(__pyx_v_message);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_message);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_v_data);
  __Pyx_INCREF(__pyx_kp_b_H);
  __Pyx_GIVEREF(__pyx_kp_b_H);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_kp_b_H);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBytes_Join(__pyx_kp_b__26, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 512, __pyx_L1_error)
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject*)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":511
 *         self.close()
 * 
 *     def _send_message(self, message, data):             # <<<<<<<<<<<<<<
 *         self._write(b''.join([message, _bint_to_bytes(len(data) + 4), data, b'H\x00\x00\x00\x04']))
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("minipg.minipg.Connection._send_message", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "minipg/minipg.py":514
 *         self._write(b''.join([message, _bint_to_bytes(len(data) + 4), data, b'H\x00\x00\x00\x04']))
 * 
 *     def _process_messages(self, obj):             # <<<<<<<<<<<<<<
 *         errobj = None
 *         while True:
 */

static PyObject *__pyx_f_6minipg_6minipg_10Connection__process_messages(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_obj) {
  int __pyx_v_code;
  int __pyx_v_ln;
  int __pyx_v_precision;
  int __pyx_v_n;
  PyObject *__pyx_v_field = 0;
  int __pyx_v_scale;
  PyObject *__pyx_v_hash1 = 0;
  int __pyx_v_type_code;
  PyObject *__pyx_v_hash2 = 0;
  PyObject *__pyx_v_salt = 0;
  int __pyx_v_size;
  PyObject *__pyx_v_errobj = NULL;
  PyObject *__pyx_v_data = NULL;
  PY_LONG_LONG __pyx_v_auth_method;
  PyObject *__pyx_v_hashlib = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
  PyObject *__pyx_v_command = NULL;
  PY_LONG_LONG __pyx_v_count;
  PyObject *__pyx_v_idx = NULL;
  PY_LONG_LONG __pyx_v_i;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_err = NULL;
  PyObject *__pyx_v_errcode = NULL;
  PyObject *__pyx_v_message = NULL;
  PyObject *__pyx_v_buf = 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;
  long __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *(*__pyx_t_13)(PyObject *);
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  PY_LONG_LONG __pyx_t_17;
  PY_LONG_LONG __pyx_t_18;
  int __pyx_t_19;
  int __pyx_t_20;
  __Pyx_RefNannySetupContext("_process_messages", 0);

  /* "minipg/minipg.py":515
 * 
 *     def _process_messages(self, obj):
 *         errobj = None             # <<<<<<<<<<<<<<
 *         while True:
 *             try:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_errobj = Py_None;

  /* "minipg/minipg.py":516
 *     def _process_messages(self, obj):
 *         errobj = None
 *         while True:             # <<<<<<<<<<<<<<
 *             try:
 *                 code = ord(self._read(1))
 */
  while (1) {

    /* "minipg/minipg.py":517
 *         errobj = None
 *         while True:
 *             try:             # <<<<<<<<<<<<<<
 *                 code = ord(self._read(1))
 *             except OperationalError:
 */
    {
      __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:*/ {

        /* "minipg/minipg.py":518
 *         while True:
 *             try:
 *                 code = ord(self._read(1))             # <<<<<<<<<<<<<<
 *             except OperationalError:
 *                 # something error occured
 */
        __pyx_t_4 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyObject_Ord(__pyx_t_4); if (unlikely(__pyx_t_5 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 518, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_v_code = __pyx_t_5;

        /* "minipg/minipg.py":517
 *         errobj = None
 *         while True:
 *             try:             # <<<<<<<<<<<<<<
 *                 code = ord(self._read(1))
 *             except OperationalError:
 */
      }
      __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_L12_try_end;
      __pyx_L5_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "minipg/minipg.py":519
 *             try:
 *                 code = ord(self._read(1))
 *             except OperationalError:             # <<<<<<<<<<<<<<
 *                 # something error occured
 *                 break
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 519, __pyx_L7_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_6) {
        __Pyx_AddTraceback("minipg.minipg.Connection._process_messages", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 519, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_8);

        /* "minipg/minipg.py":521
 *             except OperationalError:
 *                 # something error occured
 *                 break             # <<<<<<<<<<<<<<
 *             ln = _bytes_to_bint(self._read(4)) - 4
 *             data = self._read(ln)
 */
        goto __pyx_L13_except_break;
        __pyx_L13_except_break:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L10_try_break;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "minipg/minipg.py":517
 *         errobj = None
 *         while True:
 *             try:             # <<<<<<<<<<<<<<
 *                 code = ord(self._read(1))
 *             except OperationalError:
 */
      __Pyx_PyThreadState_assign
      __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_L10_try_break:;
      __Pyx_PyThreadState_assign
      __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_L4_break;
      __pyx_L12_try_end:;
    }

    /* "minipg/minipg.py":522
 *                 # something error occured
 *                 break
 *             ln = _bytes_to_bint(self._read(4)) - 4             # <<<<<<<<<<<<<<
 *             data = self._read(ln)
 *             if DEBUG:
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 522, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_v_ln = (__pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_8)) - 4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "minipg/minipg.py":523
 *                 break
 *             ln = _bytes_to_bint(self._read(4)) - 4
 *             data = self._read(ln)             # <<<<<<<<<<<<<<
 *             if DEBUG:
 *                 DEBUG_OUTPUT("%d\t%i\t%s" % (code, ln, binascii.b2a_hex(data)))
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, __pyx_v_ln); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_XDECREF_SET(__pyx_v_data, ((PyObject*)__pyx_t_8));
    __pyx_t_8 = 0;

    /* "minipg/minipg.py":524
 *             ln = _bytes_to_bint(self._read(4)) - 4
 *             data = self._read(ln)
 *             if DEBUG:             # <<<<<<<<<<<<<<
 *                 DEBUG_OUTPUT("%d\t%i\t%s" % (code, ln, binascii.b2a_hex(data)))
 *             if code == 90:  # ReadyForQuery('Z')
 */
    __pyx_t_9 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":525
 *             data = self._read(ln)
 *             if DEBUG:
 *                 DEBUG_OUTPUT("%d\t%i\t%s" % (code, ln, binascii.b2a_hex(data)))             # <<<<<<<<<<<<<<
 *             if code == 90:  # ReadyForQuery('Z')
 *                 self._ready_for_query = data
 */
      __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_code); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_ln); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_binascii); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_b2a_hex); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_data};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
          PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_data};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 525, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
          __Pyx_INCREF(__pyx_v_data);
          __Pyx_GIVEREF(__pyx_v_data);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_data);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_4);
      __pyx_t_8 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_d_i_s, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_4))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 525, __pyx_L1_error)
      __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(((PyObject*)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "minipg/minipg.py":524
 *             ln = _bytes_to_bint(self._read(4)) - 4
 *             data = self._read(ln)
 *             if DEBUG:             # <<<<<<<<<<<<<<
 *                 DEBUG_OUTPUT("%d\t%i\t%s" % (code, ln, binascii.b2a_hex(data)))
 *             if code == 90:  # ReadyForQuery('Z')
 */
    }

    /* "minipg/minipg.py":526
 *             if DEBUG:
 *                 DEBUG_OUTPUT("%d\t%i\t%s" % (code, ln, binascii.b2a_hex(data)))
 *             if code == 90:  # ReadyForQuery('Z')             # <<<<<<<<<<<<<<
 *                 self._ready_for_query = data
 *                 break
 */
    __pyx_t_9 = ((__pyx_v_code == 90) != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":527
 *                 DEBUG_OUTPUT("%d\t%i\t%s" % (code, ln, binascii.b2a_hex(data)))
 *             if code == 90:  # ReadyForQuery('Z')
 *                 self._ready_for_query = data             # <<<<<<<<<<<<<<
 *                 break
 *             elif code == 82:    # Authenticaton('R')
 */
      __Pyx_INCREF(__pyx_v_data);
      __Pyx_GIVEREF(__pyx_v_data);
      __Pyx_GOTREF(__pyx_v_self->_ready_for_query);
      __Pyx_DECREF(__pyx_v_self->_ready_for_query);
      __pyx_v_self->_ready_for_query = __pyx_v_data;

      /* "minipg/minipg.py":528
 *             if code == 90:  # ReadyForQuery('Z')
 *                 self._ready_for_query = data
 *                 break             # <<<<<<<<<<<<<<
 *             elif code == 82:    # Authenticaton('R')
 *                 auth_method = _bytes_to_bint(data[:4])
 */
      goto __pyx_L4_break;

      /* "minipg/minipg.py":526
 *             if DEBUG:
 *                 DEBUG_OUTPUT("%d\t%i\t%s" % (code, ln, binascii.b2a_hex(data)))
 *             if code == 90:  # ReadyForQuery('Z')             # <<<<<<<<<<<<<<
 *                 self._ready_for_query = data
 *                 break
 */
    }

    /* "minipg/minipg.py":529
 *                 self._ready_for_query = data
 *                 break
 *             elif code == 82:    # Authenticaton('R')             # <<<<<<<<<<<<<<
 *                 auth_method = _bytes_to_bint(data[:4])
 *                 if auth_method == 0:      # trust
 */
    __pyx_t_9 = ((__pyx_v_code == 82) != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":530
 *                 break
 *             elif code == 82:    # Authenticaton('R')
 *                 auth_method = _bytes_to_bint(data[:4])             # <<<<<<<<<<<<<<
 *                 if auth_method == 0:      # trust
 *                     pass
 */
      if (unlikely(__pyx_v_data == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 530, __pyx_L1_error)
      }
      __pyx_t_4 = PySequence_GetSlice(__pyx_v_data, 0, 4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_auth_method = __pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_4));
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "minipg/minipg.py":531
 *             elif code == 82:    # Authenticaton('R')
 *                 auth_method = _bytes_to_bint(data[:4])
 *                 if auth_method == 0:      # trust             # <<<<<<<<<<<<<<
 *                     pass
 *                 elif auth_method == 5:    # md5
 */
      switch (__pyx_v_auth_method) {
        case 0:
        break;

        /* "minipg/minipg.py":533
 *                 if auth_method == 0:      # trust
 *                     pass
 *                 elif auth_method == 5:    # md5             # <<<<<<<<<<<<<<
 *                     import hashlib
 *                     salt = data[4:]
 */
        case 5:

        /* "minipg/minipg.py":534
 *                     pass
 *                 elif auth_method == 5:    # md5
 *                     import hashlib             # <<<<<<<<<<<<<<
 *                     salt = data[4:]
 *                     hash1 = hashlib.md5(self.password.encode('ascii') + self.user.encode("ascii")).hexdigest().encode("ascii")
 */
        __pyx_t_4 = __Pyx_Import(__pyx_n_s_hashlib, 0, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_hashlib, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "minipg/minipg.py":535
 *                 elif auth_method == 5:    # md5
 *                     import hashlib
 *                     salt = data[4:]             # <<<<<<<<<<<<<<
 *                     hash1 = hashlib.md5(self.password.encode('ascii') + self.user.encode("ascii")).hexdigest().encode("ascii")
 *                     hash2 = hashlib.md5(hash1+salt).hexdigest().encode("ascii")
 */
        if (unlikely(__pyx_v_data == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 535, __pyx_L1_error)
        }
        __pyx_t_4 = PySequence_GetSlice(__pyx_v_data, 4, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_salt, ((PyObject*)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "minipg/minipg.py":536
 *                     import hashlib
 *                     salt = data[4:]
 *                     hash1 = hashlib.md5(self.password.encode('ascii') + self.user.encode("ascii")).hexdigest().encode("ascii")             # <<<<<<<<<<<<<<
 *                     hash2 = hashlib.md5(hash1+salt).hexdigest().encode("ascii")
 *                     self._send_message(b'p', b''.join([b'md5', hash2, b'\x00']))
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_hashlib, __pyx_n_s_md5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->password, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->user, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Add(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_GOTREF(__pyx_t_11);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
            __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
            __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          } else
          #endif
          {
            __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
            __Pyx_GIVEREF(__pyx_t_8);
            PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_8);
            __pyx_t_8 = 0;
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 536, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && 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);
          }
        }
        if (__pyx_t_11) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        } else {
          __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 536, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_hash1, ((PyObject*)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "minipg/minipg.py":537
 *                     salt = data[4:]
 *                     hash1 = hashlib.md5(self.password.encode('ascii') + self.user.encode("ascii")).hexdigest().encode("ascii")
 *                     hash2 = hashlib.md5(hash1+salt).hexdigest().encode("ascii")             # <<<<<<<<<<<<<<
 *                     self._send_message(b'p', b''.join([b'md5', hash2, b'\x00']))
 *                 else:
 */
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_hashlib, __pyx_n_s_md5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PyNumber_Add(__pyx_v_hash1, __pyx_v_salt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        if (!__pyx_t_8) {
          __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_GOTREF(__pyx_t_7);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_11)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_12};
            __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
            PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_12};
            __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          } else
          #endif
          {
            __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 537, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
            __Pyx_GIVEREF(__pyx_t_12);
            PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_12);
            __pyx_t_12 = 0;
            __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_11, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
        }
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_encode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 537, __pyx_L1_error)
        __Pyx_XDECREF_SET(__pyx_v_hash2, ((PyObject*)__pyx_t_4));
        __pyx_t_4 = 0;

        /* "minipg/minipg.py":538
 *                     hash1 = hashlib.md5(self.password.encode('ascii') + self.user.encode("ascii")).hexdigest().encode("ascii")
 *                     hash2 = hashlib.md5(hash1+salt).hexdigest().encode("ascii")
 *                     self._send_message(b'p', b''.join([b'md5', hash2, b'\x00']))             # <<<<<<<<<<<<<<
 *                 else:
 *                     errobj = InterfaceError("Authentication method %d not supported." % (auth_method,))
 */
        __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_n_b_md5);
        __Pyx_GIVEREF(__pyx_n_b_md5);
        PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_b_md5);
        __Pyx_INCREF(__pyx_v_hash2);
        __Pyx_GIVEREF(__pyx_v_hash2);
        PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_hash2);
        __Pyx_INCREF(__pyx_kp_b__50);
        __Pyx_GIVEREF(__pyx_kp_b__50);
        PyList_SET_ITEM(__pyx_t_4, 2, __pyx_kp_b__50);
        __pyx_t_11 = __Pyx_PyBytes_Join(__pyx_kp_b__26, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 538, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (!(likely(PyBytes_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_11)->tp_name), 0))) __PYX_ERR(0, 538, __pyx_L1_error)
        ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_send_message(__pyx_v_self, __pyx_n_b_p, ((PyObject*)__pyx_t_11));
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

        /* "minipg/minipg.py":533
 *                 if auth_method == 0:      # trust
 *                     pass
 *                 elif auth_method == 5:    # md5             # <<<<<<<<<<<<<<
 *                     import hashlib
 *                     salt = data[4:]
 */
        break;
        default:

        /* "minipg/minipg.py":540
 *                     self._send_message(b'p', b''.join([b'md5', hash2, b'\x00']))
 *                 else:
 *                     errobj = InterfaceError("Authentication method %d not supported." % (auth_method,))             # <<<<<<<<<<<<<<
 *             elif code == 83:    # ParameterStatus('S')
 *                 k, v, _ = data.split(b'\x00')
 */
        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_auth_method); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 540, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Authentication_method_d_not_supp, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 540, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_4, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 540, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_GOTREF(__pyx_t_11);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_7};
            __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_7};
            __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          } else
          #endif
          {
            __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
            __Pyx_GIVEREF(__pyx_t_7);
            PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_7);
            __pyx_t_7 = 0;
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 540, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF_SET(__pyx_v_errobj, __pyx_t_11);
        __pyx_t_11 = 0;
        break;
      }

      /* "minipg/minipg.py":529
 *                 self._ready_for_query = data
 *                 break
 *             elif code == 82:    # Authenticaton('R')             # <<<<<<<<<<<<<<
 *                 auth_method = _bytes_to_bint(data[:4])
 *                 if auth_method == 0:      # trust
 */
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":541
 *                 else:
 *                     errobj = InterfaceError("Authentication method %d not supported." % (auth_method,))
 *             elif code == 83:    # ParameterStatus('S')             # <<<<<<<<<<<<<<
 *                 k, v, _ = data.split(b'\x00')
 *                 if k == b'server_encoding':
 */
    __pyx_t_9 = ((__pyx_v_code == 83) != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":542
 *                     errobj = InterfaceError("Authentication method %d not supported." % (auth_method,))
 *             elif code == 83:    # ParameterStatus('S')
 *                 k, v, _ = data.split(b'\x00')             # <<<<<<<<<<<<<<
 *                 if k == b'server_encoding':
 *                     self.encoding = v.decode('ascii')
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_split); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        #if !CYTHON_COMPILING_IN_PYPY
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 542, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_11 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 542, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 542, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 542, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 542, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
        index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_11)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        index = 1; __pyx_t_12 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_12)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        index = 2; __pyx_t_7 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L17_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 3) < 0) __PYX_ERR(0, 542, __pyx_L1_error)
        __pyx_t_13 = NULL;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L18_unpacking_done;
        __pyx_L17_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_13 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 542, __pyx_L1_error)
        __pyx_L18_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_12);
      __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "minipg/minipg.py":543
 *             elif code == 83:    # ParameterStatus('S')
 *                 k, v, _ = data.split(b'\x00')
 *                 if k == b'server_encoding':             # <<<<<<<<<<<<<<
 *                     self.encoding = v.decode('ascii')
 *             elif code == 75:    # BackendKeyData('K')
 */
      __pyx_t_9 = (__Pyx_PyBytes_Equals(__pyx_v_k, __pyx_n_b_server_encoding, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 543, __pyx_L1_error)
      if (__pyx_t_9) {

        /* "minipg/minipg.py":544
 *                 k, v, _ = data.split(b'\x00')
 *                 if k == b'server_encoding':
 *                     self.encoding = v.decode('ascii')             # <<<<<<<<<<<<<<
 *             elif code == 75:    # BackendKeyData('K')
 *                 pass
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 544, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 544, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GIVEREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_v_self->encoding);
        __Pyx_DECREF(__pyx_v_self->encoding);
        __pyx_v_self->encoding = __pyx_t_7;
        __pyx_t_7 = 0;

        /* "minipg/minipg.py":543
 *             elif code == 83:    # ParameterStatus('S')
 *                 k, v, _ = data.split(b'\x00')
 *                 if k == b'server_encoding':             # <<<<<<<<<<<<<<
 *                     self.encoding = v.decode('ascii')
 *             elif code == 75:    # BackendKeyData('K')
 */
      }

      /* "minipg/minipg.py":541
 *                 else:
 *                     errobj = InterfaceError("Authentication method %d not supported." % (auth_method,))
 *             elif code == 83:    # ParameterStatus('S')             # <<<<<<<<<<<<<<
 *                 k, v, _ = data.split(b'\x00')
 *                 if k == b'server_encoding':
 */
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":545
 *                 if k == b'server_encoding':
 *                     self.encoding = v.decode('ascii')
 *             elif code == 75:    # BackendKeyData('K')             # <<<<<<<<<<<<<<
 *                 pass
 *             elif code == 67:    # CommandComplete('C')
 */
    __pyx_t_9 = ((__pyx_v_code == 75) != 0);
    if (__pyx_t_9) {
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":547
 *             elif code == 75:    # BackendKeyData('K')
 *                 pass
 *             elif code == 67:    # CommandComplete('C')             # <<<<<<<<<<<<<<
 *                 if not obj:
 *                     continue
 */
    __pyx_t_9 = ((__pyx_v_code == 67) != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":548
 *                 pass
 *             elif code == 67:    # CommandComplete('C')
 *                 if not obj:             # <<<<<<<<<<<<<<
 *                     continue
 *                 command = data[:-1].decode('ascii')
 */
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 548, __pyx_L1_error)
      __pyx_t_14 = ((!__pyx_t_9) != 0);
      if (__pyx_t_14) {

        /* "minipg/minipg.py":549
 *             elif code == 67:    # CommandComplete('C')
 *                 if not obj:
 *                     continue             # <<<<<<<<<<<<<<
 *                 command = data[:-1].decode('ascii')
 *                 if command == 'SHOW':
 */
        goto __pyx_L3_continue;

        /* "minipg/minipg.py":548
 *                 pass
 *             elif code == 67:    # CommandComplete('C')
 *                 if not obj:             # <<<<<<<<<<<<<<
 *                     continue
 *                 command = data[:-1].decode('ascii')
 */
      }

      /* "minipg/minipg.py":550
 *                 if not obj:
 *                     continue
 *                 command = data[:-1].decode('ascii')             # <<<<<<<<<<<<<<
 *                 if command == 'SHOW':
 *                     obj._rowcount = 1
 */
      if (unlikely(__pyx_v_data == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 550, __pyx_L1_error)
      }
      __pyx_t_7 = __Pyx_decode_bytes(__pyx_v_data, 0, -1L, NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_command, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "minipg/minipg.py":551
 *                     continue
 *                 command = data[:-1].decode('ascii')
 *                 if command == 'SHOW':             # <<<<<<<<<<<<<<
 *                     obj._rowcount = 1
 *                 else:
 */
      __pyx_t_14 = (__Pyx_PyString_Equals(__pyx_v_command, __pyx_n_s_SHOW, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 551, __pyx_L1_error)
      if (__pyx_t_14) {

        /* "minipg/minipg.py":552
 *                 command = data[:-1].decode('ascii')
 *                 if command == 'SHOW':
 *                     obj._rowcount = 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     for k in ('SELECT', 'UPDATE', 'DELETE', 'INSERT'):
 */
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_rowcount, __pyx_int_1) < 0) __PYX_ERR(0, 552, __pyx_L1_error)

        /* "minipg/minipg.py":551
 *                     continue
 *                 command = data[:-1].decode('ascii')
 *                 if command == 'SHOW':             # <<<<<<<<<<<<<<
 *                     obj._rowcount = 1
 *                 else:
 */
        goto __pyx_L21;
      }

      /* "minipg/minipg.py":554
 *                     obj._rowcount = 1
 *                 else:
 *                     for k in ('SELECT', 'UPDATE', 'DELETE', 'INSERT'):             # <<<<<<<<<<<<<<
 *                         if command[:len(k)] == k:
 *                             obj._rowcount = int(command.split(' ')[-1])
 */
      /*else*/ {
        __pyx_t_7 = __pyx_tuple__53; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0;
        for (;;) {
          if (__pyx_t_15 >= 4) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_4); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 554, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
          __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "minipg/minipg.py":555
 *                 else:
 *                     for k in ('SELECT', 'UPDATE', 'DELETE', 'INSERT'):
 *                         if command[:len(k)] == k:             # <<<<<<<<<<<<<<
 *                             obj._rowcount = int(command.split(' ')[-1])
 *                             break
 */
          __pyx_t_16 = PyObject_Length(__pyx_v_k); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 555, __pyx_L1_error)
          __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_command, 0, __pyx_t_16, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_12 = PyObject_RichCompare(__pyx_t_4, __pyx_v_k, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 555, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 555, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_14) {

            /* "minipg/minipg.py":556
 *                     for k in ('SELECT', 'UPDATE', 'DELETE', 'INSERT'):
 *                         if command[:len(k)] == k:
 *                             obj._rowcount = int(command.split(' ')[-1])             # <<<<<<<<<<<<<<
 *                             break
 *             elif code == 84:    # RowDescription('T')
 */
            __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_command, __pyx_n_s_split); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 556, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_4, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 556, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_rowcount, __pyx_t_4) < 0) __PYX_ERR(0, 556, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "minipg/minipg.py":557
 *                         if command[:len(k)] == k:
 *                             obj._rowcount = int(command.split(' ')[-1])
 *                             break             # <<<<<<<<<<<<<<
 *             elif code == 84:    # RowDescription('T')
 *                 if not obj:
 */
            goto __pyx_L23_break;

            /* "minipg/minipg.py":555
 *                 else:
 *                     for k in ('SELECT', 'UPDATE', 'DELETE', 'INSERT'):
 *                         if command[:len(k)] == k:             # <<<<<<<<<<<<<<
 *                             obj._rowcount = int(command.split(' ')[-1])
 *                             break
 */
          }

          /* "minipg/minipg.py":554
 *                     obj._rowcount = 1
 *                 else:
 *                     for k in ('SELECT', 'UPDATE', 'DELETE', 'INSERT'):             # <<<<<<<<<<<<<<
 *                         if command[:len(k)] == k:
 *                             obj._rowcount = int(command.split(' ')[-1])
 */
        }
        __pyx_L23_break:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_L21:;

      /* "minipg/minipg.py":547
 *             elif code == 75:    # BackendKeyData('K')
 *                 pass
 *             elif code == 67:    # CommandComplete('C')             # <<<<<<<<<<<<<<
 *                 if not obj:
 *                     continue
 */
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":558
 *                             obj._rowcount = int(command.split(' ')[-1])
 *                             break
 *             elif code == 84:    # RowDescription('T')             # <<<<<<<<<<<<<<
 *                 if not obj:
 *                     continue
 */
    __pyx_t_14 = ((__pyx_v_code == 84) != 0);
    if (__pyx_t_14) {

      /* "minipg/minipg.py":559
 *                             break
 *             elif code == 84:    # RowDescription('T')
 *                 if not obj:             # <<<<<<<<<<<<<<
 *                     continue
 *                 count = _bytes_to_bint(data[0:2])
 */
      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 559, __pyx_L1_error)
      __pyx_t_9 = ((!__pyx_t_14) != 0);
      if (__pyx_t_9) {

        /* "minipg/minipg.py":560
 *             elif code == 84:    # RowDescription('T')
 *                 if not obj:
 *                     continue             # <<<<<<<<<<<<<<
 *                 count = _bytes_to_bint(data[0:2])
 *                 obj.description = [None] * count
 */
        goto __pyx_L3_continue;

        /* "minipg/minipg.py":559
 *                             break
 *             elif code == 84:    # RowDescription('T')
 *                 if not obj:             # <<<<<<<<<<<<<<
 *                     continue
 *                 count = _bytes_to_bint(data[0:2])
 */
      }

      /* "minipg/minipg.py":561
 *                 if not obj:
 *                     continue
 *                 count = _bytes_to_bint(data[0:2])             # <<<<<<<<<<<<<<
 *                 obj.description = [None] * count
 *                 n = 2
 */
      if (unlikely(__pyx_v_data == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 561, __pyx_L1_error)
      }
      __pyx_t_7 = PySequence_GetSlice(__pyx_v_data, 0, 2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_v_count = __pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_7));
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "minipg/minipg.py":562
 *                     continue
 *                 count = _bytes_to_bint(data[0:2])
 *                 obj.description = [None] * count             # <<<<<<<<<<<<<<
 *                 n = 2
 *                 idx = 0
 */
      __pyx_t_7 = PyList_New(1 * ((__pyx_v_count<0) ? 0:__pyx_v_count)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      { Py_ssize_t __pyx_temp;
        for (__pyx_temp=0; __pyx_temp < __pyx_v_count; __pyx_temp++) {
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          PyList_SET_ITEM(__pyx_t_7, __pyx_temp, Py_None);
        }
      }
      if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_description, __pyx_t_7) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "minipg/minipg.py":563
 *                 count = _bytes_to_bint(data[0:2])
 *                 obj.description = [None] * count
 *                 n = 2             # <<<<<<<<<<<<<<
 *                 idx = 0
 *                 for i in range(count):
 */
      __pyx_v_n = 2;

      /* "minipg/minipg.py":564
 *                 obj.description = [None] * count
 *                 n = 2
 *                 idx = 0             # <<<<<<<<<<<<<<
 *                 for i in range(count):
 *                     name = data[n:n+data[n:].find(b'\x00')]
 */
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_int_0);

      /* "minipg/minipg.py":565
 *                 n = 2
 *                 idx = 0
 *                 for i in range(count):             # <<<<<<<<<<<<<<
 *                     name = data[n:n+data[n:].find(b'\x00')]
 *                     n += len(name) + 1
 */
      __pyx_t_17 = __pyx_v_count;
      for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
        __pyx_v_i = __pyx_t_18;

        /* "minipg/minipg.py":566
 *                 idx = 0
 *                 for i in range(count):
 *                     name = data[n:n+data[n:].find(b'\x00')]             # <<<<<<<<<<<<<<
 *                     n += len(name) + 1
 *                     try:
 */
        if (unlikely(__pyx_v_data == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 566, __pyx_L1_error)
        }
        __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (unlikely(__pyx_v_data == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 566, __pyx_L1_error)
        }
        __pyx_t_4 = PySequence_GetSlice(__pyx_v_data, __pyx_v_n, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_find); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyNumber_Add(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PySequence_GetSlice(__pyx_v_data, __pyx_v_n, __pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_12);
        __pyx_t_12 = 0;

        /* "minipg/minipg.py":567
 *                 for i in range(count):
 *                     name = data[n:n+data[n:].find(b'\x00')]
 *                     n += len(name) + 1             # <<<<<<<<<<<<<<
 *                     try:
 *                         name = name.decode(self.encoding)
 */
        __pyx_t_15 = PyObject_Length(__pyx_v_name); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 567, __pyx_L1_error)
        __pyx_v_n = (__pyx_v_n + (__pyx_t_15 + 1));

        /* "minipg/minipg.py":568
 *                     name = data[n:n+data[n:].find(b'\x00')]
 *                     n += len(name) + 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         name = name.decode(self.encoding)
 *                     except UnicodeDecodeError:
 */
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_1);
          /*try:*/ {

            /* "minipg/minipg.py":569
 *                     n += len(name) + 1
 *                     try:
 *                         name = name.decode(self.encoding)             # <<<<<<<<<<<<<<
 *                     except UnicodeDecodeError:
 *                         pass
 */
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L28_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_7 = NULL;
            if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_7)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_7);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            if (!__pyx_t_7) {
              __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->encoding); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 569, __pyx_L28_error)
              __Pyx_GOTREF(__pyx_t_12);
            } else {
              #if CYTHON_FAST_PYCALL
              if (PyFunction_Check(__pyx_t_4)) {
                PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_self->encoding};
                __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 569, __pyx_L28_error)
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_12);
              } else
              #endif
              #if CYTHON_FAST_PYCCALL
              if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
                PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_self->encoding};
                __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 569, __pyx_L28_error)
                __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
                __Pyx_GOTREF(__pyx_t_12);
              } else
              #endif
              {
                __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 569, __pyx_L28_error)
                __Pyx_GOTREF(__pyx_t_11);
                __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
                __Pyx_INCREF(__pyx_v_self->encoding);
                __Pyx_GIVEREF(__pyx_v_self->encoding);
                PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_self->encoding);
                __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 569, __pyx_L28_error)
                __Pyx_GOTREF(__pyx_t_12);
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              }
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_12);
            __pyx_t_12 = 0;

            /* "minipg/minipg.py":568
 *                     name = data[n:n+data[n:].find(b'\x00')]
 *                     n += len(name) + 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         name = name.decode(self.encoding)
 *                     except UnicodeDecodeError:
 */
          }
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L35_try_end;
          __pyx_L28_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "minipg/minipg.py":570
 *                     try:
 *                         name = name.decode(self.encoding)
 *                     except UnicodeDecodeError:             # <<<<<<<<<<<<<<
 *                         pass
 *                     type_code = _bytes_to_bint(data[n+6:n+10])
 */
          __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
          if (__pyx_t_6) {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L29_exception_handled;
          }
          goto __pyx_L30_except_error;
          __pyx_L30_except_error:;

          /* "minipg/minipg.py":568
 *                     name = data[n:n+data[n:].find(b'\x00')]
 *                     n += len(name) + 1
 *                     try:             # <<<<<<<<<<<<<<
 *                         name = name.decode(self.encoding)
 *                     except UnicodeDecodeError:
 */
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_3);
          __Pyx_XGIVEREF(__pyx_t_2);
          __Pyx_XGIVEREF(__pyx_t_1);
          __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
          goto __pyx_L1_error;
          __pyx_L29_exception_handled:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_3);
          __Pyx_XGIVEREF(__pyx_t_2);
          __Pyx_XGIVEREF(__pyx_t_1);
          __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
          __pyx_L35_try_end:;
        }

        /* "minipg/minipg.py":572
 *                     except UnicodeDecodeError:
 *                         pass
 *                     type_code = _bytes_to_bint(data[n+6:n+10])             # <<<<<<<<<<<<<<
 *                     if type_code == PG_TYPE_VARCHAR:
 *                         size = _bytes_to_bint(data[n+12:n+16]) - 4
 */
        if (unlikely(__pyx_v_data == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 572, __pyx_L1_error)
        }
        __pyx_t_12 = PySequence_GetSlice(__pyx_v_data, (__pyx_v_n + 6), (__pyx_v_n + 10)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 572, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_v_type_code = __pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_12));
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "minipg/minipg.py":573
 *                         pass
 *                     type_code = _bytes_to_bint(data[n+6:n+10])
 *                     if type_code == PG_TYPE_VARCHAR:             # <<<<<<<<<<<<<<
 *                         size = _bytes_to_bint(data[n+12:n+16]) - 4
 *                         precision = -1
 */
        __pyx_t_9 = ((__pyx_v_type_code == __pyx_v_6minipg_6minipg_PG_TYPE_VARCHAR) != 0);
        if (__pyx_t_9) {

          /* "minipg/minipg.py":574
 *                     type_code = _bytes_to_bint(data[n+6:n+10])
 *                     if type_code == PG_TYPE_VARCHAR:
 *                         size = _bytes_to_bint(data[n+12:n+16]) - 4             # <<<<<<<<<<<<<<
 *                         precision = -1
 *                         scale = -1
 */
          if (unlikely(__pyx_v_data == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 574, __pyx_L1_error)
          }
          __pyx_t_12 = PySequence_GetSlice(__pyx_v_data, (__pyx_v_n + 12), (__pyx_v_n + 16)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 574, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_v_size = (__pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_12)) - 4);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "minipg/minipg.py":575
 *                     if type_code == PG_TYPE_VARCHAR:
 *                         size = _bytes_to_bint(data[n+12:n+16]) - 4
 *                         precision = -1             # <<<<<<<<<<<<<<
 *                         scale = -1
 *                     elif type_code == PG_TYPE_NUMERIC:
 */
          __pyx_v_precision = -1;

          /* "minipg/minipg.py":576
 *                         size = _bytes_to_bint(data[n+12:n+16]) - 4
 *                         precision = -1
 *                         scale = -1             # <<<<<<<<<<<<<<
 *                     elif type_code == PG_TYPE_NUMERIC:
 *                         size = _bytes_to_bint(data[n+10:n+12])
 */
          __pyx_v_scale = -1;

          /* "minipg/minipg.py":573
 *                         pass
 *                     type_code = _bytes_to_bint(data[n+6:n+10])
 *                     if type_code == PG_TYPE_VARCHAR:             # <<<<<<<<<<<<<<
 *                         size = _bytes_to_bint(data[n+12:n+16]) - 4
 *                         precision = -1
 */
          goto __pyx_L36;
        }

        /* "minipg/minipg.py":577
 *                         precision = -1
 *                         scale = -1
 *                     elif type_code == PG_TYPE_NUMERIC:             # <<<<<<<<<<<<<<
 *                         size = _bytes_to_bint(data[n+10:n+12])
 *                         precision = _bytes_to_bint(data[n+12:n+14])
 */
        __pyx_t_9 = ((__pyx_v_type_code == __pyx_v_6minipg_6minipg_PG_TYPE_NUMERIC) != 0);
        if (__pyx_t_9) {

          /* "minipg/minipg.py":578
 *                         scale = -1
 *                     elif type_code == PG_TYPE_NUMERIC:
 *                         size = _bytes_to_bint(data[n+10:n+12])             # <<<<<<<<<<<<<<
 *                         precision = _bytes_to_bint(data[n+12:n+14])
 *                         scale = precision - _bytes_to_bint(data[n+14:n+16])
 */
          if (unlikely(__pyx_v_data == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 578, __pyx_L1_error)
          }
          __pyx_t_12 = PySequence_GetSlice(__pyx_v_data, (__pyx_v_n + 10), (__pyx_v_n + 12)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 578, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_v_size = __pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_12));
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "minipg/minipg.py":579
 *                     elif type_code == PG_TYPE_NUMERIC:
 *                         size = _bytes_to_bint(data[n+10:n+12])
 *                         precision = _bytes_to_bint(data[n+12:n+14])             # <<<<<<<<<<<<<<
 *                         scale = precision - _bytes_to_bint(data[n+14:n+16])
 *                     else:
 */
          if (unlikely(__pyx_v_data == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 579, __pyx_L1_error)
          }
          __pyx_t_12 = PySequence_GetSlice(__pyx_v_data, (__pyx_v_n + 12), (__pyx_v_n + 14)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 579, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_v_precision = __pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_12));
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "minipg/minipg.py":580
 *                         size = _bytes_to_bint(data[n+10:n+12])
 *                         precision = _bytes_to_bint(data[n+12:n+14])
 *                         scale = precision - _bytes_to_bint(data[n+14:n+16])             # <<<<<<<<<<<<<<
 *                     else:
 *                         size = _bytes_to_bint(data[n+10:n+12])
 */
          if (unlikely(__pyx_v_data == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 580, __pyx_L1_error)
          }
          __pyx_t_12 = PySequence_GetSlice(__pyx_v_data, (__pyx_v_n + 14), (__pyx_v_n + 16)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 580, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_v_scale = (__pyx_v_precision - __pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_12)));
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "minipg/minipg.py":577
 *                         precision = -1
 *                         scale = -1
 *                     elif type_code == PG_TYPE_NUMERIC:             # <<<<<<<<<<<<<<
 *                         size = _bytes_to_bint(data[n+10:n+12])
 *                         precision = _bytes_to_bint(data[n+12:n+14])
 */
          goto __pyx_L36;
        }

        /* "minipg/minipg.py":582
 *                         scale = precision - _bytes_to_bint(data[n+14:n+16])
 *                     else:
 *                         size = _bytes_to_bint(data[n+10:n+12])             # <<<<<<<<<<<<<<
 *                         precision = -1
 *                         scale = -1
 */
        /*else*/ {
          if (unlikely(__pyx_v_data == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 582, __pyx_L1_error)
          }
          __pyx_t_12 = PySequence_GetSlice(__pyx_v_data, (__pyx_v_n + 10), (__pyx_v_n + 12)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 582, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_v_size = __pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_12));
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

          /* "minipg/minipg.py":583
 *                     else:
 *                         size = _bytes_to_bint(data[n+10:n+12])
 *                         precision = -1             # <<<<<<<<<<<<<<
 *                         scale = -1
 * #                        table_oid = _bytes_to_bint(data[n:n+4])
 */
          __pyx_v_precision = -1;

          /* "minipg/minipg.py":584
 *                         size = _bytes_to_bint(data[n+10:n+12])
 *                         precision = -1
 *                         scale = -1             # <<<<<<<<<<<<<<
 * #                        table_oid = _bytes_to_bint(data[n:n+4])
 * #                        table_pos = _bytes_to_bint(data[n+4:n+6])
 */
          __pyx_v_scale = -1;
        }
        __pyx_L36:;

        /* "minipg/minipg.py":590
 * #                        modifier = _bytes_to_bint(data[n+12:n+16])
 * #                        format = _bytes_to_bint(data[n+16:n+18]),
 *                     field = (name, type_code, None, size, precision, scale, None)             # <<<<<<<<<<<<<<
 *                     n += 18
 *                     obj.description[idx] = field
 */
        __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_type_code); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_precision); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_scale); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_name);
        __Pyx_GIVEREF(__pyx_v_name);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_name);
        __Pyx_GIVEREF(__pyx_t_12);
        PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12);
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None);
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_11);
        PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_11);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_7);
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_10, 6, Py_None);
        __pyx_t_12 = 0;
        __pyx_t_4 = 0;
        __pyx_t_11 = 0;
        __pyx_t_7 = 0;
        __Pyx_XDECREF_SET(__pyx_v_field, ((PyObject*)__pyx_t_10));
        __pyx_t_10 = 0;

        /* "minipg/minipg.py":591
 * #                        format = _bytes_to_bint(data[n+16:n+18]),
 *                     field = (name, type_code, None, size, precision, scale, None)
 *                     n += 18             # <<<<<<<<<<<<<<
 *                     obj.description[idx] = field
 *                     idx += 1
 */
        __pyx_v_n = (__pyx_v_n + 18);

        /* "minipg/minipg.py":592
 *                     field = (name, type_code, None, size, precision, scale, None)
 *                     n += 18
 *                     obj.description[idx] = field             # <<<<<<<<<<<<<<
 *                     idx += 1
 *             elif code == 68:    # DataRow('D')
 */
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_description); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (unlikely(PyObject_SetItem(__pyx_t_10, __pyx_v_idx, __pyx_v_field) < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "minipg/minipg.py":593
 *                     n += 18
 *                     obj.description[idx] = field
 *                     idx += 1             # <<<<<<<<<<<<<<
 *             elif code == 68:    # DataRow('D')
 *                 if not obj:
 */
        __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_idx, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 593, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_10);
        __pyx_t_10 = 0;
      }

      /* "minipg/minipg.py":558
 *                             obj._rowcount = int(command.split(' ')[-1])
 *                             break
 *             elif code == 84:    # RowDescription('T')             # <<<<<<<<<<<<<<
 *                 if not obj:
 *                     continue
 */
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":594
 *                     obj.description[idx] = field
 *                     idx += 1
 *             elif code == 68:    # DataRow('D')             # <<<<<<<<<<<<<<
 *                 if not obj:
 *                     continue
 */
    __pyx_t_9 = ((__pyx_v_code == 68) != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":595
 *                     idx += 1
 *             elif code == 68:    # DataRow('D')
 *                 if not obj:             # <<<<<<<<<<<<<<
 *                     continue
 *                 n = 2
 */
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 595, __pyx_L1_error)
      __pyx_t_14 = ((!__pyx_t_9) != 0);
      if (__pyx_t_14) {

        /* "minipg/minipg.py":596
 *             elif code == 68:    # DataRow('D')
 *                 if not obj:
 *                     continue             # <<<<<<<<<<<<<<
 *                 n = 2
 *                 row = []
 */
        goto __pyx_L3_continue;

        /* "minipg/minipg.py":595
 *                     idx += 1
 *             elif code == 68:    # DataRow('D')
 *                 if not obj:             # <<<<<<<<<<<<<<
 *                     continue
 *                 n = 2
 */
      }

      /* "minipg/minipg.py":597
 *                 if not obj:
 *                     continue
 *                 n = 2             # <<<<<<<<<<<<<<
 *                 row = []
 *                 while n < len(data):
 */
      __pyx_v_n = 2;

      /* "minipg/minipg.py":598
 *                     continue
 *                 n = 2
 *                 row = []             # <<<<<<<<<<<<<<
 *                 while n < len(data):
 *                     if data[n:n+4] == b'\xff\xff\xff\xff':
 */
      __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_XDECREF_SET(__pyx_v_row, ((PyObject*)__pyx_t_10));
      __pyx_t_10 = 0;

      /* "minipg/minipg.py":599
 *                 n = 2
 *                 row = []
 *                 while n < len(data):             # <<<<<<<<<<<<<<
 *                     if data[n:n+4] == b'\xff\xff\xff\xff':
 *                         row.append(None)
 */
      while (1) {
        if (unlikely(__pyx_v_data == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
          __PYX_ERR(0, 599, __pyx_L1_error)
        }
        __pyx_t_15 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 599, __pyx_L1_error)
        __pyx_t_14 = ((__pyx_v_n < __pyx_t_15) != 0);
        if (!__pyx_t_14) break;

        /* "minipg/minipg.py":600
 *                 row = []
 *                 while n < len(data):
 *                     if data[n:n+4] == b'\xff\xff\xff\xff':             # <<<<<<<<<<<<<<
 *                         row.append(None)
 *                         n += 4
 */
        if (unlikely(__pyx_v_data == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 600, __pyx_L1_error)
        }
        __pyx_t_10 = PySequence_GetSlice(__pyx_v_data, __pyx_v_n, (__pyx_v_n + 4)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_14 = (__Pyx_PyBytes_Equals(__pyx_t_10, __pyx_kp_b__56, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 600, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_9 = (__pyx_t_14 != 0);
        if (__pyx_t_9) {

          /* "minipg/minipg.py":601
 *                 while n < len(data):
 *                     if data[n:n+4] == b'\xff\xff\xff\xff':
 *                         row.append(None)             # <<<<<<<<<<<<<<
 *                         n += 4
 *                     else:
 */
          __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_row, Py_None); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 601, __pyx_L1_error)

          /* "minipg/minipg.py":602
 *                     if data[n:n+4] == b'\xff\xff\xff\xff':
 *                         row.append(None)
 *                         n += 4             # <<<<<<<<<<<<<<
 *                     else:
 *                         ln = _bytes_to_bint(data[n:n+4])
 */
          __pyx_v_n = (__pyx_v_n + 4);

          /* "minipg/minipg.py":600
 *                 row = []
 *                 while n < len(data):
 *                     if data[n:n+4] == b'\xff\xff\xff\xff':             # <<<<<<<<<<<<<<
 *                         row.append(None)
 *                         n += 4
 */
          goto __pyx_L40;
        }

        /* "minipg/minipg.py":604
 *                         n += 4
 *                     else:
 *                         ln = _bytes_to_bint(data[n:n+4])             # <<<<<<<<<<<<<<
 *                         n += 4
 *                         row.append(data[n:n+ln])
 */
        /*else*/ {
          if (unlikely(__pyx_v_data == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 604, __pyx_L1_error)
          }
          __pyx_t_10 = PySequence_GetSlice(__pyx_v_data, __pyx_v_n, (__pyx_v_n + 4)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 604, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_v_ln = __pyx_f_6minipg_6minipg__bytes_to_bint(((PyObject*)__pyx_t_10));
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "minipg/minipg.py":605
 *                     else:
 *                         ln = _bytes_to_bint(data[n:n+4])
 *                         n += 4             # <<<<<<<<<<<<<<
 *                         row.append(data[n:n+ln])
 *                         n += ln
 */
          __pyx_v_n = (__pyx_v_n + 4);

          /* "minipg/minipg.py":606
 *                         ln = _bytes_to_bint(data[n:n+4])
 *                         n += 4
 *                         row.append(data[n:n+ln])             # <<<<<<<<<<<<<<
 *                         n += ln
 *                 for i in range(len(row)):
 */
          if (unlikely(__pyx_v_data == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 606, __pyx_L1_error)
          }
          __pyx_t_10 = PySequence_GetSlice(__pyx_v_data, __pyx_v_n, (__pyx_v_n + __pyx_v_ln)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_19 = __Pyx_PyList_Append(__pyx_v_row, __pyx_t_10); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 606, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "minipg/minipg.py":607
 *                         n += 4
 *                         row.append(data[n:n+ln])
 *                         n += ln             # <<<<<<<<<<<<<<
 *                 for i in range(len(row)):
 *                     row[i] = _decode_column(row[i], obj.description[i][1], self.encoding, self.tzinfo)
 */
          __pyx_v_n = (__pyx_v_n + __pyx_v_ln);
        }
        __pyx_L40:;
      }

      /* "minipg/minipg.py":608
 *                         row.append(data[n:n+ln])
 *                         n += ln
 *                 for i in range(len(row)):             # <<<<<<<<<<<<<<
 *                     row[i] = _decode_column(row[i], obj.description[i][1], self.encoding, self.tzinfo)
 *                 obj._rows.append(tuple(row))
 */
      __pyx_t_15 = PyList_GET_SIZE(__pyx_v_row); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 608, __pyx_L1_error)
      for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_15; __pyx_t_17+=1) {
        __pyx_v_i = __pyx_t_17;

        /* "minipg/minipg.py":609
 *                         n += ln
 *                 for i in range(len(row)):
 *                     row[i] = _decode_column(row[i], obj.description[i][1], self.encoding, self.tzinfo)             # <<<<<<<<<<<<<<
 *                 obj._rows.append(tuple(row))
 *             elif code == 78:    # NoticeResponse('N')
 */
        __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_row, __pyx_v_i, PY_LONG_LONG, 1, __Pyx_PyInt_From_PY_LONG_LONG, 1, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_description); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_7, __pyx_v_i, PY_LONG_LONG, 1, __Pyx_PyInt_From_PY_LONG_LONG, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __pyx_v_self->encoding;
        __Pyx_INCREF(__pyx_t_7);
        __pyx_t_11 = __pyx_v_self->tzinfo;
        __Pyx_INCREF(__pyx_t_11);
        __pyx_t_4 = __pyx_f_6minipg_6minipg__decode_column(__pyx_t_10, __pyx_t_6, __pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(__Pyx_SetItemInt(__pyx_v_row, __pyx_v_i, __pyx_t_4, PY_LONG_LONG, 1, __Pyx_PyInt_From_PY_LONG_LONG, 1, 1, 1) < 0)) __PYX_ERR(0, 609, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }

      /* "minipg/minipg.py":610
 *                 for i in range(len(row)):
 *                     row[i] = _decode_column(row[i], obj.description[i][1], self.encoding, self.tzinfo)
 *                 obj._rows.append(tuple(row))             # <<<<<<<<<<<<<<
 *             elif code == 78:    # NoticeResponse('N')
 *                 pass
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_rows); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = PyList_AsTuple(__pyx_v_row); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 610, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_19 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_11); if (unlikely(__pyx_t_19 == -1)) __PYX_ERR(0, 610, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

      /* "minipg/minipg.py":594
 *                     obj.description[idx] = field
 *                     idx += 1
 *             elif code == 68:    # DataRow('D')             # <<<<<<<<<<<<<<
 *                 if not obj:
 *                     continue
 */
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":611
 *                     row[i] = _decode_column(row[i], obj.description[i][1], self.encoding, self.tzinfo)
 *                 obj._rows.append(tuple(row))
 *             elif code == 78:    # NoticeResponse('N')             # <<<<<<<<<<<<<<
 *                 pass
 *             elif code == 69 and not errobj:     # ErrorResponse('E')
 */
    __pyx_t_9 = ((__pyx_v_code == 78) != 0);
    if (__pyx_t_9) {
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":613
 *             elif code == 78:    # NoticeResponse('N')
 *                 pass
 *             elif code == 69 and not errobj:     # ErrorResponse('E')             # <<<<<<<<<<<<<<
 *                 err = data.split(b'\x00')
 *                 # http://www.postgresql.org/docs/9.3/static/errcodes-appendix.html
 */
    __pyx_t_14 = ((__pyx_v_code == 69) != 0);
    if (__pyx_t_14) {
    } else {
      __pyx_t_9 = __pyx_t_14;
      goto __pyx_L43_bool_binop_done;
    }
    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_errobj); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 613, __pyx_L1_error)
    __pyx_t_20 = ((!__pyx_t_14) != 0);
    __pyx_t_9 = __pyx_t_20;
    __pyx_L43_bool_binop_done:;
    if (__pyx_t_9) {

      /* "minipg/minipg.py":614
 *                 pass
 *             elif code == 69 and not errobj:     # ErrorResponse('E')
 *                 err = data.split(b'\x00')             # <<<<<<<<<<<<<<
 *                 # http://www.postgresql.org/docs/9.3/static/errcodes-appendix.html
 *                 errcode = err[1][1:]
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_split); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_v_err, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "minipg/minipg.py":616
 *                 err = data.split(b'\x00')
 *                 # http://www.postgresql.org/docs/9.3/static/errcodes-appendix.html
 *                 errcode = err[1][1:]             # <<<<<<<<<<<<<<
 *                 message = errcode + b':' + err[2][1:]
 *                 if not PY2:
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_err, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__58, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_errcode, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "minipg/minipg.py":617
 *                 # http://www.postgresql.org/docs/9.3/static/errcodes-appendix.html
 *                 errcode = err[1][1:]
 *                 message = errcode + b':' + err[2][1:]             # <<<<<<<<<<<<<<
 *                 if not PY2:
 *                     message = message.decode(self.encoding)
 */
      __pyx_t_11 = PyNumber_Add(__pyx_v_errcode, __pyx_kp_b__16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_err, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_slice__59, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_Add(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 617, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_message, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "minipg/minipg.py":618
 *                 errcode = err[1][1:]
 *                 message = errcode + b':' + err[2][1:]
 *                 if not PY2:             # <<<<<<<<<<<<<<
 *                     message = message.decode(self.encoding)
 *                 if errcode[:2] == b'23':
 */
      __pyx_t_9 = ((!(__pyx_v_6minipg_6minipg_PY2 != 0)) != 0);
      if (__pyx_t_9) {

        /* "minipg/minipg.py":619
 *                 message = errcode + b':' + err[2][1:]
 *                 if not PY2:
 *                     message = message.decode(self.encoding)             # <<<<<<<<<<<<<<
 *                 if errcode[:2] == b'23':
 *                     errobj = IntegrityError(message)
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && 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);
          }
        }
        if (!__pyx_t_11) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->encoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_self->encoding};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_self->encoding};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 619, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
            __Pyx_INCREF(__pyx_v_self->encoding);
            __Pyx_GIVEREF(__pyx_v_self->encoding);
            PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_self->encoding);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "minipg/minipg.py":618
 *                 errcode = err[1][1:]
 *                 message = errcode + b':' + err[2][1:]
 *                 if not PY2:             # <<<<<<<<<<<<<<
 *                     message = message.decode(self.encoding)
 *                 if errcode[:2] == b'23':
 */
      }

      /* "minipg/minipg.py":620
 *                 if not PY2:
 *                     message = message.decode(self.encoding)
 *                 if errcode[:2] == b'23':             # <<<<<<<<<<<<<<
 *                     errobj = IntegrityError(message)
 *                 else:
 */
      __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_errcode, 0, 2, NULL, NULL, &__pyx_slice__60, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_kp_b_23, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 620, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_9) {

        /* "minipg/minipg.py":621
 *                     message = message.decode(self.encoding)
 *                 if errcode[:2] == b'23':
 *                     errobj = IntegrityError(message)             # <<<<<<<<<<<<<<
 *                 else:
 *                     errobj = DatabaseError(message)
 */
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_IntegrityError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_10 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_10)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (!__pyx_t_10) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_message};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_message};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 621, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
            __Pyx_INCREF(__pyx_v_message);
            __Pyx_GIVEREF(__pyx_v_message);
            PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_message);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF_SET(__pyx_v_errobj, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "minipg/minipg.py":620
 *                 if not PY2:
 *                     message = message.decode(self.encoding)
 *                 if errcode[:2] == b'23':             # <<<<<<<<<<<<<<
 *                     errobj = IntegrityError(message)
 *                 else:
 */
        goto __pyx_L46;
      }

      /* "minipg/minipg.py":623
 *                     errobj = IntegrityError(message)
 *                 else:
 *                     errobj = DatabaseError(message)             # <<<<<<<<<<<<<<
 *             elif code == 72:    # CopyOutputResponse('H')
 *                 pass
 */
      /*else*/ {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_11 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(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);
          }
        }
        if (!__pyx_t_11) {
          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        } else {
          #if CYTHON_FAST_PYCALL
          if (PyFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_message};
            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          #if CYTHON_FAST_PYCCALL
          if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
            PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_v_message};
            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_GOTREF(__pyx_t_4);
          } else
          #endif
          {
            __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 623, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
            __Pyx_INCREF(__pyx_v_message);
            __Pyx_GIVEREF(__pyx_v_message);
            PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_message);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
        }
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF_SET(__pyx_v_errobj, __pyx_t_4);
        __pyx_t_4 = 0;
      }
      __pyx_L46:;

      /* "minipg/minipg.py":613
 *             elif code == 78:    # NoticeResponse('N')
 *                 pass
 *             elif code == 69 and not errobj:     # ErrorResponse('E')             # <<<<<<<<<<<<<<
 *                 err = data.split(b'\x00')
 *                 # http://www.postgresql.org/docs/9.3/static/errcodes-appendix.html
 */
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":624
 *                 else:
 *                     errobj = DatabaseError(message)
 *             elif code == 72:    # CopyOutputResponse('H')             # <<<<<<<<<<<<<<
 *                 pass
 *             elif code == 100:   # CopyData('d')
 */
    __pyx_t_9 = ((__pyx_v_code == 72) != 0);
    if (__pyx_t_9) {
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":626
 *             elif code == 72:    # CopyOutputResponse('H')
 *                 pass
 *             elif code == 100:   # CopyData('d')             # <<<<<<<<<<<<<<
 *                 obj.write(data)
 *             elif code == 99:    # CopyDataDone('c')
 */
    __pyx_t_9 = ((__pyx_v_code == 0x64) != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":627
 *                 pass
 *             elif code == 100:   # CopyData('d')
 *                 obj.write(data)             # <<<<<<<<<<<<<<
 *             elif code == 99:    # CopyDataDone('c')
 *                 pass
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_write); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 627, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (!__pyx_t_10) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_data};
          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
          PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_v_data};
          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_GOTREF(__pyx_t_4);
        } else
        #endif
        {
          __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 627, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
          __Pyx_INCREF(__pyx_v_data);
          __Pyx_GIVEREF(__pyx_v_data);
          PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_data);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "minipg/minipg.py":626
 *             elif code == 72:    # CopyOutputResponse('H')
 *                 pass
 *             elif code == 100:   # CopyData('d')             # <<<<<<<<<<<<<<
 *                 obj.write(data)
 *             elif code == 99:    # CopyDataDone('c')
 */
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":628
 *             elif code == 100:   # CopyData('d')
 *                 obj.write(data)
 *             elif code == 99:    # CopyDataDone('c')             # <<<<<<<<<<<<<<
 *                 pass
 *             elif code == 71:    # CopyInResponse('G')
 */
    __pyx_t_9 = ((__pyx_v_code == 99) != 0);
    if (__pyx_t_9) {
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":630
 *             elif code == 99:    # CopyDataDone('c')
 *                 pass
 *             elif code == 71:    # CopyInResponse('G')             # <<<<<<<<<<<<<<
 *                 while True:
 *                     buf = obj.read(8192)
 */
    __pyx_t_9 = ((__pyx_v_code == 71) != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":631
 *                 pass
 *             elif code == 71:    # CopyInResponse('G')
 *                 while True:             # <<<<<<<<<<<<<<
 *                     buf = obj.read(8192)
 *                     if not buf:
 */
      while (1) {

        /* "minipg/minipg.py":632
 *             elif code == 71:    # CopyInResponse('G')
 *                 while True:
 *                     buf = obj.read(8192)             # <<<<<<<<<<<<<<
 *                     if not buf:
 *                         break
 */
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_read); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 632, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 632, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF_SET(__pyx_v_buf, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "minipg/minipg.py":633
 *                 while True:
 *                     buf = obj.read(8192)
 *                     if not buf:             # <<<<<<<<<<<<<<
 *                         break
 *                     # send CopyData
 */
        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_buf); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 633, __pyx_L1_error)
        __pyx_t_20 = ((!__pyx_t_9) != 0);
        if (__pyx_t_20) {

          /* "minipg/minipg.py":634
 *                     buf = obj.read(8192)
 *                     if not buf:
 *                         break             # <<<<<<<<<<<<<<
 *                     # send CopyData
 *                     self._write(b'd' + _bint_to_bytes(len(buf) + 4))
 */
          goto __pyx_L48_break;

          /* "minipg/minipg.py":633
 *                 while True:
 *                     buf = obj.read(8192)
 *                     if not buf:             # <<<<<<<<<<<<<<
 *                         break
 *                     # send CopyData
 */
        }

        /* "minipg/minipg.py":636
 *                         break
 *                     # send CopyData
 *                     self._write(b'd' + _bint_to_bytes(len(buf) + 4))             # <<<<<<<<<<<<<<
 *                     self._write(buf)
 *                 # send CopyDone and Sync
 */
        __pyx_t_15 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 636, __pyx_L1_error)
        __pyx_t_7 = __pyx_f_6minipg_6minipg__bint_to_bytes((__pyx_t_15 + 4)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = PyNumber_Add(__pyx_n_b_d, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject*)__pyx_t_4));
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "minipg/minipg.py":637
 *                     # send CopyData
 *                     self._write(b'd' + _bint_to_bytes(len(buf) + 4))
 *                     self._write(buf)             # <<<<<<<<<<<<<<
 *                 # send CopyDone and Sync
 *                 self._write(b'c\x00\x00\x00\x04S\x00\x00\x00\x04')
 */
        if (!(likely(PyBytes_CheckExact(__pyx_v_buf))||((__pyx_v_buf) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_buf)->tp_name), 0))) __PYX_ERR(0, 637, __pyx_L1_error)
        ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject*)__pyx_v_buf));
      }
      __pyx_L48_break:;

      /* "minipg/minipg.py":639
 *                     self._write(buf)
 *                 # send CopyDone and Sync
 *                 self._write(b'c\x00\x00\x00\x04S\x00\x00\x00\x04')             # <<<<<<<<<<<<<<
 *             else:
 *                 pass
 */
      ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_kp_b_c_S);

      /* "minipg/minipg.py":630
 *             elif code == 99:    # CopyDataDone('c')
 *                 pass
 *             elif code == 71:    # CopyInResponse('G')             # <<<<<<<<<<<<<<
 *                 while True:
 *                     buf = obj.read(8192)
 */
      goto __pyx_L16;
    }

    /* "minipg/minipg.py":641
 *                 self._write(b'c\x00\x00\x00\x04S\x00\x00\x00\x04')
 *             else:
 *                 pass             # <<<<<<<<<<<<<<
 *         return errobj
 * 
 */
    /*else*/ {
    }
    __pyx_L16:;
    __pyx_L3_continue:;
  }
  __pyx_L4_break:;

  /* "minipg/minipg.py":642
 *             else:
 *                 pass
 *         return errobj             # <<<<<<<<<<<<<<
 * 
 *     def process_messages(self, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_errobj);
  __pyx_r = __pyx_v_errobj;
  goto __pyx_L0;

  /* "minipg/minipg.py":514
 *         self._write(b''.join([message, _bint_to_bytes(len(data) + 4), data, b'H\x00\x00\x00\x04']))
 * 
 *     def _process_messages(self, obj):             # <<<<<<<<<<<<<<
 *         errobj = None
 *         while True:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("minipg.minipg.Connection._process_messages", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_field);
  __Pyx_XDECREF(__pyx_v_hash1);
  __Pyx_XDECREF(__pyx_v_hash2);
  __Pyx_XDECREF(__pyx_v_salt);
  __Pyx_XDECREF(__pyx_v_errobj);
  __Pyx_XDECREF(__pyx_v_data);
  __Pyx_XDECREF(__pyx_v_hashlib);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v__);
  __Pyx_XDECREF(__pyx_v_command);
  __Pyx_XDECREF(__pyx_v_idx);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_XDECREF(__pyx_v_errcode);
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":644
 *         return errobj
 * 
 *     def process_messages(self, obj):             # <<<<<<<<<<<<<<
 *         err = self._process_messages(obj)
 *         if err:
 */

static void __pyx_f_6minipg_6minipg_10Connection_process_messages(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_err = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("process_messages", 0);

  /* "minipg/minipg.py":645
 * 
 *     def process_messages(self, obj):
 *         err = self._process_messages(obj)             # <<<<<<<<<<<<<<
 *         if err:
 *             raise err
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_process_messages(__pyx_v_self, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_err = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":646
 *     def process_messages(self, obj):
 *         err = self._process_messages(obj)
 *         if err:             # <<<<<<<<<<<<<<
 *             raise err
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_err); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 646, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "minipg/minipg.py":647
 *         err = self._process_messages(obj)
 *         if err:
 *             raise err             # <<<<<<<<<<<<<<
 * 
 *     def _read(self, ln):
 */
    __Pyx_Raise(__pyx_v_err, 0, 0, 0);
    __PYX_ERR(0, 647, __pyx_L1_error)

    /* "minipg/minipg.py":646
 *     def process_messages(self, obj):
 *         err = self._process_messages(obj)
 *         if err:             # <<<<<<<<<<<<<<
 *             raise err
 * 
 */
  }

  /* "minipg/minipg.py":644
 *         return errobj
 * 
 *     def process_messages(self, obj):             # <<<<<<<<<<<<<<
 *         err = self._process_messages(obj)
 *         if err:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("minipg.minipg.Connection.process_messages", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_err);
  __Pyx_RefNannyFinishContext();
}

/* "minipg/minipg.py":649
 *             raise err
 * 
 *     def _read(self, ln):             # <<<<<<<<<<<<<<
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")
 */

static PyObject *__pyx_f_6minipg_6minipg_10Connection__read(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, int __pyx_v_ln) {
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("_read", 0);

  /* "minipg/minipg.py":650
 * 
 *     def _read(self, ln):
 *         if not self.sock:             # <<<<<<<<<<<<<<
 *             raise OperationalError(u"08003:Lost connection")
 *         r = b''
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->sock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":651
 *     def _read(self, ln):
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")             # <<<<<<<<<<<<<<
 *         r = b''
 *         while len(r) < ln:
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_OperationalError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 651, __pyx_L1_error)

    /* "minipg/minipg.py":650
 * 
 *     def _read(self, ln):
 *         if not self.sock:             # <<<<<<<<<<<<<<
 *             raise OperationalError(u"08003:Lost connection")
 *         r = b''
 */
  }

  /* "minipg/minipg.py":652
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")
 *         r = b''             # <<<<<<<<<<<<<<
 *         while len(r) < ln:
 *             b = self.sock.recv(ln-len(r))
 */
  __Pyx_INCREF(__pyx_kp_b__26);
  __pyx_v_r = __pyx_kp_b__26;

  /* "minipg/minipg.py":653
 *             raise OperationalError(u"08003:Lost connection")
 *         r = b''
 *         while len(r) < ln:             # <<<<<<<<<<<<<<
 *             b = self.sock.recv(ln-len(r))
 *             if not b:
 */
  while (1) {
    __pyx_t_5 = PyObject_Length(__pyx_v_r); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 653, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_5 < __pyx_v_ln) != 0);
    if (!__pyx_t_2) break;

    /* "minipg/minipg.py":654
 *         r = b''
 *         while len(r) < ln:
 *             b = self.sock.recv(ln-len(r))             # <<<<<<<<<<<<<<
 *             if not b:
 *                 raise OperationalError(u"08003:Can't recv packets")
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->sock, __pyx_n_s_recv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyObject_Length(__pyx_v_r); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 654, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_ln - __pyx_t_5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 654, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_GIVEREF(__pyx_t_6);
        PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
        __pyx_t_6 = 0;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "minipg/minipg.py":655
 *         while len(r) < ln:
 *             b = self.sock.recv(ln-len(r))
 *             if not b:             # <<<<<<<<<<<<<<
 *                 raise OperationalError(u"08003:Can't recv packets")
 *             r += b
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_b); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 655, __pyx_L1_error)
    __pyx_t_1 = ((!__pyx_t_2) != 0);
    if (__pyx_t_1) {

      /* "minipg/minipg.py":656
 *             b = self.sock.recv(ln-len(r))
 *             if not b:
 *                 raise OperationalError(u"08003:Can't recv packets")             # <<<<<<<<<<<<<<
 *             r += b
 *         return r
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_OperationalError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 656, __pyx_L1_error)

      /* "minipg/minipg.py":655
 *         while len(r) < ln:
 *             b = self.sock.recv(ln-len(r))
 *             if not b:             # <<<<<<<<<<<<<<
 *                 raise OperationalError(u"08003:Can't recv packets")
 *             r += b
 */
    }

    /* "minipg/minipg.py":657
 *             if not b:
 *                 raise OperationalError(u"08003:Can't recv packets")
 *             r += b             # <<<<<<<<<<<<<<
 *         return r
 * 
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_r, __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_r, __pyx_t_3);
    __pyx_t_3 = 0;
  }

  /* "minipg/minipg.py":658
 *                 raise OperationalError(u"08003:Can't recv packets")
 *             r += b
 *         return r             # <<<<<<<<<<<<<<
 * 
 *     def _write(self, b):
 */
  __Pyx_XDECREF(__pyx_r);
  if (!(likely(PyBytes_CheckExact(__pyx_v_r))||((__pyx_v_r) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_r)->tp_name), 0))) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_INCREF(__pyx_v_r);
  __pyx_r = ((PyObject*)__pyx_v_r);
  goto __pyx_L0;

  /* "minipg/minipg.py":649
 *             raise err
 * 
 *     def _read(self, ln):             # <<<<<<<<<<<<<<
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("minipg.minipg.Connection._read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":660
 *         return r
 * 
 *     def _write(self, b):             # <<<<<<<<<<<<<<
 *         if sys.platform == 'cli':
 *             # A workaround for IronPython 2.7.5b2 problem
 */

static void __pyx_f_6minipg_6minipg_10Connection__write(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_b) {
  int __pyx_v_n;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __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;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("_write", 0);
  __Pyx_INCREF(__pyx_v_b);

  /* "minipg/minipg.py":661
 * 
 *     def _write(self, b):
 *         if sys.platform == 'cli':             # <<<<<<<<<<<<<<
 *             # A workaround for IronPython 2.7.5b2 problem
 *             b = str(b)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_cli, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "minipg/minipg.py":663
 *         if sys.platform == 'cli':
 *             # A workaround for IronPython 2.7.5b2 problem
 *             b = str(b)             # <<<<<<<<<<<<<<
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_b);
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 663, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_b, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":661
 * 
 *     def _write(self, b):
 *         if sys.platform == 'cli':             # <<<<<<<<<<<<<<
 *             # A workaround for IronPython 2.7.5b2 problem
 *             b = str(b)
 */
  }

  /* "minipg/minipg.py":664
 *             # A workaround for IronPython 2.7.5b2 problem
 *             b = str(b)
 *         if not self.sock:             # <<<<<<<<<<<<<<
 *             raise OperationalError(u"08003:Lost connection")
 *         n = 0
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_self->sock); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 664, __pyx_L1_error)
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "minipg/minipg.py":665
 *             b = str(b)
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")             # <<<<<<<<<<<<<<
 *         n = 0
 *         while (n < len(b)):
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_OperationalError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 665, __pyx_L1_error)

    /* "minipg/minipg.py":664
 *             # A workaround for IronPython 2.7.5b2 problem
 *             b = str(b)
 *         if not self.sock:             # <<<<<<<<<<<<<<
 *             raise OperationalError(u"08003:Lost connection")
 *         n = 0
 */
  }

  /* "minipg/minipg.py":666
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")
 *         n = 0             # <<<<<<<<<<<<<<
 *         while (n < len(b)):
 *             n += self.sock.send(b[n:])
 */
  __pyx_v_n = 0;

  /* "minipg/minipg.py":667
 *             raise OperationalError(u"08003:Lost connection")
 *         n = 0
 *         while (n < len(b)):             # <<<<<<<<<<<<<<
 *             n += self.sock.send(b[n:])
 * 
 */
  while (1) {
    if (unlikely(__pyx_v_b == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 667, __pyx_L1_error)
    }
    __pyx_t_5 = PyBytes_GET_SIZE(__pyx_v_b); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 667, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_v_n < __pyx_t_5) != 0);
    if (!__pyx_t_4) break;

    /* "minipg/minipg.py":668
 *         n = 0
 *         while (n < len(b)):
 *             n += self.sock.send(b[n:])             # <<<<<<<<<<<<<<
 * 
 *     def _open(self):
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->sock, __pyx_n_s_send); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (unlikely(__pyx_v_b == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 668, __pyx_L1_error)
    }
    __pyx_t_7 = PySequence_GetSlice(__pyx_v_b, __pyx_v_n, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_n = __pyx_t_10;
  }

  /* "minipg/minipg.py":660
 *         return r
 * 
 *     def _write(self, b):             # <<<<<<<<<<<<<<
 *         if sys.platform == 'cli':
 *             # A workaround for IronPython 2.7.5b2 problem
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("minipg.minipg.Connection._write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_RefNannyFinishContext();
}

/* "minipg/minipg.py":670
 *             n += self.sock.send(b[n:])
 * 
 *     def _open(self):             # <<<<<<<<<<<<<<
 *         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         self.sock.connect((self.host, self.port))
 */

static void __pyx_f_6minipg_6minipg_10Connection__open(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_v_v = 0;
  PyObject *__pyx_v_ssl = 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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "minipg/minipg.py":671
 * 
 *     def _open(self):
 *         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)             # <<<<<<<<<<<<<<
 *         self.sock.connect((self.host, self.port))
 *         if DEBUG:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_AF_INET); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_SOCK_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && 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_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->sock);
  __Pyx_DECREF(__pyx_v_self->sock);
  __pyx_v_self->sock = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":672
 *     def _open(self):
 *         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         self.sock.connect((self.host, self.port))             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT("socket %s:%d" % (self.host, self.port))
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->sock, __pyx_n_s_connect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 672, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_self->host);
  __Pyx_GIVEREF(__pyx_v_self->host);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->host);
  __Pyx_INCREF(__pyx_v_self->port);
  __Pyx_GIVEREF(__pyx_v_self->port);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_self->port);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 672, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":673
 *         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         self.sock.connect((self.host, self.port))
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT("socket %s:%d" % (self.host, self.port))
 *         if self.use_ssl:
 */
  __pyx_t_8 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
  if (__pyx_t_8) {

    /* "minipg/minipg.py":674
 *         self.sock.connect((self.host, self.port))
 *         if DEBUG:
 *             DEBUG_OUTPUT("socket %s:%d" % (self.host, self.port))             # <<<<<<<<<<<<<<
 *         if self.use_ssl:
 *             import ssl
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_self->host);
    __Pyx_GIVEREF(__pyx_v_self->host);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->host);
    __Pyx_INCREF(__pyx_v_self->port);
    __Pyx_GIVEREF(__pyx_v_self->port);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->port);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_socket_s_d, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 674, __pyx_L1_error)
    __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(((PyObject*)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "minipg/minipg.py":673
 *         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         self.sock.connect((self.host, self.port))
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT("socket %s:%d" % (self.host, self.port))
 *         if self.use_ssl:
 */
  }

  /* "minipg/minipg.py":675
 *         if DEBUG:
 *             DEBUG_OUTPUT("socket %s:%d" % (self.host, self.port))
 *         if self.use_ssl:             # <<<<<<<<<<<<<<
 *             import ssl
 *             self._write(_bint_to_bytes(8))
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->use_ssl); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 675, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "minipg/minipg.py":676
 *             DEBUG_OUTPUT("socket %s:%d" % (self.host, self.port))
 *         if self.use_ssl:
 *             import ssl             # <<<<<<<<<<<<<<
 *             self._write(_bint_to_bytes(8))
 *             self._write(_bint_to_bytes(80877103))    # SSL request
 */
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_ssl, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_v_ssl = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "minipg/minipg.py":677
 *         if self.use_ssl:
 *             import ssl
 *             self._write(_bint_to_bytes(8))             # <<<<<<<<<<<<<<
 *             self._write(_bint_to_bytes(80877103))    # SSL request
 *             if self._read(1) == b'S':
 */
    __pyx_t_3 = __pyx_f_6minipg_6minipg__bint_to_bytes(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject*)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "minipg/minipg.py":678
 *             import ssl
 *             self._write(_bint_to_bytes(8))
 *             self._write(_bint_to_bytes(80877103))    # SSL request             # <<<<<<<<<<<<<<
 *             if self._read(1) == b'S':
 *                 self.sock = ssl.wrap_socket(self.sock)
 */
    __pyx_t_3 = __pyx_f_6minipg_6minipg__bint_to_bytes(0x4D2162F); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject*)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "minipg/minipg.py":679
 *             self._write(_bint_to_bytes(8))
 *             self._write(_bint_to_bytes(80877103))    # SSL request
 *             if self._read(1) == b'S':             # <<<<<<<<<<<<<<
 *                 self.sock = ssl.wrap_socket(self.sock)
 *             else:
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_read(__pyx_v_self, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = (__Pyx_PyBytes_Equals(__pyx_t_3, __pyx_n_b_S, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = (__pyx_t_8 != 0);
    if (__pyx_t_9) {

      /* "minipg/minipg.py":680
 *             self._write(_bint_to_bytes(80877103))    # SSL request
 *             if self._read(1) == b'S':
 *                 self.sock = ssl.wrap_socket(self.sock)             # <<<<<<<<<<<<<<
 *             else:
 *                 raise InterfaceError("Server refuses SSL")
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ssl, __pyx_n_s_wrap_socket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_self->sock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->sock};
          __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->sock};
          __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_3);
        } else
        #endif
        {
          __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_self->sock);
          __Pyx_GIVEREF(__pyx_v_self->sock);
          PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_self->sock);
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 680, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->sock);
      __Pyx_DECREF(__pyx_v_self->sock);
      __pyx_v_self->sock = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "minipg/minipg.py":679
 *             self._write(_bint_to_bytes(8))
 *             self._write(_bint_to_bytes(80877103))    # SSL request
 *             if self._read(1) == b'S':             # <<<<<<<<<<<<<<
 *                 self.sock = ssl.wrap_socket(self.sock)
 *             else:
 */
      goto __pyx_L5;
    }

    /* "minipg/minipg.py":682
 *                 self.sock = ssl.wrap_socket(self.sock)
 *             else:
 *                 raise InterfaceError("Server refuses SSL")             # <<<<<<<<<<<<<<
 *         if self.timeout is not None:
 *             self.sock.settimeout(float(self.timeout))
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __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, 682, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "minipg/minipg.py":675
 *         if DEBUG:
 *             DEBUG_OUTPUT("socket %s:%d" % (self.host, self.port))
 *         if self.use_ssl:             # <<<<<<<<<<<<<<
 *             import ssl
 *             self._write(_bint_to_bytes(8))
 */
  }

  /* "minipg/minipg.py":683
 *             else:
 *                 raise InterfaceError("Server refuses SSL")
 *         if self.timeout is not None:             # <<<<<<<<<<<<<<
 *             self.sock.settimeout(float(self.timeout))
 *         # protocol version 3.0
 */
  __pyx_t_9 = (__pyx_v_self->timeout != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "minipg/minipg.py":684
 *                 raise InterfaceError("Server refuses SSL")
 *         if self.timeout is not None:
 *             self.sock.settimeout(float(self.timeout))             # <<<<<<<<<<<<<<
 *         # protocol version 3.0
 *         v = b'\x00\x03\x00\x00'
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->sock, __pyx_n_s_settimeout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyNumber_Float(__pyx_v_self->timeout); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "minipg/minipg.py":683
 *             else:
 *                 raise InterfaceError("Server refuses SSL")
 *         if self.timeout is not None:             # <<<<<<<<<<<<<<
 *             self.sock.settimeout(float(self.timeout))
 *         # protocol version 3.0
 */
  }

  /* "minipg/minipg.py":686
 *             self.sock.settimeout(float(self.timeout))
 *         # protocol version 3.0
 *         v = b'\x00\x03\x00\x00'             # <<<<<<<<<<<<<<
 *         v += b'user\x00' + self.user.encode('ascii') + b'\x00'
 *         if self.database:
 */
  __Pyx_INCREF(__pyx_kp_b__66);
  __pyx_v_v = __pyx_kp_b__66;

  /* "minipg/minipg.py":687
 *         # protocol version 3.0
 *         v = b'\x00\x03\x00\x00'
 *         v += b'user\x00' + self.user.encode('ascii') + b'\x00'             # <<<<<<<<<<<<<<
 *         if self.database:
 *             v += b'database\x00' + self.database.encode('ascii') + b'\x00'
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->user, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_kp_b_user_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_b__50); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_v, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_v, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":688
 *         v = b'\x00\x03\x00\x00'
 *         v += b'user\x00' + self.user.encode('ascii') + b'\x00'
 *         if self.database:             # <<<<<<<<<<<<<<
 *             v += b'database\x00' + self.database.encode('ascii') + b'\x00'
 *         v += b'\x00'
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->database); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 688, __pyx_L1_error)
  if (__pyx_t_8) {

    /* "minipg/minipg.py":689
 *         v += b'user\x00' + self.user.encode('ascii') + b'\x00'
 *         if self.database:
 *             v += b'database\x00' + self.database.encode('ascii') + b'\x00'             # <<<<<<<<<<<<<<
 *         v += b'\x00'
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->database, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_kp_b_database_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_b__50); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_v, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 689, __pyx_L1_error)
    __Pyx_DECREF_SET(__pyx_v_v, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":688
 *         v = b'\x00\x03\x00\x00'
 *         v += b'user\x00' + self.user.encode('ascii') + b'\x00'
 *         if self.database:             # <<<<<<<<<<<<<<
 *             v += b'database\x00' + self.database.encode('ascii') + b'\x00'
 *         v += b'\x00'
 */
  }

  /* "minipg/minipg.py":690
 *         if self.database:
 *             v += b'database\x00' + self.database.encode('ascii') + b'\x00'
 *         v += b'\x00'             # <<<<<<<<<<<<<<
 * 
 *         self._write(_bint_to_bytes(len(v) + 4) + v)
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_v, __pyx_kp_b__50); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_v, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":692
 *         v += b'\x00'
 * 
 *         self._write(_bint_to_bytes(len(v) + 4) + v)             # <<<<<<<<<<<<<<
 *         self.process_messages(None)
 * 
 */
  __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_v); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 692, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_6minipg_6minipg__bint_to_bytes((__pyx_t_10 + 4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_v); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, ((PyObject*)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "minipg/minipg.py":693
 * 
 *         self._write(_bint_to_bytes(len(v) + 4) + v)
 *         self.process_messages(None)             # <<<<<<<<<<<<<<
 * 
 *     def escape_parameter(self, v):
 */
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->process_messages(__pyx_v_self, Py_None); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L1_error)

  /* "minipg/minipg.py":670
 *             n += self.sock.send(b[n:])
 * 
 *     def _open(self):             # <<<<<<<<<<<<<<
 *         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 *         self.sock.connect((self.host, self.port))
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("minipg.minipg.Connection._open", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_ssl);
  __Pyx_RefNannyFinishContext();
}

/* "minipg/minipg.py":695
 *         self.process_messages(None)
 * 
 *     def escape_parameter(self, v):             # <<<<<<<<<<<<<<
 *         t = type(v)
 *         func = self.encoders.get(t)
 */

static PyObject *__pyx_pw_6minipg_6minipg_10Connection_7escape_parameter(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_escape_parameter(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_v, int __pyx_skip_dispatch) {
  PyTypeObject *__pyx_v_t = 0;
  PyObject *__pyx_v_func = NULL;
  PyObject *__pyx_v_c = NULL;
  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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  long __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("escape_parameter", 0);
  __Pyx_INCREF(__pyx_v_v);
  /* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_escape_parameter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_7escape_parameter)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_v); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_v};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_v};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_v);
          __Pyx_GIVEREF(__pyx_v_v);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_v);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "minipg/minipg.py":696
 * 
 *     def escape_parameter(self, v):
 *         t = type(v)             # <<<<<<<<<<<<<<
 *         func = self.encoders.get(t)
 *         if func:
 */
  __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_v)));
  __pyx_v_t = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_v)));

  /* "minipg/minipg.py":697
 *     def escape_parameter(self, v):
 *         t = type(v)
 *         func = self.encoders.get(t)             # <<<<<<<<<<<<<<
 *         if func:
 *             return func(self, v)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->encoders, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_t)};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_t)};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_t));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_t));
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_t));
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":698
 *         t = type(v)
 *         func = self.encoders.get(t)
 *         if func:             # <<<<<<<<<<<<<<
 *             return func(self, v)
 *         if v is None:
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_func); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 698, __pyx_L1_error)
  if (__pyx_t_6) {

    /* "minipg/minipg.py":699
 *         func = self.encoders.get(t)
 *         if func:
 *             return func(self, v)             # <<<<<<<<<<<<<<
 *         if v is None:
 *             return 'NULL'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_func);
    __pyx_t_2 = __pyx_v_func; __pyx_t_5 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_v};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_v};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
      __Pyx_INCREF(__pyx_v_v);
      __Pyx_GIVEREF(__pyx_v_v);
      PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_v);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":698
 *         t = type(v)
 *         func = self.encoders.get(t)
 *         if func:             # <<<<<<<<<<<<<<
 *             return func(self, v)
 *         if v is None:
 */
  }

  /* "minipg/minipg.py":700
 *         if func:
 *             return func(self, v)
 *         if v is None:             # <<<<<<<<<<<<<<
 *             return 'NULL'
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string
 */
  __pyx_t_6 = (__pyx_v_v == Py_None);
  __pyx_t_8 = (__pyx_t_6 != 0);
  if (__pyx_t_8) {

    /* "minipg/minipg.py":701
 *             return func(self, v)
 *         if v is None:
 *             return 'NULL'             # <<<<<<<<<<<<<<
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string
 *             return u"'" + v.replace(u"'", u"''") + u"'"
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_NULL);
    __pyx_r = __pyx_n_s_NULL;
    goto __pyx_L0;

    /* "minipg/minipg.py":700
 *         if func:
 *             return func(self, v)
 *         if v is None:             # <<<<<<<<<<<<<<
 *             return 'NULL'
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string
 */
  }

  /* "minipg/minipg.py":702
 *         if v is None:
 *             return 'NULL'
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string             # <<<<<<<<<<<<<<
 *             return u"'" + v.replace(u"'", u"''") + u"'"
 *         elif PY2 and t == str:    # PY2 str
 */
  __pyx_t_6 = (__pyx_v_6minipg_6minipg_PY2 != 0);
  if (!__pyx_t_6) {
    goto __pyx_L6_next_or;
  } else {
  }
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyUnicode_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_L6_next_or:;
  __pyx_t_6 = ((!(__pyx_v_6minipg_6minipg_PY2 != 0)) != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __pyx_t_6;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":703
 *             return 'NULL'
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string
 *             return u"'" + v.replace(u"'", u"''") + u"'"             # <<<<<<<<<<<<<<
 *         elif PY2 and t == str:    # PY2 str
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_kp_u__69, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_u__69); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __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;

    /* "minipg/minipg.py":702
 *         if v is None:
 *             return 'NULL'
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string             # <<<<<<<<<<<<<<
 *             return u"'" + v.replace(u"'", u"''") + u"'"
 *         elif PY2 and t == str:    # PY2 str
 */
  }

  /* "minipg/minipg.py":704
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string
 *             return u"'" + v.replace(u"'", u"''") + u"'"
 *         elif PY2 and t == str:    # PY2 str             # <<<<<<<<<<<<<<
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])
 *             return "'" + v.replace("'", "''") + "'"
 */
  __pyx_t_6 = (__pyx_v_6minipg_6minipg_PY2 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_t_6;
    goto __pyx_L9_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __pyx_t_6;
  __pyx_L9_bool_binop_done:;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":705
 *             return u"'" + v.replace(u"'", u"''") + u"'"
 *         elif PY2 and t == str:    # PY2 str
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])             # <<<<<<<<<<<<<<
 *             return "'" + v.replace("'", "''") + "'"
 *         elif t == bytearray or t == bytes:        # binary
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_v_v)) || PyTuple_CheckExact(__pyx_v_v)) {
      __pyx_t_1 = __pyx_v_v; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 705, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 705, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 705, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_10(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 705, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_v_c); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 705, __pyx_L1_error)
      __pyx_t_6 = ((__pyx_t_11 < 32) != 0);
      if (!__pyx_t_6) {
      } else {
        __pyx_t_8 = __pyx_t_6;
        goto __pyx_L13_bool_binop_done;
      }
      __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_v_c); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 705, __pyx_L1_error)
      __pyx_t_6 = ((__pyx_t_11 > 0x7F) != 0);
      __pyx_t_8 = __pyx_t_6;
      __pyx_L13_bool_binop_done:;
      if (__pyx_t_8) {
        __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_v_c); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 705, __pyx_L1_error)
        __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_03o, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_3 = __pyx_t_5;
        __pyx_t_5 = 0;
      } else {
        __Pyx_INCREF(__pyx_v_c);
        __pyx_t_3 = __pyx_v_c;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 705, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__26, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "minipg/minipg.py":706
 *         elif PY2 and t == str:    # PY2 str
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])
 *             return "'" + v.replace("'", "''") + "'"             # <<<<<<<<<<<<<<
 *         elif t == bytearray or t == bytes:        # binary
 *             return "'" + ''.join(['\\%03o' % (c, ) for c in v]) + "'::bytea"
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_kp_s__69, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__69); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 706, __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;

    /* "minipg/minipg.py":704
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string
 *             return u"'" + v.replace(u"'", u"''") + u"'"
 *         elif PY2 and t == str:    # PY2 str             # <<<<<<<<<<<<<<
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])
 *             return "'" + v.replace("'", "''") + "'"
 */
  }

  /* "minipg/minipg.py":707
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])
 *             return "'" + v.replace("'", "''") + "'"
 *         elif t == bytearray or t == bytes:        # binary             # <<<<<<<<<<<<<<
 *             return "'" + ''.join(['\\%03o' % (c, ) for c in v]) + "'::bytea"
 *         elif t == bool:
 */
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyByteArray_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_t_6;
    goto __pyx_L15_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyBytes_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 707, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __pyx_t_6;
  __pyx_L15_bool_binop_done:;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":708
 *             return "'" + v.replace("'", "''") + "'"
 *         elif t == bytearray or t == bytes:        # binary
 *             return "'" + ''.join(['\\%03o' % (c, ) for c in v]) + "'::bytea"             # <<<<<<<<<<<<<<
 *         elif t == bool:
 *             return u"TRUE" if v else u"FALSE"
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_v_v)) || PyTuple_CheckExact(__pyx_v_v)) {
      __pyx_t_1 = __pyx_v_v; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_v); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 708, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 708, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_10(__pyx_t_1);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 708, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_c);
      __Pyx_GIVEREF(__pyx_v_c);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_c);
      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_03o, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 708, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__26, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s__69, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_bytea); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __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;

    /* "minipg/minipg.py":707
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])
 *             return "'" + v.replace("'", "''") + "'"
 *         elif t == bytearray or t == bytes:        # binary             # <<<<<<<<<<<<<<
 *             return "'" + ''.join(['\\%03o' % (c, ) for c in v]) + "'::bytea"
 *         elif t == bool:
 */
  }

  /* "minipg/minipg.py":709
 *         elif t == bytearray or t == bytes:        # binary
 *             return "'" + ''.join(['\\%03o' % (c, ) for c in v]) + "'::bytea"
 *         elif t == bool:             # <<<<<<<<<<<<<<
 *             return u"TRUE" if v else u"FALSE"
 *         elif t == time.struct_time:
 */
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject*)&PyBool_Type), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error)
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":710
 *             return "'" + ''.join(['\\%03o' % (c, ) for c in v]) + "'::bytea"
 *         elif t == bool:
 *             return u"TRUE" if v else u"FALSE"             # <<<<<<<<<<<<<<
 *         elif t == time.struct_time:
 *             return u'%04d-%02d-%02d %02d:%02d:%02d' % (
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_v); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 710, __pyx_L1_error)
    if (__pyx_t_8) {
      __Pyx_INCREF(__pyx_n_u_TRUE);
      __pyx_t_1 = __pyx_n_u_TRUE;
    } else {
      __Pyx_INCREF(__pyx_n_u_FALSE);
      __pyx_t_1 = __pyx_n_u_FALSE;
    }
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":709
 *         elif t == bytearray or t == bytes:        # binary
 *             return "'" + ''.join(['\\%03o' % (c, ) for c in v]) + "'::bytea"
 *         elif t == bool:             # <<<<<<<<<<<<<<
 *             return u"TRUE" if v else u"FALSE"
 *         elif t == time.struct_time:
 */
  }

  /* "minipg/minipg.py":711
 *         elif t == bool:
 *             return u"TRUE" if v else u"FALSE"
 *         elif t == time.struct_time:             # <<<<<<<<<<<<<<
 *             return u'%04d-%02d-%02d %02d:%02d:%02d' % (
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_struct_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_t), __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":712
 *             return u"TRUE" if v else u"FALSE"
 *         elif t == time.struct_time:
 *             return u'%04d-%02d-%02d %02d:%02d:%02d' % (             # <<<<<<<<<<<<<<
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)
 *         elif t == datetime.datetime:
 */
    __Pyx_XDECREF(__pyx_r);

    /* "minipg/minipg.py":713
 *         elif t == time.struct_time:
 *             return u'%04d-%02d-%02d %02d:%02d:%02d' % (
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)             # <<<<<<<<<<<<<<
 *         elif t == datetime.datetime:
 *             if v.tzinfo:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_tm_year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_tm_mon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_tm_mday); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_tm_hour); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_tm_min); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_tm_sec); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = PyTuple_New(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 713, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_12);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_5 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_12 = 0;

    /* "minipg/minipg.py":712
 *             return u"TRUE" if v else u"FALSE"
 *         elif t == time.struct_time:
 *             return u'%04d-%02d-%02d %02d:%02d:%02d' % (             # <<<<<<<<<<<<<<
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)
 *         elif t == datetime.datetime:
 */
    __pyx_t_12 = PyUnicode_Format(__pyx_kp_u_04d_02d_02d_02d_02d_02d, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_r = __pyx_t_12;
    __pyx_t_12 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":711
 *         elif t == bool:
 *             return u"TRUE" if v else u"FALSE"
 *         elif t == time.struct_time:             # <<<<<<<<<<<<<<
 *             return u'%04d-%02d-%02d %02d:%02d:%02d' % (
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)
 */
  }

  /* "minipg/minipg.py":714
 *             return u'%04d-%02d-%02d %02d:%02d:%02d' % (
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)
 *         elif t == datetime.datetime:             # <<<<<<<<<<<<<<
 *             if v.tzinfo:
 *                 return "timestamp with time zone '" + v.isoformat() + "'"
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_t), __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":715
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)
 *         elif t == datetime.datetime:
 *             if v.tzinfo:             # <<<<<<<<<<<<<<
 *                 return "timestamp with time zone '" + v.isoformat() + "'"
 *             else:
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 715, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 715, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (__pyx_t_8) {

      /* "minipg/minipg.py":716
 *         elif t == datetime.datetime:
 *             if v.tzinfo:
 *                 return "timestamp with time zone '" + v.isoformat() + "'"             # <<<<<<<<<<<<<<
 *             else:
 *                 return "timestamp '" + v.isoformat() + "'"
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_isoformat); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 716, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 716, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyNumber_Add(__pyx_kp_s_timestamp_with_time_zone, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_kp_s__69); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_r = __pyx_t_12;
      __pyx_t_12 = 0;
      goto __pyx_L0;

      /* "minipg/minipg.py":715
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)
 *         elif t == datetime.datetime:
 *             if v.tzinfo:             # <<<<<<<<<<<<<<
 *                 return "timestamp with time zone '" + v.isoformat() + "'"
 *             else:
 */
    }

    /* "minipg/minipg.py":718
 *                 return "timestamp with time zone '" + v.isoformat() + "'"
 *             else:
 *                 return "timestamp '" + v.isoformat() + "'"             # <<<<<<<<<<<<<<
 *         elif t == datetime.date:
 *             return "date '" + str(v) + "'"
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_isoformat); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 718, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_12 = __Pyx_PyObject_CallNoArg(__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 718, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = PyNumber_Add(__pyx_kp_s_timestamp, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_kp_s__69); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_r = __pyx_t_12;
      __pyx_t_12 = 0;
      goto __pyx_L0;
    }

    /* "minipg/minipg.py":714
 *             return u'%04d-%02d-%02d %02d:%02d:%02d' % (
 *                 v.tm_year, v.tm_mon, v.tm_mday, v.tm_hour, v.tm_min, v.tm_sec)
 *         elif t == datetime.datetime:             # <<<<<<<<<<<<<<
 *             if v.tzinfo:
 *                 return "timestamp with time zone '" + v.isoformat() + "'"
 */
  }

  /* "minipg/minipg.py":719
 *             else:
 *                 return "timestamp '" + v.isoformat() + "'"
 *         elif t == datetime.date:             # <<<<<<<<<<<<<<
 *             return "date '" + str(v) + "'"
 *         elif t == datetime.timedelta:
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_date); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_t), __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":720
 *                 return "timestamp '" + v.isoformat() + "'"
 *         elif t == datetime.date:
 *             return "date '" + str(v) + "'"             # <<<<<<<<<<<<<<
 *         elif t == datetime.timedelta:
 *             return u"interval '" + str(v) + "'"
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_v);
    __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_kp_s_date_2, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_t_12, __pyx_kp_s__69); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_r = __pyx_t_13;
    __pyx_t_13 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":719
 *             else:
 *                 return "timestamp '" + v.isoformat() + "'"
 *         elif t == datetime.date:             # <<<<<<<<<<<<<<
 *             return "date '" + str(v) + "'"
 *         elif t == datetime.timedelta:
 */
  }

  /* "minipg/minipg.py":721
 *         elif t == datetime.date:
 *             return "date '" + str(v) + "'"
 *         elif t == datetime.timedelta:             # <<<<<<<<<<<<<<
 *             return u"interval '" + str(v) + "'"
 *         elif t == int or t == float or (PY2 and t == long):
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_t), __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 721, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":722
 *             return "date '" + str(v) + "'"
 *         elif t == datetime.timedelta:
 *             return u"interval '" + str(v) + "'"             # <<<<<<<<<<<<<<
 *         elif t == int or t == float or (PY2 and t == long):
 *             return str(v)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_v);
    __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_kp_u_interval, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_kp_s__69); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_r = __pyx_t_12;
    __pyx_t_12 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":721
 *         elif t == datetime.date:
 *             return "date '" + str(v) + "'"
 *         elif t == datetime.timedelta:             # <<<<<<<<<<<<<<
 *             return u"interval '" + str(v) + "'"
 *         elif t == int or t == float or (PY2 and t == long):
 */
  }

  /* "minipg/minipg.py":723
 *         elif t == datetime.timedelta:
 *             return u"interval '" + str(v) + "'"
 *         elif t == int or t == float or (PY2 and t == long):             # <<<<<<<<<<<<<<
 *             return str(v)
 *         elif t == decimal.Decimal:
 */
  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyInt_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_t_6;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyFloat_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_t_6;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_6 = (__pyx_v_6minipg_6minipg_PY2 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_t_6;
    goto __pyx_L20_bool_binop_done;
  }
  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyLong_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 723, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_8 = __pyx_t_6;
  __pyx_L20_bool_binop_done:;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":724
 *             return u"interval '" + str(v) + "'"
 *         elif t == int or t == float or (PY2 and t == long):
 *             return str(v)             # <<<<<<<<<<<<<<
 *         elif t == decimal.Decimal:
 *             return "decimal '" + str(v) + "'"
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_v);
    __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_12, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_r = __pyx_t_13;
    __pyx_t_13 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":723
 *         elif t == datetime.timedelta:
 *             return u"interval '" + str(v) + "'"
 *         elif t == int or t == float or (PY2 and t == long):             # <<<<<<<<<<<<<<
 *             return str(v)
 *         elif t == decimal.Decimal:
 */
  }

  /* "minipg/minipg.py":725
 *         elif t == int or t == float or (PY2 and t == long):
 *             return str(v)
 *         elif t == decimal.Decimal:             # <<<<<<<<<<<<<<
 *             return "decimal '" + str(v) + "'"
 *         elif t == list or t == tuple:
 */
  __pyx_t_13 = __Pyx_GetModuleGlobalName(__pyx_n_s_decimal); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyObject_RichCompare(((PyObject *)__pyx_v_t), __pyx_t_12, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":726
 *             return str(v)
 *         elif t == decimal.Decimal:
 *             return "decimal '" + str(v) + "'"             # <<<<<<<<<<<<<<
 *         elif t == list or t == tuple:
 *             return u'ARRAY[' + u','.join([self.escape_parameter(e) for e in v]) + u']'
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_v);
    __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_kp_s_decimal_2, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_kp_s__69); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_r = __pyx_t_12;
    __pyx_t_12 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":725
 *         elif t == int or t == float or (PY2 and t == long):
 *             return str(v)
 *         elif t == decimal.Decimal:             # <<<<<<<<<<<<<<
 *             return "decimal '" + str(v) + "'"
 *         elif t == list or t == tuple:
 */
  }

  /* "minipg/minipg.py":727
 *         elif t == decimal.Decimal:
 *             return "decimal '" + str(v) + "'"
 *         elif t == list or t == tuple:             # <<<<<<<<<<<<<<
 *             return u'ARRAY[' + u','.join([self.escape_parameter(e) for e in v]) + u']'
 *         else:
 */
  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 727, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (!__pyx_t_6) {
  } else {
    __pyx_t_8 = __pyx_t_6;
    goto __pyx_L24_bool_binop_done;
  }
  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_t), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 727, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_8 = __pyx_t_6;
  __pyx_L24_bool_binop_done:;
  if (__pyx_t_8) {

    /* "minipg/minipg.py":728
 *             return "decimal '" + str(v) + "'"
 *         elif t == list or t == tuple:
 *             return u'ARRAY[' + u','.join([self.escape_parameter(e) for e in v]) + u']'             # <<<<<<<<<<<<<<
 *         else:
 *             return "'" + str(v) + "'"
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (likely(PyList_CheckExact(__pyx_v_v)) || PyTuple_CheckExact(__pyx_v_v)) {
      __pyx_t_13 = __pyx_v_v; __Pyx_INCREF(__pyx_t_13); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_v_v); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_10 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 728, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_13))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_13)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 728, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_13, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 728, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_13, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_10(__pyx_t_13);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 728, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->escape_parameter(__pyx_v_self, __pyx_v_e, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 728, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyUnicode_Join(__pyx_kp_u__9, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = __Pyx_PyUnicode_Concat(__pyx_kp_u_ARRAY, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_t_12, __pyx_kp_u__73); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 728, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_r = __pyx_t_13;
    __pyx_t_13 = 0;
    goto __pyx_L0;

    /* "minipg/minipg.py":727
 *         elif t == decimal.Decimal:
 *             return "decimal '" + str(v) + "'"
 *         elif t == list or t == tuple:             # <<<<<<<<<<<<<<
 *             return u'ARRAY[' + u','.join([self.escape_parameter(e) for e in v]) + u']'
 *         else:
 */
  }

  /* "minipg/minipg.py":730
 *             return u'ARRAY[' + u','.join([self.escape_parameter(e) for e in v]) + u']'
 *         else:
 *             return "'" + str(v) + "'"             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_INCREF(__pyx_v_v);
    __Pyx_GIVEREF(__pyx_v_v);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_v);
    __pyx_t_12 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_13, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_t_13 = PyNumber_Add(__pyx_kp_s__69, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_13);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __pyx_t_12 = PyNumber_Add(__pyx_t_13, __pyx_kp_s__69); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __pyx_r = __pyx_t_12;
    __pyx_t_12 = 0;
    goto __pyx_L0;
  }

  /* "minipg/minipg.py":695
 *         self.process_messages(None)
 * 
 *     def escape_parameter(self, v):             # <<<<<<<<<<<<<<
 *         t = type(v)
 *         func = self.encoders.get(t)
 */

  /* 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_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("minipg.minipg.Connection.escape_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_func);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_7escape_parameter(PyObject *__pyx_v_self, PyObject *__pyx_v_v); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_7escape_parameter = {"escape_parameter", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_7escape_parameter, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_7escape_parameter(PyObject *__pyx_v_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("escape_parameter (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_6escape_parameter(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_v));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_6escape_parameter(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_v) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("escape_parameter", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6minipg_6minipg_10Connection_escape_parameter(__pyx_v_self, __pyx_v_v, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __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("minipg.minipg.Connection.escape_parameter", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":733
 * 
 *     @property
 *     def is_dirty(self):             # <<<<<<<<<<<<<<
 *         return self._ready_for_query in b'TE'
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_8is_dirty_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_8is_dirty_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_8is_dirty___get__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_8is_dirty___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "minipg/minipg.py":734
 *     @property
 *     def is_dirty(self):
 *         return self._ready_for_query in b'TE'             # <<<<<<<<<<<<<<
 * 
 *     def is_connect(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_self->_ready_for_query, __pyx_n_b_TE, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 734, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":733
 * 
 *     @property
 *     def is_dirty(self):             # <<<<<<<<<<<<<<
 *         return self._ready_for_query in b'TE'
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("minipg.minipg.Connection.is_dirty.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":736
 *         return self._ready_for_query in b'TE'
 * 
 *     def is_connect(self):             # <<<<<<<<<<<<<<
 *         return bool(self.sock)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_9is_connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_9is_connect = {"is_connect", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_9is_connect, METH_NOARGS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_9is_connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_connect (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_8is_connect(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_8is_connect(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_connect", 0);

  /* "minipg/minipg.py":737
 * 
 *     def is_connect(self):
 *         return bool(self.sock)             # <<<<<<<<<<<<<<
 * 
 *     def cursor(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->sock); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 737, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":736
 *         return self._ready_for_query in b'TE'
 * 
 *     def is_connect(self):             # <<<<<<<<<<<<<<
 *         return bool(self.sock)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("minipg.minipg.Connection.is_connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":739
 *         return bool(self.sock)
 * 
 *     def cursor(self):             # <<<<<<<<<<<<<<
 *         return Cursor(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_11cursor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_11cursor = {"cursor", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_11cursor, METH_NOARGS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_11cursor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cursor (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_10cursor(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_10cursor(struct __pyx_obj_6minipg_6minipg_Connection *__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;
  __Pyx_RefNannySetupContext("cursor", 0);

  /* "minipg/minipg.py":740
 * 
 *     def cursor(self):
 *         return Cursor(self)             # <<<<<<<<<<<<<<
 * 
 *     def _execute(self, query, obj):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Cursor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_self));
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "minipg/minipg.py":739
 *         return bool(self.sock)
 * 
 *     def cursor(self):             # <<<<<<<<<<<<<<
 *         return Cursor(self)
 * 
 */

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

/* "minipg/minipg.py":742
 *         return Cursor(self)
 * 
 *     def _execute(self, query, obj):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::_execute()\t%s' % (query, ))
 */

static void __pyx_f_6minipg_6minipg_10Connection__execute(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_obj) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_execute", 0);

  /* "minipg/minipg.py":743
 * 
 *     def _execute(self, query, obj):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('Connection::_execute()\t%s' % (query, ))
 *         self._send_message(b'Q', query.encode(self.encoding) + b'\x00')
 */
  __pyx_t_1 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
  if (__pyx_t_1) {

    /* "minipg/minipg.py":744
 *     def _execute(self, query, obj):
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::_execute()\t%s' % (query, ))             # <<<<<<<<<<<<<<
 *         self._send_message(b'Q', query.encode(self.encoding) + b'\x00')
 *         self.process_messages(obj)
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_query);
    __Pyx_GIVEREF(__pyx_v_query);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_query);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Connection__execute_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_3))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 744, __pyx_L1_error)
    __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(((PyObject*)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "minipg/minipg.py":743
 * 
 *     def _execute(self, query, obj):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('Connection::_execute()\t%s' % (query, ))
 *         self._send_message(b'Q', query.encode(self.encoding) + b'\x00')
 */
  }

  /* "minipg/minipg.py":745
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::_execute()\t%s' % (query, ))
 *         self._send_message(b'Q', query.encode(self.encoding) + b'\x00')             # <<<<<<<<<<<<<<
 *         self.process_messages(obj)
 *         if self.autocommit:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->encoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->encoding};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_self->encoding};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 745, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_v_self->encoding);
      __Pyx_GIVEREF(__pyx_v_self->encoding);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_self->encoding);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 745, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_b__50); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 745, __pyx_L1_error)
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_send_message(__pyx_v_self, __pyx_n_b_Q, ((PyObject*)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":746
 *             DEBUG_OUTPUT('Connection::_execute()\t%s' % (query, ))
 *         self._send_message(b'Q', query.encode(self.encoding) + b'\x00')
 *         self.process_messages(obj)             # <<<<<<<<<<<<<<
 *         if self.autocommit:
 *             self.commit()
 */
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->process_messages(__pyx_v_self, __pyx_v_obj); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L1_error)

  /* "minipg/minipg.py":747
 *         self._send_message(b'Q', query.encode(self.encoding) + b'\x00')
 *         self.process_messages(obj)
 *         if self.autocommit:             # <<<<<<<<<<<<<<
 *             self.commit()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->autocommit); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 747, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "minipg/minipg.py":748
 *         self.process_messages(obj)
 *         if self.autocommit:
 *             self.commit()             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, query, obj=None):
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->commit(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "minipg/minipg.py":747
 *         self._send_message(b'Q', query.encode(self.encoding) + b'\x00')
 *         self.process_messages(obj)
 *         if self.autocommit:             # <<<<<<<<<<<<<<
 *             self.commit()
 * 
 */
  }

  /* "minipg/minipg.py":742
 *         return Cursor(self)
 * 
 *     def _execute(self, query, obj):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::_execute()\t%s' % (query, ))
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("minipg.minipg.Connection._execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "minipg/minipg.py":750
 *             self.commit()
 * 
 *     def execute(self, query, obj=None):             # <<<<<<<<<<<<<<
 *         if self._ready_for_query != b'T':
 *             self.begin()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_13execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_13execute = {"execute", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_13execute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_13execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_obj = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_query,&__pyx_n_s_obj,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_obj);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 750, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_query = values[0];
    __pyx_v_obj = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 750, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.Connection.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_12execute(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), __pyx_v_query, __pyx_v_obj);

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_12execute(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_query, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("execute", 0);

  /* "minipg/minipg.py":751
 * 
 *     def execute(self, query, obj=None):
 *         if self._ready_for_query != b'T':             # <<<<<<<<<<<<<<
 *             self.begin()
 *         self._execute(query, obj)
 */
  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_v_self->_ready_for_query, __pyx_n_b_T, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 751, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "minipg/minipg.py":752
 *     def execute(self, query, obj=None):
 *         if self._ready_for_query != b'T':
 *             self.begin()             # <<<<<<<<<<<<<<
 *         self._execute(query, obj)
 * 
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->begin(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "minipg/minipg.py":751
 * 
 *     def execute(self, query, obj=None):
 *         if self._ready_for_query != b'T':             # <<<<<<<<<<<<<<
 *             self.begin()
 *         self._execute(query, obj)
 */
  }

  /* "minipg/minipg.py":753
 *         if self._ready_for_query != b'T':
 *             self.begin()
 *         self._execute(query, obj)             # <<<<<<<<<<<<<<
 * 
 *     def set_autocommit(self, autocommit):
 */
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_execute(__pyx_v_self, __pyx_v_query, __pyx_v_obj); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error)

  /* "minipg/minipg.py":750
 *             self.commit()
 * 
 *     def execute(self, query, obj=None):             # <<<<<<<<<<<<<<
 *         if self._ready_for_query != b'T':
 *             self.begin()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("minipg.minipg.Connection.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":755
 *         self._execute(query, obj)
 * 
 *     def set_autocommit(self, autocommit):             # <<<<<<<<<<<<<<
 *         self.autocommit = autocommit
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_15set_autocommit(PyObject *__pyx_v_self, PyObject *__pyx_v_autocommit); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_15set_autocommit = {"set_autocommit", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_15set_autocommit, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_15set_autocommit(PyObject *__pyx_v_self, PyObject *__pyx_v_autocommit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_autocommit (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_14set_autocommit(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_autocommit));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_14set_autocommit(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_autocommit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_autocommit", 0);

  /* "minipg/minipg.py":756
 * 
 *     def set_autocommit(self, autocommit):
 *         self.autocommit = autocommit             # <<<<<<<<<<<<<<
 * 
 *     def begin(self):
 */
  __Pyx_INCREF(__pyx_v_autocommit);
  __Pyx_GIVEREF(__pyx_v_autocommit);
  __Pyx_GOTREF(__pyx_v_self->autocommit);
  __Pyx_DECREF(__pyx_v_self->autocommit);
  __pyx_v_self->autocommit = __pyx_v_autocommit;

  /* "minipg/minipg.py":755
 *         self._execute(query, obj)
 * 
 *     def set_autocommit(self, autocommit):             # <<<<<<<<<<<<<<
 *         self.autocommit = autocommit
 * 
 */

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

/* "minipg/minipg.py":758
 *         self.autocommit = autocommit
 * 
 *     def begin(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('BEGIN')
 */

static PyObject *__pyx_pw_6minipg_6minipg_10Connection_17begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_begin(struct __pyx_obj_6minipg_6minipg_Connection *__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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("begin", 0);
  /* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_17begin)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "minipg/minipg.py":759
 * 
 *     def begin(self):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('BEGIN')
 *         if self._ready_for_query == b'E':
 */
  __pyx_t_5 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
  if (__pyx_t_5) {

    /* "minipg/minipg.py":760
 *     def begin(self):
 *         if DEBUG:
 *             DEBUG_OUTPUT('BEGIN')             # <<<<<<<<<<<<<<
 *         if self._ready_for_query == b'E':
 *             self.rollback()
 */
    __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(__pyx_n_s_BEGIN);

    /* "minipg/minipg.py":759
 * 
 *     def begin(self):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('BEGIN')
 *         if self._ready_for_query == b'E':
 */
  }

  /* "minipg/minipg.py":761
 *         if DEBUG:
 *             DEBUG_OUTPUT('BEGIN')
 *         if self._ready_for_query == b'E':             # <<<<<<<<<<<<<<
 *             self.rollback()
 *         self._send_message(b'Q', b"BEGIN\x00")
 */
  __pyx_t_5 = (__Pyx_PyBytes_Equals(__pyx_v_self->_ready_for_query, __pyx_n_b_E, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 761, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "minipg/minipg.py":762
 *             DEBUG_OUTPUT('BEGIN')
 *         if self._ready_for_query == b'E':
 *             self.rollback()             # <<<<<<<<<<<<<<
 *         self._send_message(b'Q', b"BEGIN\x00")
 *         self._process_messages(None)
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->rollback(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "minipg/minipg.py":761
 *         if DEBUG:
 *             DEBUG_OUTPUT('BEGIN')
 *         if self._ready_for_query == b'E':             # <<<<<<<<<<<<<<
 *             self.rollback()
 *         self._send_message(b'Q', b"BEGIN\x00")
 */
  }

  /* "minipg/minipg.py":763
 *         if self._ready_for_query == b'E':
 *             self.rollback()
 *         self._send_message(b'Q', b"BEGIN\x00")             # <<<<<<<<<<<<<<
 *         self._process_messages(None)
 * 
 */
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_send_message(__pyx_v_self, __pyx_n_b_Q, __pyx_kp_b_BEGIN_2);

  /* "minipg/minipg.py":764
 *             self.rollback()
 *         self._send_message(b'Q', b"BEGIN\x00")
 *         self._process_messages(None)             # <<<<<<<<<<<<<<
 * 
 *     def commit(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_process_messages(__pyx_v_self, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":758
 *         self.autocommit = autocommit
 * 
 *     def begin(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('BEGIN')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("minipg.minipg.Connection.begin", __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_6minipg_6minipg_10Connection_17begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_17begin = {"begin", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_17begin, METH_NOARGS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_17begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("begin (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_16begin(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_16begin(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("begin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6minipg_6minipg_10Connection_begin(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __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("minipg.minipg.Connection.begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":766
 *         self._process_messages(None)
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('COMMIT')
 */

static PyObject *__pyx_pw_6minipg_6minipg_10Connection_19commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_commit(struct __pyx_obj_6minipg_6minipg_Connection *__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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("commit", 0);
  /* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_commit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_19commit)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "minipg/minipg.py":767
 * 
 *     def commit(self):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('COMMIT')
 *         if self.sock:
 */
  __pyx_t_5 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
  if (__pyx_t_5) {

    /* "minipg/minipg.py":768
 *     def commit(self):
 *         if DEBUG:
 *             DEBUG_OUTPUT('COMMIT')             # <<<<<<<<<<<<<<
 *         if self.sock:
 *             self._send_message(b'Q', b"COMMIT\x00")
 */
    __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(__pyx_n_s_COMMIT);

    /* "minipg/minipg.py":767
 * 
 *     def commit(self):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('COMMIT')
 *         if self.sock:
 */
  }

  /* "minipg/minipg.py":769
 *         if DEBUG:
 *             DEBUG_OUTPUT('COMMIT')
 *         if self.sock:             # <<<<<<<<<<<<<<
 *             self._send_message(b'Q', b"COMMIT\x00")
 *             self.process_messages(None)
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->sock); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 769, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "minipg/minipg.py":770
 *             DEBUG_OUTPUT('COMMIT')
 *         if self.sock:
 *             self._send_message(b'Q', b"COMMIT\x00")             # <<<<<<<<<<<<<<
 *             self.process_messages(None)
 * 
 */
    ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_send_message(__pyx_v_self, __pyx_n_b_Q, __pyx_kp_b_COMMIT_2);

    /* "minipg/minipg.py":771
 *         if self.sock:
 *             self._send_message(b'Q', b"COMMIT\x00")
 *             self.process_messages(None)             # <<<<<<<<<<<<<<
 * 
 *     def rollback(self):
 */
    ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->process_messages(__pyx_v_self, Py_None); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L1_error)

    /* "minipg/minipg.py":769
 *         if DEBUG:
 *             DEBUG_OUTPUT('COMMIT')
 *         if self.sock:             # <<<<<<<<<<<<<<
 *             self._send_message(b'Q', b"COMMIT\x00")
 *             self.process_messages(None)
 */
  }

  /* "minipg/minipg.py":766
 *         self._process_messages(None)
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('COMMIT')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("minipg.minipg.Connection.commit", __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_6minipg_6minipg_10Connection_19commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_19commit = {"commit", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_19commit, METH_NOARGS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_19commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("commit (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_18commit(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_18commit(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("commit", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6minipg_6minipg_10Connection_commit(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __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("minipg.minipg.Connection.commit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":773
 *             self.process_messages(None)
 * 
 *     def rollback(self):             # <<<<<<<<<<<<<<
 *         if self.sock:
 *             if DEBUG:
 */

static PyObject *__pyx_pw_6minipg_6minipg_10Connection_21rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_rollback(struct __pyx_obj_6minipg_6minipg_Connection *__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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("rollback", 0);
  /* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rollback); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_21rollback)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "minipg/minipg.py":774
 * 
 *     def rollback(self):
 *         if self.sock:             # <<<<<<<<<<<<<<
 *             if DEBUG:
 *                 DEBUG_OUTPUT('ROLLBACK')
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->sock); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 774, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "minipg/minipg.py":775
 *     def rollback(self):
 *         if self.sock:
 *             if DEBUG:             # <<<<<<<<<<<<<<
 *                 DEBUG_OUTPUT('ROLLBACK')
 *             self._send_message(b'Q', b"ROLLBACK\x00")
 */
    __pyx_t_5 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
    if (__pyx_t_5) {

      /* "minipg/minipg.py":776
 *         if self.sock:
 *             if DEBUG:
 *                 DEBUG_OUTPUT('ROLLBACK')             # <<<<<<<<<<<<<<
 *             self._send_message(b'Q', b"ROLLBACK\x00")
 *         self.process_messages(None)
 */
      __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(__pyx_n_s_ROLLBACK);

      /* "minipg/minipg.py":775
 *     def rollback(self):
 *         if self.sock:
 *             if DEBUG:             # <<<<<<<<<<<<<<
 *                 DEBUG_OUTPUT('ROLLBACK')
 *             self._send_message(b'Q', b"ROLLBACK\x00")
 */
    }

    /* "minipg/minipg.py":777
 *             if DEBUG:
 *                 DEBUG_OUTPUT('ROLLBACK')
 *             self._send_message(b'Q', b"ROLLBACK\x00")             # <<<<<<<<<<<<<<
 *         self.process_messages(None)
 * 
 */
    ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_send_message(__pyx_v_self, __pyx_n_b_Q, __pyx_kp_b_ROLLBACK_2);

    /* "minipg/minipg.py":774
 * 
 *     def rollback(self):
 *         if self.sock:             # <<<<<<<<<<<<<<
 *             if DEBUG:
 *                 DEBUG_OUTPUT('ROLLBACK')
 */
  }

  /* "minipg/minipg.py":778
 *                 DEBUG_OUTPUT('ROLLBACK')
 *             self._send_message(b'Q', b"ROLLBACK\x00")
 *         self.process_messages(None)             # <<<<<<<<<<<<<<
 * 
 *     def reopen(self):
 */
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->process_messages(__pyx_v_self, Py_None); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L1_error)

  /* "minipg/minipg.py":773
 *             self.process_messages(None)
 * 
 *     def rollback(self):             # <<<<<<<<<<<<<<
 *         if self.sock:
 *             if DEBUG:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("minipg.minipg.Connection.rollback", __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_6minipg_6minipg_10Connection_21rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_21rollback = {"rollback", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_21rollback, METH_NOARGS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_21rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rollback (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_20rollback(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_20rollback(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rollback", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6minipg_6minipg_10Connection_rollback(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __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("minipg.minipg.Connection.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":780
 *         self.process_messages(None)
 * 
 *     def reopen(self):             # <<<<<<<<<<<<<<
 *         self.close()
 *         self._open()
 */

static PyObject *__pyx_pw_6minipg_6minipg_10Connection_23reopen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_reopen(struct __pyx_obj_6minipg_6minipg_Connection *__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;
  __Pyx_RefNannySetupContext("reopen", 0);
  /* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reopen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_23reopen)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "minipg/minipg.py":781
 * 
 *     def reopen(self):
 *         self.close()             # <<<<<<<<<<<<<<
 *         self._open()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->close(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":782
 *     def reopen(self):
 *         self.close()
 *         self._open()             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_open(__pyx_v_self);

  /* "minipg/minipg.py":780
 *         self.process_messages(None)
 * 
 *     def reopen(self):             # <<<<<<<<<<<<<<
 *         self.close()
 *         self._open()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("minipg.minipg.Connection.reopen", __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_6minipg_6minipg_10Connection_23reopen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_23reopen = {"reopen", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_23reopen, METH_NOARGS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_23reopen(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reopen (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_22reopen(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_22reopen(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("reopen", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6minipg_6minipg_10Connection_reopen(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __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("minipg.minipg.Connection.reopen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":784
 *         self._open()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::close()')
 */

static PyObject *__pyx_pw_6minipg_6minipg_10Connection_25close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6minipg_6minipg_10Connection_close(struct __pyx_obj_6minipg_6minipg_Connection *__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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("close", 0);
  /* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_25close)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 784, __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;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "minipg/minipg.py":785
 * 
 *     def close(self):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('Connection::close()')
 *         if self.sock:
 */
  __pyx_t_5 = (__pyx_v_6minipg_6minipg_DEBUG != 0);
  if (__pyx_t_5) {

    /* "minipg/minipg.py":786
 *     def close(self):
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::close()')             # <<<<<<<<<<<<<<
 *         if self.sock:
 *             # send Terminate
 */
    __pyx_f_6minipg_6minipg_DEBUG_OUTPUT(__pyx_kp_s_Connection_close);

    /* "minipg/minipg.py":785
 * 
 *     def close(self):
 *         if DEBUG:             # <<<<<<<<<<<<<<
 *             DEBUG_OUTPUT('Connection::close()')
 *         if self.sock:
 */
  }

  /* "minipg/minipg.py":787
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::close()')
 *         if self.sock:             # <<<<<<<<<<<<<<
 *             # send Terminate
 *             self._write(b'X\x00\x00\x00\x04')
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->sock); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 787, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "minipg/minipg.py":789
 *         if self.sock:
 *             # send Terminate
 *             self._write(b'X\x00\x00\x00\x04')             # <<<<<<<<<<<<<<
 *             self.sock.close()
 *             self.sock = None
 */
    ((struct __pyx_vtabstruct_6minipg_6minipg_Connection *)__pyx_v_self->__pyx_vtab)->_write(__pyx_v_self, __pyx_kp_b_X);

    /* "minipg/minipg.py":790
 *             # send Terminate
 *             self._write(b'X\x00\x00\x00\x04')
 *             self.sock.close()             # <<<<<<<<<<<<<<
 *             self.sock = None
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->sock, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __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;

    /* "minipg/minipg.py":791
 *             self._write(b'X\x00\x00\x00\x04')
 *             self.sock.close()
 *             self.sock = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->sock);
    __Pyx_DECREF(__pyx_v_self->sock);
    __pyx_v_self->sock = Py_None;

    /* "minipg/minipg.py":787
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::close()')
 *         if self.sock:             # <<<<<<<<<<<<<<
 *             # send Terminate
 *             self._write(b'X\x00\x00\x00\x04')
 */
  }

  /* "minipg/minipg.py":784
 *         self._open()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::close()')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("minipg.minipg.Connection.close", __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_6minipg_6minipg_10Connection_25close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_10Connection_25close = {"close", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_25close, METH_NOARGS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_25close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_24close(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_24close(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("close", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6minipg_6minipg_10Connection_close(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __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("minipg.minipg.Connection.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.pxd":126
 *     cdef user, password, database, host, port, timeout, use_ssl, sock
 *     cdef _ready_for_query
 *     cdef public object encoding, encoders, autocommit, tzinfo             # <<<<<<<<<<<<<<
 * 
 *     @cython.locals(t=cython.type)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_8encoding_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_8encoding_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_8encoding___get__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_8encoding___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->encoding);
  __pyx_r = __pyx_v_self->encoding;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_8encoding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_8encoding_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_8encoding_2__set__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6minipg_6minipg_10Connection_8encoding_2__set__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->encoding);
  __Pyx_DECREF(__pyx_v_self->encoding);
  __pyx_v_self->encoding = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_8encoding_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_8encoding_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_8encoding_4__del__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static int __pyx_pf_6minipg_6minipg_10Connection_8encoding_4__del__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->encoding);
  __Pyx_DECREF(__pyx_v_self->encoding);
  __pyx_v_self->encoding = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_8encoders_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_8encoders_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_8encoders___get__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_8encoders___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->encoders);
  __pyx_r = __pyx_v_self->encoders;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_8encoders_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_8encoders_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_8encoders_2__set__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6minipg_6minipg_10Connection_8encoders_2__set__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->encoders);
  __Pyx_DECREF(__pyx_v_self->encoders);
  __pyx_v_self->encoders = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_8encoders_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_8encoders_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_8encoders_4__del__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static int __pyx_pf_6minipg_6minipg_10Connection_8encoders_4__del__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->encoders);
  __Pyx_DECREF(__pyx_v_self->encoders);
  __pyx_v_self->encoders = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_10autocommit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_10autocommit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_10autocommit___get__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_10autocommit___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->autocommit);
  __pyx_r = __pyx_v_self->autocommit;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_10autocommit_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_10autocommit_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_10autocommit_2__set__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6minipg_6minipg_10Connection_10autocommit_2__set__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->autocommit);
  __Pyx_DECREF(__pyx_v_self->autocommit);
  __pyx_v_self->autocommit = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_10autocommit_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_10autocommit_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_10autocommit_4__del__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static int __pyx_pf_6minipg_6minipg_10Connection_10autocommit_4__del__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->autocommit);
  __Pyx_DECREF(__pyx_v_self->autocommit);
  __pyx_v_self->autocommit = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_6tzinfo_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6minipg_6minipg_10Connection_6tzinfo_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_6tzinfo___get__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static PyObject *__pyx_pf_6minipg_6minipg_10Connection_6tzinfo___get__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->tzinfo);
  __pyx_r = __pyx_v_self->tzinfo;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_6tzinfo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_6tzinfo_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_6tzinfo_2__set__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6minipg_6minipg_10Connection_6tzinfo_2__set__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->tzinfo);
  __Pyx_DECREF(__pyx_v_self->tzinfo);
  __pyx_v_self->tzinfo = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_6minipg_6minipg_10Connection_6tzinfo_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6minipg_6minipg_10Connection_6tzinfo_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_10Connection_6tzinfo_4__del__(((struct __pyx_obj_6minipg_6minipg_Connection *)__pyx_v_self));

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

static int __pyx_pf_6minipg_6minipg_10Connection_6tzinfo_4__del__(struct __pyx_obj_6minipg_6minipg_Connection *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->tzinfo);
  __Pyx_DECREF(__pyx_v_self->tzinfo);
  __pyx_v_self->tzinfo = Py_None;

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

/* "minipg/minipg.py":794
 * 
 * 
 * def connect(host, user, password='', database=None, port=5432, timeout=None, use_ssl=False, tzinfo=None):             # <<<<<<<<<<<<<<
 *     return Connection(user, password, database, host, port, timeout, use_ssl, tzinfo)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_3connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_3connect = {"connect", (PyCFunction)__pyx_pw_6minipg_6minipg_3connect, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_3connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_host = 0;
  PyObject *__pyx_v_user = 0;
  PyObject *__pyx_v_password = 0;
  PyObject *__pyx_v_database = 0;
  PyObject *__pyx_v_port = 0;
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_v_use_ssl = 0;
  PyObject *__pyx_v_tzinfo = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_host,&__pyx_n_s_user,&__pyx_n_s_password,&__pyx_n_s_database,&__pyx_n_s_port,&__pyx_n_s_timeout,&__pyx_n_s_use_ssl,&__pyx_n_s_tzinfo,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_s__26));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)__pyx_int_5432));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_False));
    values[7] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_host)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_user)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("connect", 0, 2, 8, 1); __PYX_ERR(0, 794, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_password);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_database);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_port);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_use_ssl);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tzinfo);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "connect") < 0)) __PYX_ERR(0, 794, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_host = values[0];
    __pyx_v_user = values[1];
    __pyx_v_password = values[2];
    __pyx_v_database = values[3];
    __pyx_v_port = values[4];
    __pyx_v_timeout = values[5];
    __pyx_v_use_ssl = values[6];
    __pyx_v_tzinfo = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("connect", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 794, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_2connect(__pyx_self, __pyx_v_host, __pyx_v_user, __pyx_v_password, __pyx_v_database, __pyx_v_port, __pyx_v_timeout, __pyx_v_use_ssl, __pyx_v_tzinfo);

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

static PyObject *__pyx_pf_6minipg_6minipg_2connect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_host, PyObject *__pyx_v_user, PyObject *__pyx_v_password, PyObject *__pyx_v_database, PyObject *__pyx_v_port, PyObject *__pyx_v_timeout, PyObject *__pyx_v_use_ssl, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "minipg/minipg.py":795
 * 
 * def connect(host, user, password='', database=None, port=5432, timeout=None, use_ssl=False, tzinfo=None):
 *     return Connection(user, password, database, host, port, timeout, use_ssl, tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_user);
  __Pyx_GIVEREF(__pyx_v_user);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_user);
  __Pyx_INCREF(__pyx_v_password);
  __Pyx_GIVEREF(__pyx_v_password);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_password);
  __Pyx_INCREF(__pyx_v_database);
  __Pyx_GIVEREF(__pyx_v_database);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_database);
  __Pyx_INCREF(__pyx_v_host);
  __Pyx_GIVEREF(__pyx_v_host);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_host);
  __Pyx_INCREF(__pyx_v_port);
  __Pyx_GIVEREF(__pyx_v_port);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_port);
  __Pyx_INCREF(__pyx_v_timeout);
  __Pyx_GIVEREF(__pyx_v_timeout);
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_timeout);
  __Pyx_INCREF(__pyx_v_use_ssl);
  __Pyx_GIVEREF(__pyx_v_use_ssl);
  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_use_ssl);
  __Pyx_INCREF(__pyx_v_tzinfo);
  __Pyx_GIVEREF(__pyx_v_tzinfo);
  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_tzinfo);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6minipg_6minipg_Connection), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 795, __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;

  /* "minipg/minipg.py":794
 * 
 * 
 * def connect(host, user, password='', database=None, port=5432, timeout=None, use_ssl=False, tzinfo=None):             # <<<<<<<<<<<<<<
 *     return Connection(user, password, database, host, port, timeout, use_ssl, tzinfo)
 * 
 */

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

/* "minipg/minipg.py":798
 * 
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):             # <<<<<<<<<<<<<<
 *     def _ustr(c):
 *         if c is None:
 */

static PyObject *__pyx_pf_6minipg_6minipg_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True));
  __Pyx_INCREF(((PyObject*)__pyx_kp_s__74));
  __Pyx_GIVEREF(((PyObject*)__pyx_kp_s__74));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_kp_s__74));
  __Pyx_INCREF(((PyObject*)__pyx_n_s_null));
  __Pyx_GIVEREF(((PyObject*)__pyx_n_s_null));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject*)__pyx_n_s_null));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_file);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_file);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_file);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_5output_results(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_5output_results = {"output_results", (PyCFunction)__pyx_pw_6minipg_6minipg_5output_results, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_6minipg_6minipg_5output_results(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_conn = 0;
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_with_header = 0;
  PyObject *__pyx_v_separator = 0;
  PyObject *__pyx_v_null = 0;
  PyObject *__pyx_v_file = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_results (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn,&__pyx_n_s_query,&__pyx_n_s_with_header,&__pyx_n_s_separator,&__pyx_n_s_null,&__pyx_n_s_file,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[2] = ((PyObject *)((PyObject *)Py_True));
    values[3] = ((PyObject *)((PyObject*)__pyx_kp_s__74));
    values[4] = ((PyObject *)((PyObject*)__pyx_n_s_null));
    values[5] = __pyx_dynamic_args->__pyx_arg_file;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conn)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("output_results", 0, 2, 6, 1); __PYX_ERR(0, 798, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_with_header);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_separator);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_null);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "output_results") < 0)) __PYX_ERR(0, 798, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_conn = values[0];
    __pyx_v_query = values[1];
    __pyx_v_with_header = values[2];
    __pyx_v_separator = values[3];
    __pyx_v_null = values[4];
    __pyx_v_file = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("output_results", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 798, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("minipg.minipg.output_results", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6minipg_6minipg_4output_results(__pyx_self, __pyx_v_conn, __pyx_v_query, __pyx_v_with_header, __pyx_v_separator, __pyx_v_null, __pyx_v_file);

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

/* "minipg/minipg.py":799
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):
 *     def _ustr(c):             # <<<<<<<<<<<<<<
 *         if c is None:
 *             return null
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_14output_results_1_ustr(PyObject *__pyx_self, PyObject *__pyx_v_c); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_14output_results_1_ustr = {"_ustr", (PyCFunction)__pyx_pw_6minipg_6minipg_14output_results_1_ustr, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_14output_results_1_ustr(PyObject *__pyx_self, PyObject *__pyx_v_c) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_ustr (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_14output_results__ustr(__pyx_self, ((PyObject *)__pyx_v_c));

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

static PyObject *__pyx_pf_6minipg_6minipg_14output_results__ustr(PyObject *__pyx_self, PyObject *__pyx_v_c) {
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *__pyx_cur_scope;
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_ustr", 0);
  __pyx_outer_scope = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;
  __Pyx_INCREF(__pyx_v_c);

  /* "minipg/minipg.py":800
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):
 *     def _ustr(c):
 *         if c is None:             # <<<<<<<<<<<<<<
 *             return null
 *         elif c is True:
 */
  __pyx_t_1 = (__pyx_v_c == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":801
 *     def _ustr(c):
 *         if c is None:
 *             return null             # <<<<<<<<<<<<<<
 *         elif c is True:
 *             return 'true'
 */
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(!__pyx_cur_scope->__pyx_v_null)) { __Pyx_RaiseClosureNameError("null"); __PYX_ERR(0, 801, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_null);
    __pyx_r = __pyx_cur_scope->__pyx_v_null;
    goto __pyx_L0;

    /* "minipg/minipg.py":800
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):
 *     def _ustr(c):
 *         if c is None:             # <<<<<<<<<<<<<<
 *             return null
 *         elif c is True:
 */
  }

  /* "minipg/minipg.py":802
 *         if c is None:
 *             return null
 *         elif c is True:             # <<<<<<<<<<<<<<
 *             return 'true'
 *         elif c is False:
 */
  __pyx_t_2 = (__pyx_v_c == Py_True);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "minipg/minipg.py":803
 *             return null
 *         elif c is True:
 *             return 'true'             # <<<<<<<<<<<<<<
 *         elif c is False:
 *             return 'false'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_true);
    __pyx_r = __pyx_n_s_true;
    goto __pyx_L0;

    /* "minipg/minipg.py":802
 *         if c is None:
 *             return null
 *         elif c is True:             # <<<<<<<<<<<<<<
 *             return 'true'
 *         elif c is False:
 */
  }

  /* "minipg/minipg.py":804
 *         elif c is True:
 *             return 'true'
 *         elif c is False:             # <<<<<<<<<<<<<<
 *             return 'false'
 *         if PY2:
 */
  __pyx_t_1 = (__pyx_v_c == Py_False);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":805
 *             return 'true'
 *         elif c is False:
 *             return 'false'             # <<<<<<<<<<<<<<
 *         if PY2:
 *             if not isinstance(c, unicode):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_false);
    __pyx_r = __pyx_n_s_false;
    goto __pyx_L0;

    /* "minipg/minipg.py":804
 *         elif c is True:
 *             return 'true'
 *         elif c is False:             # <<<<<<<<<<<<<<
 *             return 'false'
 *         if PY2:
 */
  }

  /* "minipg/minipg.py":806
 *         elif c is False:
 *             return 'false'
 *         if PY2:             # <<<<<<<<<<<<<<
 *             if not isinstance(c, unicode):
 *                 c = unicode(c)
 */
  __pyx_t_2 = (__pyx_v_6minipg_6minipg_PY2 != 0);
  if (__pyx_t_2) {

    /* "minipg/minipg.py":807
 *             return 'false'
 *         if PY2:
 *             if not isinstance(c, unicode):             # <<<<<<<<<<<<<<
 *                 c = unicode(c)
 *         else:
 */
    __pyx_t_2 = PyUnicode_Check(__pyx_v_c); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (__pyx_t_1) {

      /* "minipg/minipg.py":808
 *         if PY2:
 *             if not isinstance(c, unicode):
 *                 c = unicode(c)             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(c, str):
 */
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_c);
      __Pyx_GIVEREF(__pyx_v_c);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_c);
      __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "minipg/minipg.py":807
 *             return 'false'
 *         if PY2:
 *             if not isinstance(c, unicode):             # <<<<<<<<<<<<<<
 *                 c = unicode(c)
 *         else:
 */
    }

    /* "minipg/minipg.py":806
 *         elif c is False:
 *             return 'false'
 *         if PY2:             # <<<<<<<<<<<<<<
 *             if not isinstance(c, unicode):
 *                 c = unicode(c)
 */
    goto __pyx_L4;
  }

  /* "minipg/minipg.py":810
 *                 c = unicode(c)
 *         else:
 *             if not isinstance(c, str):             # <<<<<<<<<<<<<<
 *                 c = str(c)
 *         return c
 */
  /*else*/ {
    __pyx_t_1 = PyString_Check(__pyx_v_c); 
    __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
    if (__pyx_t_2) {

      /* "minipg/minipg.py":811
 *         else:
 *             if not isinstance(c, str):
 *                 c = str(c)             # <<<<<<<<<<<<<<
 *         return c
 * 
 */
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_c);
      __Pyx_GIVEREF(__pyx_v_c);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_c);
      __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "minipg/minipg.py":810
 *                 c = unicode(c)
 *         else:
 *             if not isinstance(c, str):             # <<<<<<<<<<<<<<
 *                 c = str(c)
 *         return c
 */
    }
  }
  __pyx_L4:;

  /* "minipg/minipg.py":812
 *             if not isinstance(c, str):
 *                 c = str(c)
 *         return c             # <<<<<<<<<<<<<<
 * 
 *     cur = conn.cursor()
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_c);
  __pyx_r = __pyx_v_c;
  goto __pyx_L0;

  /* "minipg/minipg.py":799
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):
 *     def _ustr(c):             # <<<<<<<<<<<<<<
 *         if c is None:
 *             return null
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("minipg.minipg.output_results._ustr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":798
 * 
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):             # <<<<<<<<<<<<<<
 *     def _ustr(c):
 *         if c is None:
 */

static PyObject *__pyx_pf_6minipg_6minipg_4output_results(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_query, PyObject *__pyx_v_with_header, PyObject *__pyx_v_separator, PyObject *__pyx_v_null, PyObject *__pyx_v_file) {
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *__pyx_cur_scope;
  PyObject *__pyx_v__ustr = 0;
  PyObject *__pyx_v_cur = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  __Pyx_RefNannySetupContext("output_results", 0);
  __pyx_cur_scope = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *)__pyx_tp_new_6minipg_6minipg___pyx_scope_struct_2_output_results(__pyx_ptype_6minipg_6minipg___pyx_scope_struct_2_output_results, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 798, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_null = __pyx_v_null;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_null);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_null);

  /* "minipg/minipg.py":799
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):
 *     def _ustr(c):             # <<<<<<<<<<<<<<
 *         if c is None:
 *             return null
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_14output_results_1_ustr, 0, __pyx_n_s_output_results_locals__ustr, ((PyObject*)__pyx_cur_scope), __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__ustr = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":814
 *         return c
 * 
 *     cur = conn.cursor()             # <<<<<<<<<<<<<<
 *     cur.execute(query)
 *     if with_header:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_cursor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cur = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":815
 * 
 *     cur = conn.cursor()
 *     cur.execute(query)             # <<<<<<<<<<<<<<
 *     if with_header:
 *         print(separator.join([_ustr(d[0]) for d in cur.description]), file=file)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_execute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_query};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_query};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_query);
      __Pyx_GIVEREF(__pyx_v_query);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_query);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":816
 *     cur = conn.cursor()
 *     cur.execute(query)
 *     if with_header:             # <<<<<<<<<<<<<<
 *         print(separator.join([_ustr(d[0]) for d in cur.description]), file=file)
 *     for r in cur.fetchall():
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_with_header); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 816, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "minipg/minipg.py":817
 *     cur.execute(query)
 *     if with_header:
 *         print(separator.join([_ustr(d[0]) for d in cur.description]), file=file)             # <<<<<<<<<<<<<<
 *     for r in cur.fetchall():
 *         print(separator.join([_ustr(c) for c in r]), file=file)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_separator, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_description); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 817, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 817, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 817, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_8(__pyx_t_6);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 817, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_d, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __pyx_pf_6minipg_6minipg_14output_results__ustr(__pyx_v__ustr, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 817, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 817, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_file, __pyx_v_file) < 0) __PYX_ERR(0, 817, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "minipg/minipg.py":816
 *     cur = conn.cursor()
 *     cur.execute(query)
 *     if with_header:             # <<<<<<<<<<<<<<
 *         print(separator.join([_ustr(d[0]) for d in cur.description]), file=file)
 *     for r in cur.fetchall():
 */
  }

  /* "minipg/minipg.py":818
 *     if with_header:
 *         print(separator.join([_ustr(d[0]) for d in cur.description]), file=file)
 *     for r in cur.fetchall():             # <<<<<<<<<<<<<<
 *         print(separator.join([_ustr(c) for c in r]), file=file)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cur, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 818, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 818, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
    __pyx_t_1 = __pyx_t_9; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 818, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 818, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 818, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_8(__pyx_t_1);
      if (unlikely(!__pyx_t_9)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 818, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "minipg/minipg.py":819
 *         print(separator.join([_ustr(d[0]) for d in cur.description]), file=file)
 *     for r in cur.fetchall():
 *         print(separator.join([_ustr(c) for c in r]), file=file)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_separator, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (likely(PyList_CheckExact(__pyx_v_r)) || PyTuple_CheckExact(__pyx_v_r)) {
      __pyx_t_6 = __pyx_v_r; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 819, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 819, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 819, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 819, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_11(__pyx_t_6);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 819, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = __pyx_pf_6minipg_6minipg_14output_results__ustr(__pyx_v__ustr, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 819, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 819, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_9);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
        __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else
      #endif
      {
        __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
        __Pyx_GIVEREF(__pyx_t_4);
        PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_file, __pyx_v_file) < 0) __PYX_ERR(0, 819, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "minipg/minipg.py":818
 *     if with_header:
 *         print(separator.join([_ustr(d[0]) for d in cur.description]), file=file)
 *     for r in cur.fetchall():             # <<<<<<<<<<<<<<
 *         print(separator.join([_ustr(c) for c in r]), file=file)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":798
 * 
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):             # <<<<<<<<<<<<<<
 *     def _ustr(c):
 *         if c is None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("minipg.minipg.output_results", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v__ustr);
  __Pyx_XDECREF(__pyx_v_cur);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "minipg/minipg.py":822
 * 
 * 
 * def main(file):             # <<<<<<<<<<<<<<
 *     parser = ArgumentParser(description='Execute query and print results.')
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 */

/* Python wrapper */
static PyObject *__pyx_pw_6minipg_6minipg_7main(PyObject *__pyx_self, PyObject *__pyx_v_file); /*proto*/
static PyMethodDef __pyx_mdef_6minipg_6minipg_7main = {"main", (PyCFunction)__pyx_pw_6minipg_6minipg_7main, METH_O, 0};
static PyObject *__pyx_pw_6minipg_6minipg_7main(PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("main (wrapper)", 0);
  __pyx_r = __pyx_pf_6minipg_6minipg_6main(__pyx_self, ((PyObject *)__pyx_v_file));

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

static PyObject *__pyx_pf_6minipg_6minipg_6main(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_file) {
  PyObject *__pyx_v_parser = NULL;
  PyObject *__pyx_v_args = NULL;
  PyObject *__pyx_v_conn = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("main", 0);

  /* "minipg/minipg.py":823
 * 
 * def main(file):
 *     parser = ArgumentParser(description='Execute query and print results.')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ArgumentParser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_description, __pyx_kp_s_Execute_query_and_print_results) < 0) __PYX_ERR(0, 823, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_parser = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "minipg/minipg.py":824
 * def main(file):
 *     parser = ArgumentParser(description='Execute query and print results.')
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_n_s_localhost) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metavar, __pyx_n_s_host) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_host_name) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__77, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":825
 *     parser = ArgumentParser(description='Execute query and print results.')
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_required, Py_True) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metavar, __pyx_n_s_user) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_login_user) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__78, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 825, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "minipg/minipg.py":826
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_kp_s__26) < 0) __PYX_ERR(0, 826, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metavar, __pyx_n_s_password) < 0) __PYX_ERR(0, 826, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 826, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_login_password) < 0) __PYX_ERR(0, 826, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__79, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":827
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_int_5432) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metavar, __pyx_n_s_port) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_port_number) < 0) __PYX_ERR(0, 827, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__80, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "minipg/minipg.py":828
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metavar, __pyx_n_s_database) < 0) __PYX_ERR(0, 828, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 828, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_database_name) < 0) __PYX_ERR(0, 828, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__81, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":829
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metavar, __pyx_n_s_query) < 0) __PYX_ERR(0, 829, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 829, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_query_string) < 0) __PYX_ERR(0, 829, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__82, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "minipg/minipg.py":830
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')             # <<<<<<<<<<<<<<
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')
 *     parser.add_argument('--no-header', action='store_false', dest='with_header', help='No output header')
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_kp_s__74) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metavar, __pyx_n_s_field_separator_2) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_field_separator_3) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__83, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":831
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')             # <<<<<<<<<<<<<<
 *     parser.add_argument('--no-header', action='store_false', dest='with_header', help='No output header')
 *     parser.add_argument('--null', default='null', metavar='null', type=str, help='null value replacement string')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_action, __pyx_n_s_store_true) < 0) __PYX_ERR(0, 831, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dest, __pyx_n_s_with_header) < 0) __PYX_ERR(0, 831, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_Output_header) < 0) __PYX_ERR(0, 831, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__84, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "minipg/minipg.py":832
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')
 *     parser.add_argument('--no-header', action='store_false', dest='with_header', help='No output header')             # <<<<<<<<<<<<<<
 *     parser.add_argument('--null', default='null', metavar='null', type=str, help='null value replacement string')
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_action, __pyx_n_s_store_false) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dest, __pyx_n_s_with_header) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_No_output_header) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__85, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":833
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')
 *     parser.add_argument('--no-header', action='store_false', dest='with_header', help='No output header')
 *     parser.add_argument('--null', default='null', metavar='null', type=str, help='null value replacement string')             # <<<<<<<<<<<<<<
 * 
 *     parser.set_defaults(with_header=True)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_add_argument); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_default, __pyx_n_s_null) < 0) __PYX_ERR(0, 833, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_metavar, __pyx_n_s_null) < 0) __PYX_ERR(0, 833, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_type, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 833, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_help, __pyx_kp_s_null_value_replacement_string) < 0) __PYX_ERR(0, 833, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__86, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "minipg/minipg.py":835
 *     parser.add_argument('--null', default='null', metavar='null', type=str, help='null value replacement string')
 * 
 *     parser.set_defaults(with_header=True)             # <<<<<<<<<<<<<<
 * 
 *     args = parser.parse_args()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_set_defaults); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_with_header, Py_True) < 0) __PYX_ERR(0, 835, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":837
 *     parser.set_defaults(with_header=True)
 * 
 *     args = parser.parse_args()             # <<<<<<<<<<<<<<
 *     if args.query is None:
 *         args.query = sys.stdin.read()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_parser, __pyx_n_s_parse_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_args = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":838
 * 
 *     args = parser.parse_args()
 *     if args.query is None:             # <<<<<<<<<<<<<<
 *         args.query = sys.stdin.read()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "minipg/minipg.py":839
 *     args = parser.parse_args()
 *     if args.query is None:
 *         args.query = sys.stdin.read()             # <<<<<<<<<<<<<<
 * 
 *     conn = connect(args.host, args.user, args.password, args.database, args.port)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __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_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 839, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_args, __pyx_n_s_query, __pyx_t_1) < 0) __PYX_ERR(0, 839, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "minipg/minipg.py":838
 * 
 *     args = parser.parse_args()
 *     if args.query is None:             # <<<<<<<<<<<<<<
 *         args.query = sys.stdin.read()
 * 
 */
  }

  /* "minipg/minipg.py":841
 *         args.query = sys.stdin.read()
 * 
 *     conn = connect(args.host, args.user, args.password, args.database, args.port)             # <<<<<<<<<<<<<<
 *     output_results(conn, args.query, args.with_header, args.field_separator, args.null, file)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_host); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_user); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_password); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_database); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_port); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = NULL;
  __pyx_t_11 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_11 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_10, __pyx_t_3, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 5+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[6] = {__pyx_t_10, __pyx_t_3, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 5+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  } else
  #endif
  {
    __pyx_t_12 = PyTuple_New(5+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_10) {
      __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_11, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_11, __pyx_t_9);
    __pyx_t_3 = 0;
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_conn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "minipg/minipg.py":842
 * 
 *     conn = connect(args.host, args.user, args.password, args.database, args.port)
 *     output_results(conn, args.query, args.with_header, args.field_separator, args.null, file)             # <<<<<<<<<<<<<<
 * 
 *     conn.commit()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_output_results); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_query); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_with_header); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_field_separator_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_args, __pyx_n_s_null); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = NULL;
  __pyx_t_11 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_11 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[7] = {__pyx_t_6, __pyx_v_conn, __pyx_t_12, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_v_file};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 6+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[7] = {__pyx_t_6, __pyx_v_conn, __pyx_t_12, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_v_file};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 6+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(6+__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_conn);
    __Pyx_GIVEREF(__pyx_v_conn);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_11, __pyx_v_conn);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_11, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_11, __pyx_t_9);
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_11, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_11, __pyx_t_7);
    __Pyx_INCREF(__pyx_v_file);
    __Pyx_GIVEREF(__pyx_v_file);
    PyTuple_SET_ITEM(__pyx_t_3, 5+__pyx_t_11, __pyx_v_file);
    __pyx_t_12 = 0;
    __pyx_t_9 = 0;
    __pyx_t_8 = 0;
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":844
 *     output_results(conn, args.query, args.with_header, args.field_separator, args.null, file)
 * 
 *     conn.commit()             # <<<<<<<<<<<<<<
 * 
 * if __name__ == '__main__':
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_commit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __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;

  /* "minipg/minipg.py":822
 * 
 * 
 * def main(file):             # <<<<<<<<<<<<<<
 *     parser = ArgumentParser(description='Execute query and print results.')
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("minipg.minipg.main", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_parser);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_conn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_6minipg_6minipg_Connection __pyx_vtable_6minipg_6minipg_Connection;

static PyObject *__pyx_tp_new_6minipg_6minipg_Connection(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6minipg_6minipg_Connection *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6minipg_6minipg_Connection *)o);
  p->__pyx_vtab = __pyx_vtabptr_6minipg_6minipg_Connection;
  p->user = Py_None; Py_INCREF(Py_None);
  p->password = Py_None; Py_INCREF(Py_None);
  p->database = Py_None; Py_INCREF(Py_None);
  p->host = Py_None; Py_INCREF(Py_None);
  p->port = Py_None; Py_INCREF(Py_None);
  p->timeout = Py_None; Py_INCREF(Py_None);
  p->use_ssl = Py_None; Py_INCREF(Py_None);
  p->sock = Py_None; Py_INCREF(Py_None);
  p->_ready_for_query = Py_None; Py_INCREF(Py_None);
  p->encoding = Py_None; Py_INCREF(Py_None);
  p->encoders = Py_None; Py_INCREF(Py_None);
  p->autocommit = Py_None; Py_INCREF(Py_None);
  p->tzinfo = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6minipg_6minipg_Connection(PyObject *o) {
  struct __pyx_obj_6minipg_6minipg_Connection *p = (struct __pyx_obj_6minipg_6minipg_Connection *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->user);
  Py_CLEAR(p->password);
  Py_CLEAR(p->database);
  Py_CLEAR(p->host);
  Py_CLEAR(p->port);
  Py_CLEAR(p->timeout);
  Py_CLEAR(p->use_ssl);
  Py_CLEAR(p->sock);
  Py_CLEAR(p->_ready_for_query);
  Py_CLEAR(p->encoding);
  Py_CLEAR(p->encoders);
  Py_CLEAR(p->autocommit);
  Py_CLEAR(p->tzinfo);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6minipg_6minipg_Connection(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6minipg_6minipg_Connection *p = (struct __pyx_obj_6minipg_6minipg_Connection *)o;
  if (p->user) {
    e = (*v)(p->user, a); if (e) return e;
  }
  if (p->password) {
    e = (*v)(p->password, a); if (e) return e;
  }
  if (p->database) {
    e = (*v)(p->database, a); if (e) return e;
  }
  if (p->host) {
    e = (*v)(p->host, a); if (e) return e;
  }
  if (p->port) {
    e = (*v)(p->port, a); if (e) return e;
  }
  if (p->timeout) {
    e = (*v)(p->timeout, a); if (e) return e;
  }
  if (p->use_ssl) {
    e = (*v)(p->use_ssl, a); if (e) return e;
  }
  if (p->sock) {
    e = (*v)(p->sock, a); if (e) return e;
  }
  if (p->_ready_for_query) {
    e = (*v)(p->_ready_for_query, a); if (e) return e;
  }
  if (p->encoding) {
    e = (*v)(p->encoding, a); if (e) return e;
  }
  if (p->encoders) {
    e = (*v)(p->encoders, a); if (e) return e;
  }
  if (p->autocommit) {
    e = (*v)(p->autocommit, a); if (e) return e;
  }
  if (p->tzinfo) {
    e = (*v)(p->tzinfo, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6minipg_6minipg_Connection(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6minipg_6minipg_Connection *p = (struct __pyx_obj_6minipg_6minipg_Connection *)o;
  tmp = ((PyObject*)p->user);
  p->user = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->password);
  p->password = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->database);
  p->database = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->host);
  p->host = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->port);
  p->port = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->timeout);
  p->timeout = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->use_ssl);
  p->use_ssl = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->sock);
  p->sock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_ready_for_query);
  p->_ready_for_query = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->encoding);
  p->encoding = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->encoders);
  p->encoders = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->autocommit);
  p->autocommit = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tzinfo);
  p->tzinfo = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6minipg_6minipg_10Connection_is_dirty(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6minipg_6minipg_10Connection_8is_dirty_1__get__(o);
}

static PyObject *__pyx_getprop_6minipg_6minipg_10Connection_encoding(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6minipg_6minipg_10Connection_8encoding_1__get__(o);
}

static int __pyx_setprop_6minipg_6minipg_10Connection_encoding(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6minipg_6minipg_10Connection_8encoding_3__set__(o, v);
  }
  else {
    return __pyx_pw_6minipg_6minipg_10Connection_8encoding_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6minipg_6minipg_10Connection_encoders(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6minipg_6minipg_10Connection_8encoders_1__get__(o);
}

static int __pyx_setprop_6minipg_6minipg_10Connection_encoders(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6minipg_6minipg_10Connection_8encoders_3__set__(o, v);
  }
  else {
    return __pyx_pw_6minipg_6minipg_10Connection_8encoders_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6minipg_6minipg_10Connection_autocommit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6minipg_6minipg_10Connection_10autocommit_1__get__(o);
}

static int __pyx_setprop_6minipg_6minipg_10Connection_autocommit(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6minipg_6minipg_10Connection_10autocommit_3__set__(o, v);
  }
  else {
    return __pyx_pw_6minipg_6minipg_10Connection_10autocommit_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6minipg_6minipg_10Connection_tzinfo(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6minipg_6minipg_10Connection_6tzinfo_1__get__(o);
}

static int __pyx_setprop_6minipg_6minipg_10Connection_tzinfo(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6minipg_6minipg_10Connection_6tzinfo_3__set__(o, v);
  }
  else {
    return __pyx_pw_6minipg_6minipg_10Connection_6tzinfo_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6minipg_6minipg_Connection[] = {
  {"__enter__", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_3__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_5__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {"is_connect", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_9is_connect, METH_NOARGS, 0},
  {"cursor", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_11cursor, METH_NOARGS, 0},
  {"execute", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_13execute, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_autocommit", (PyCFunction)__pyx_pw_6minipg_6minipg_10Connection_15set_autocommit, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6minipg_6minipg_Connection[] = {
  {(char *)"is_dirty", __pyx_getprop_6minipg_6minipg_10Connection_is_dirty, 0, (char *)0, 0},
  {(char *)"encoding", __pyx_getprop_6minipg_6minipg_10Connection_encoding, __pyx_setprop_6minipg_6minipg_10Connection_encoding, (char *)0, 0},
  {(char *)"encoders", __pyx_getprop_6minipg_6minipg_10Connection_encoders, __pyx_setprop_6minipg_6minipg_10Connection_encoders, (char *)0, 0},
  {(char *)"autocommit", __pyx_getprop_6minipg_6minipg_10Connection_autocommit, __pyx_setprop_6minipg_6minipg_10Connection_autocommit, (char *)0, 0},
  {(char *)"tzinfo", __pyx_getprop_6minipg_6minipg_10Connection_tzinfo, __pyx_setprop_6minipg_6minipg_10Connection_tzinfo, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6minipg_6minipg_Connection = {
  PyVarObject_HEAD_INIT(0, 0)
  "minipg.minipg.Connection", /*tp_name*/
  sizeof(struct __pyx_obj_6minipg_6minipg_Connection), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6minipg_6minipg_Connection, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  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_6minipg_6minipg_Connection, /*tp_traverse*/
  __pyx_tp_clear_6minipg_6minipg_Connection, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6minipg_6minipg_Connection, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6minipg_6minipg_Connection, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6minipg_6minipg_10Connection_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6minipg_6minipg_Connection, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *__pyx_freelist_6minipg_6minipg___pyx_scope_struct__execute[8];
static int __pyx_freecount_6minipg_6minipg___pyx_scope_struct__execute = 0;

static PyObject *__pyx_tp_new_6minipg_6minipg___pyx_scope_struct__execute(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6minipg_6minipg___pyx_scope_struct__execute > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute)))) {
    o = (PyObject*)__pyx_freelist_6minipg_6minipg___pyx_scope_struct__execute[--__pyx_freecount_6minipg_6minipg___pyx_scope_struct__execute];
    memset(o, 0, sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6minipg_6minipg___pyx_scope_struct__execute(PyObject *o) {
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *p = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_args);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6minipg_6minipg___pyx_scope_struct__execute < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute)))) {
    __pyx_freelist_6minipg_6minipg___pyx_scope_struct__execute[__pyx_freecount_6minipg_6minipg___pyx_scope_struct__execute++] = ((struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6minipg_6minipg___pyx_scope_struct__execute(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *p = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *)o;
  if (p->__pyx_v_args) {
    e = (*v)(p->__pyx_v_args, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6minipg_6minipg___pyx_scope_struct__execute(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *p = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *)o;
  tmp = ((PyObject*)p->__pyx_v_args);
  p->__pyx_v_args = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6minipg_6minipg___pyx_scope_struct__execute = {
  PyVarObject_HEAD_INIT(0, 0)
  "minipg.minipg.__pyx_scope_struct__execute", /*tp_name*/
  sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6minipg_6minipg___pyx_scope_struct__execute, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  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_6minipg_6minipg___pyx_scope_struct__execute, /*tp_traverse*/
  __pyx_tp_clear_6minipg_6minipg___pyx_scope_struct__execute, /*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*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6minipg_6minipg___pyx_scope_struct__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
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *__pyx_freelist_6minipg_6minipg___pyx_scope_struct_1_genexpr[8];
static int __pyx_freecount_6minipg_6minipg___pyx_scope_struct_1_genexpr = 0;

static PyObject *__pyx_tp_new_6minipg_6minipg___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6minipg_6minipg___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr)))) {
    o = (PyObject*)__pyx_freelist_6minipg_6minipg___pyx_scope_struct_1_genexpr[--__pyx_freecount_6minipg_6minipg___pyx_scope_struct_1_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6minipg_6minipg___pyx_scope_struct_1_genexpr(PyObject *o) {
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_arg);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6minipg_6minipg___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr)))) {
    __pyx_freelist_6minipg_6minipg___pyx_scope_struct_1_genexpr[__pyx_freecount_6minipg_6minipg___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6minipg_6minipg___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6minipg_6minipg___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_v_arg) {
    e = (*v)(p->__pyx_v_arg, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6minipg_6minipg___pyx_scope_struct_1_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_6minipg_6minipg___pyx_scope_struct__execute *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_arg);
  p->__pyx_v_arg = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6minipg_6minipg___pyx_scope_struct_1_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "minipg.minipg.__pyx_scope_struct_1_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6minipg_6minipg___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  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_6minipg_6minipg___pyx_scope_struct_1_genexpr, /*tp_traverse*/
  __pyx_tp_clear_6minipg_6minipg___pyx_scope_struct_1_genexpr, /*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*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6minipg_6minipg___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
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *__pyx_freelist_6minipg_6minipg___pyx_scope_struct_2_output_results[8];
static int __pyx_freecount_6minipg_6minipg___pyx_scope_struct_2_output_results = 0;

static PyObject *__pyx_tp_new_6minipg_6minipg___pyx_scope_struct_2_output_results(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6minipg_6minipg___pyx_scope_struct_2_output_results > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results)))) {
    o = (PyObject*)__pyx_freelist_6minipg_6minipg___pyx_scope_struct_2_output_results[--__pyx_freecount_6minipg_6minipg___pyx_scope_struct_2_output_results];
    memset(o, 0, sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6minipg_6minipg___pyx_scope_struct_2_output_results(PyObject *o) {
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *p = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_null);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6minipg_6minipg___pyx_scope_struct_2_output_results < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results)))) {
    __pyx_freelist_6minipg_6minipg___pyx_scope_struct_2_output_results[__pyx_freecount_6minipg_6minipg___pyx_scope_struct_2_output_results++] = ((struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6minipg_6minipg___pyx_scope_struct_2_output_results(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *p = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *)o;
  if (p->__pyx_v_null) {
    e = (*v)(p->__pyx_v_null, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6minipg_6minipg___pyx_scope_struct_2_output_results(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *p = (struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results *)o;
  tmp = ((PyObject*)p->__pyx_v_null);
  p->__pyx_v_null = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6minipg_6minipg___pyx_scope_struct_2_output_results = {
  PyVarObject_HEAD_INIT(0, 0)
  "minipg.minipg.__pyx_scope_struct_2_output_results", /*tp_name*/
  sizeof(struct __pyx_obj_6minipg_6minipg___pyx_scope_struct_2_output_results), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6minipg_6minipg___pyx_scope_struct_2_output_results, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  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_6minipg_6minipg___pyx_scope_struct_2_output_results, /*tp_traverse*/
  __pyx_tp_clear_6minipg_6minipg___pyx_scope_struct_2_output_results, /*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*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6minipg_6minipg___pyx_scope_struct_2_output_results, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "minipg",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
  {&__pyx_kp_s_03o, __pyx_k_03o, sizeof(__pyx_k_03o), 0, 0, 1, 0},
  {&__pyx_kp_u_04d_02d_02d_02d_02d_02d, __pyx_k_04d_02d_02d_02d_02d_02d, sizeof(__pyx_k_04d_02d_02d_02d_02d_02d), 0, 1, 0, 0},
  {&__pyx_kp_u_08003_Can_t_recv_packets, __pyx_k_08003_Can_t_recv_packets, sizeof(__pyx_k_08003_Can_t_recv_packets), 0, 1, 0, 0},
  {&__pyx_kp_u_08003_Lost_connection, __pyx_k_08003_Lost_connection, sizeof(__pyx_k_08003_Lost_connection), 0, 1, 0, 0},
  {&__pyx_kp_s_1_day, __pyx_k_1_day, sizeof(__pyx_k_1_day), 0, 0, 1, 0},
  {&__pyx_kp_b_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 0, 0},
  {&__pyx_kp_s_2_0, __pyx_k_2_0, sizeof(__pyx_k_2_0), 0, 0, 1, 0},
  {&__pyx_n_s_AF_INET, __pyx_k_AF_INET, sizeof(__pyx_k_AF_INET), 0, 0, 1, 1},
  {&__pyx_kp_u_ARRAY, __pyx_k_ARRAY, sizeof(__pyx_k_ARRAY), 0, 1, 0, 0},
  {&__pyx_n_s_ArgumentParser, __pyx_k_ArgumentParser, sizeof(__pyx_k_ArgumentParser), 0, 0, 1, 1},
  {&__pyx_kp_s_Authentication_method_d_not_supp, __pyx_k_Authentication_method_d_not_supp, sizeof(__pyx_k_Authentication_method_d_not_supp), 0, 0, 1, 0},
  {&__pyx_n_s_BEGIN, __pyx_k_BEGIN, sizeof(__pyx_k_BEGIN), 0, 0, 1, 1},
  {&__pyx_kp_b_BEGIN_2, __pyx_k_BEGIN_2, sizeof(__pyx_k_BEGIN_2), 0, 0, 0, 0},
  {&__pyx_n_s_BINARY, __pyx_k_BINARY, sizeof(__pyx_k_BINARY), 0, 0, 1, 1},
  {&__pyx_n_s_Binary, __pyx_k_Binary, sizeof(__pyx_k_Binary), 0, 0, 1, 1},
  {&__pyx_n_s_COMMIT, __pyx_k_COMMIT, sizeof(__pyx_k_COMMIT), 0, 0, 1, 1},
  {&__pyx_kp_b_COMMIT_2, __pyx_k_COMMIT_2, sizeof(__pyx_k_COMMIT_2), 0, 0, 0, 0},
  {&__pyx_n_s_Connection___enter, __pyx_k_Connection___enter, sizeof(__pyx_k_Connection___enter), 0, 0, 1, 1},
  {&__pyx_n_s_Connection___exit, __pyx_k_Connection___exit, sizeof(__pyx_k_Connection___exit), 0, 0, 1, 1},
  {&__pyx_kp_s_Connection__execute_s, __pyx_k_Connection__execute_s, sizeof(__pyx_k_Connection__execute_s), 0, 0, 1, 0},
  {&__pyx_n_s_Connection_begin, __pyx_k_Connection_begin, sizeof(__pyx_k_Connection_begin), 0, 0, 1, 1},
  {&__pyx_kp_s_Connection_close, __pyx_k_Connection_close, sizeof(__pyx_k_Connection_close), 0, 0, 1, 0},
  {&__pyx_n_s_Connection_close_2, __pyx_k_Connection_close_2, sizeof(__pyx_k_Connection_close_2), 0, 0, 1, 1},
  {&__pyx_n_s_Connection_commit, __pyx_k_Connection_commit, sizeof(__pyx_k_Connection_commit), 0, 0, 1, 1},
  {&__pyx_n_s_Connection_cursor, __pyx_k_Connection_cursor, sizeof(__pyx_k_Connection_cursor), 0, 0, 1, 1},
  {&__pyx_n_s_Connection_escape_parameter, __pyx_k_Connection_escape_parameter, sizeof(__pyx_k_Connection_escape_parameter), 0, 0, 1, 1},
  {&__pyx_n_s_Connection_execute, __pyx_k_Connection_execute, sizeof(__pyx_k_Connection_execute), 0, 0, 1, 1},
  {&__pyx_n_s_Connection_is_connect, __pyx_k_Connection_is_connect, sizeof(__pyx_k_Connection_is_connect), 0, 0, 1, 1},
  {&__pyx_n_s_Connection_reopen, __pyx_k_Connection_reopen, sizeof(__pyx_k_Connection_reopen), 0, 0, 1, 1},
  {&__pyx_n_s_Connection_rollback, __pyx_k_Connection_rollback, sizeof(__pyx_k_Connection_rollback), 0, 0, 1, 1},
  {&__pyx_n_s_Connection_set_autocommit, __pyx_k_Connection_set_autocommit, sizeof(__pyx_k_Connection_set_autocommit), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor, __pyx_k_Cursor, sizeof(__pyx_k_Cursor), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor___enter, __pyx_k_Cursor___enter, sizeof(__pyx_k_Cursor___enter), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor___exit, __pyx_k_Cursor___exit, sizeof(__pyx_k_Cursor___exit), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor___init, __pyx_k_Cursor___init, sizeof(__pyx_k_Cursor___init), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor___iter, __pyx_k_Cursor___iter, sizeof(__pyx_k_Cursor___iter), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor___next, __pyx_k_Cursor___next, sizeof(__pyx_k_Cursor___next), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_callproc, __pyx_k_Cursor_callproc, sizeof(__pyx_k_Cursor_callproc), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_close, __pyx_k_Cursor_close, sizeof(__pyx_k_Cursor_close), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_closed, __pyx_k_Cursor_closed, sizeof(__pyx_k_Cursor_closed), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_execute, __pyx_k_Cursor_execute, sizeof(__pyx_k_Cursor_execute), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_execute_locals_genexpr, __pyx_k_Cursor_execute_locals_genexpr, sizeof(__pyx_k_Cursor_execute_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_executemany, __pyx_k_Cursor_executemany, sizeof(__pyx_k_Cursor_executemany), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_fetchall, __pyx_k_Cursor_fetchall, sizeof(__pyx_k_Cursor_fetchall), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_fetchmany, __pyx_k_Cursor_fetchmany, sizeof(__pyx_k_Cursor_fetchmany), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_fetchone, __pyx_k_Cursor_fetchone, sizeof(__pyx_k_Cursor_fetchone), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_next, __pyx_k_Cursor_next, sizeof(__pyx_k_Cursor_next), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_nextset, __pyx_k_Cursor_nextset, sizeof(__pyx_k_Cursor_nextset), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_rowcount, __pyx_k_Cursor_rowcount, sizeof(__pyx_k_Cursor_rowcount), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_setinputsizes, __pyx_k_Cursor_setinputsizes, sizeof(__pyx_k_Cursor_setinputsizes), 0, 0, 1, 1},
  {&__pyx_n_s_Cursor_setoutputsize, __pyx_k_Cursor_setoutputsize, sizeof(__pyx_k_Cursor_setoutputsize), 0, 0, 1, 1},
  {&__pyx_kp_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 0},
  {&__pyx_n_s_DATE, __pyx_k_DATE, sizeof(__pyx_k_DATE), 0, 0, 1, 1},
  {&__pyx_n_s_DATETIME, __pyx_k_DATETIME, sizeof(__pyx_k_DATETIME), 0, 0, 1, 1},
  {&__pyx_n_s_DBAPITypeObject, __pyx_k_DBAPITypeObject, sizeof(__pyx_k_DBAPITypeObject), 0, 0, 1, 1},
  {&__pyx_n_s_DBAPITypeObject___cmp, __pyx_k_DBAPITypeObject___cmp, sizeof(__pyx_k_DBAPITypeObject___cmp), 0, 0, 1, 1},
  {&__pyx_n_s_DBAPITypeObject___init, __pyx_k_DBAPITypeObject___init, sizeof(__pyx_k_DBAPITypeObject___init), 0, 0, 1, 1},
  {&__pyx_n_s_DEBUG, __pyx_k_DEBUG, sizeof(__pyx_k_DEBUG), 0, 0, 1, 1},
  {&__pyx_n_s_DELETE, __pyx_k_DELETE, sizeof(__pyx_k_DELETE), 0, 0, 1, 1},
  {&__pyx_n_s_DataError, __pyx_k_DataError, sizeof(__pyx_k_DataError), 0, 0, 1, 1},
  {&__pyx_n_s_DatabaseError, __pyx_k_DatabaseError, sizeof(__pyx_k_DatabaseError), 0, 0, 1, 1},
  {&__pyx_kp_b_Database_Error, __pyx_k_Database_Error, sizeof(__pyx_k_Database_Error), 0, 0, 0, 0},
  {&__pyx_n_s_Date, __pyx_k_Date, sizeof(__pyx_k_Date), 0, 0, 1, 1},
  {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1},
  {&__pyx_n_s_DisconnectByPeer, __pyx_k_DisconnectByPeer, sizeof(__pyx_k_DisconnectByPeer), 0, 0, 1, 1},
  {&__pyx_n_b_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 0, 1},
  {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1},
  {&__pyx_n_s_Error___init, __pyx_k_Error___init, sizeof(__pyx_k_Error___init), 0, 0, 1, 1},
  {&__pyx_n_s_Error___repr, __pyx_k_Error___repr, sizeof(__pyx_k_Error___repr), 0, 0, 1, 1},
  {&__pyx_n_s_Error___str, __pyx_k_Error___str, sizeof(__pyx_k_Error___str), 0, 0, 1, 1},
  {&__pyx_kp_s_Execute_query_and_print_results, __pyx_k_Execute_query_and_print_results, sizeof(__pyx_k_Execute_query_and_print_results), 0, 0, 1, 0},
  {&__pyx_kp_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 0},
  {&__pyx_n_u_FALSE, __pyx_k_FALSE, sizeof(__pyx_k_FALSE), 0, 1, 0, 1},
  {&__pyx_kp_b_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 0, 0},
  {&__pyx_kp_s_H_2, __pyx_k_H_2, sizeof(__pyx_k_H_2), 0, 0, 1, 0},
  {&__pyx_kp_s_H_M_S, __pyx_k_H_M_S, sizeof(__pyx_k_H_M_S), 0, 0, 1, 0},
  {&__pyx_kp_s_H_M_S_f, __pyx_k_H_M_S_f, sizeof(__pyx_k_H_M_S_f), 0, 0, 1, 0},
  {&__pyx_n_b_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 0, 1},
  {&__pyx_n_s_INSERT, __pyx_k_INSERT, sizeof(__pyx_k_INSERT), 0, 0, 1, 1},
  {&__pyx_n_s_IntegrityError, __pyx_k_IntegrityError, sizeof(__pyx_k_IntegrityError), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceError, __pyx_k_InterfaceError, sizeof(__pyx_k_InterfaceError), 0, 0, 1, 1},
  {&__pyx_n_s_InternalError, __pyx_k_InternalError, sizeof(__pyx_k_InternalError), 0, 0, 1, 1},
  {&__pyx_n_s_InternalError___init, __pyx_k_InternalError___init, sizeof(__pyx_k_InternalError___init), 0, 0, 1, 1},
  {&__pyx_kp_s_NO_DECODE_type_d, __pyx_k_NO_DECODE_type_d, sizeof(__pyx_k_NO_DECODE_type_d), 0, 0, 1, 0},
  {&__pyx_n_s_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 0, 1, 1},
  {&__pyx_n_s_NUMBER, __pyx_k_NUMBER, sizeof(__pyx_k_NUMBER), 0, 0, 1, 1},
  {&__pyx_kp_s_No_output_header, __pyx_k_No_output_header, sizeof(__pyx_k_No_output_header), 0, 0, 1, 0},
  {&__pyx_n_s_NotSupportedError, __pyx_k_NotSupportedError, sizeof(__pyx_k_NotSupportedError), 0, 0, 1, 1},
  {&__pyx_n_s_NotSupportedError___init, __pyx_k_NotSupportedError___init, sizeof(__pyx_k_NotSupportedError___init), 0, 0, 1, 1},
  {&__pyx_n_s_OperationalError, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1},
  {&__pyx_kp_s_Output_header, __pyx_k_Output_header, sizeof(__pyx_k_Output_header), 0, 0, 1, 0},
  {&__pyx_kp_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 0},
  {&__pyx_n_s_PG_TYPE_ABSTIME, __pyx_k_PG_TYPE_ABSTIME, sizeof(__pyx_k_PG_TYPE_ABSTIME), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_ACLITEM, __pyx_k_PG_TYPE_ACLITEM, sizeof(__pyx_k_PG_TYPE_ACLITEM), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_ANY, __pyx_k_PG_TYPE_ANY, sizeof(__pyx_k_PG_TYPE_ANY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_ANYARRAY, __pyx_k_PG_TYPE_ANYARRAY, sizeof(__pyx_k_PG_TYPE_ANYARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_ANYELEMENT, __pyx_k_PG_TYPE_ANYELEMENT, sizeof(__pyx_k_PG_TYPE_ANYELEMENT), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_ANYENUM, __pyx_k_PG_TYPE_ANYENUM, sizeof(__pyx_k_PG_TYPE_ANYENUM), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_ANYNONARRAY, __pyx_k_PG_TYPE_ANYNONARRAY, sizeof(__pyx_k_PG_TYPE_ANYNONARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_ANYRANGE, __pyx_k_PG_TYPE_ANYRANGE, sizeof(__pyx_k_PG_TYPE_ANYRANGE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_ARRAYOID, __pyx_k_PG_TYPE_ARRAYOID, sizeof(__pyx_k_PG_TYPE_ARRAYOID), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_BIT, __pyx_k_PG_TYPE_BIT, sizeof(__pyx_k_PG_TYPE_BIT), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_BOOL, __pyx_k_PG_TYPE_BOOL, sizeof(__pyx_k_PG_TYPE_BOOL), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_BOX, __pyx_k_PG_TYPE_BOX, sizeof(__pyx_k_PG_TYPE_BOX), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_BPCHAR, __pyx_k_PG_TYPE_BPCHAR, sizeof(__pyx_k_PG_TYPE_BPCHAR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_BYTEA, __pyx_k_PG_TYPE_BYTEA, sizeof(__pyx_k_PG_TYPE_BYTEA), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_CASH, __pyx_k_PG_TYPE_CASH, sizeof(__pyx_k_PG_TYPE_CASH), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_CHAR, __pyx_k_PG_TYPE_CHAR, sizeof(__pyx_k_PG_TYPE_CHAR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_CID, __pyx_k_PG_TYPE_CID, sizeof(__pyx_k_PG_TYPE_CID), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_CIDR, __pyx_k_PG_TYPE_CIDR, sizeof(__pyx_k_PG_TYPE_CIDR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_CIRCLE, __pyx_k_PG_TYPE_CIRCLE, sizeof(__pyx_k_PG_TYPE_CIRCLE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_CSTRING, __pyx_k_PG_TYPE_CSTRING, sizeof(__pyx_k_PG_TYPE_CSTRING), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_CSTRINGARRAY, __pyx_k_PG_TYPE_CSTRINGARRAY, sizeof(__pyx_k_PG_TYPE_CSTRINGARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_DATE, __pyx_k_PG_TYPE_DATE, sizeof(__pyx_k_PG_TYPE_DATE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_EVTTRIGGER, __pyx_k_PG_TYPE_EVTTRIGGER, sizeof(__pyx_k_PG_TYPE_EVTTRIGGER), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_FDW_HANDLER, __pyx_k_PG_TYPE_FDW_HANDLER, sizeof(__pyx_k_PG_TYPE_FDW_HANDLER), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_FLOAT4, __pyx_k_PG_TYPE_FLOAT4, sizeof(__pyx_k_PG_TYPE_FLOAT4), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_FLOAT4ARRAY, __pyx_k_PG_TYPE_FLOAT4ARRAY, sizeof(__pyx_k_PG_TYPE_FLOAT4ARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_FLOAT8, __pyx_k_PG_TYPE_FLOAT8, sizeof(__pyx_k_PG_TYPE_FLOAT8), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_GTSVECTOR, __pyx_k_PG_TYPE_GTSVECTOR, sizeof(__pyx_k_PG_TYPE_GTSVECTOR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INET, __pyx_k_PG_TYPE_INET, sizeof(__pyx_k_PG_TYPE_INET), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INT2, __pyx_k_PG_TYPE_INT2, sizeof(__pyx_k_PG_TYPE_INT2), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INT2ARRAY, __pyx_k_PG_TYPE_INT2ARRAY, sizeof(__pyx_k_PG_TYPE_INT2ARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INT2VECTOR, __pyx_k_PG_TYPE_INT2VECTOR, sizeof(__pyx_k_PG_TYPE_INT2VECTOR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INT4, __pyx_k_PG_TYPE_INT4, sizeof(__pyx_k_PG_TYPE_INT4), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INT4ARRAY, __pyx_k_PG_TYPE_INT4ARRAY, sizeof(__pyx_k_PG_TYPE_INT4ARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INT4RANGE, __pyx_k_PG_TYPE_INT4RANGE, sizeof(__pyx_k_PG_TYPE_INT4RANGE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INT8, __pyx_k_PG_TYPE_INT8, sizeof(__pyx_k_PG_TYPE_INT8), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INTERNAL, __pyx_k_PG_TYPE_INTERNAL, sizeof(__pyx_k_PG_TYPE_INTERNAL), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_INTERVAL, __pyx_k_PG_TYPE_INTERVAL, sizeof(__pyx_k_PG_TYPE_INTERVAL), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_JSON, __pyx_k_PG_TYPE_JSON, sizeof(__pyx_k_PG_TYPE_JSON), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_LANGUAGE_HANDLER, __pyx_k_PG_TYPE_LANGUAGE_HANDLER, sizeof(__pyx_k_PG_TYPE_LANGUAGE_HANDLER), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_LINE, __pyx_k_PG_TYPE_LINE, sizeof(__pyx_k_PG_TYPE_LINE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_LSEG, __pyx_k_PG_TYPE_LSEG, sizeof(__pyx_k_PG_TYPE_LSEG), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_MACADDR, __pyx_k_PG_TYPE_MACADDR, sizeof(__pyx_k_PG_TYPE_MACADDR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_NAME, __pyx_k_PG_TYPE_NAME, sizeof(__pyx_k_PG_TYPE_NAME), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_NAMEARRAY, __pyx_k_PG_TYPE_NAMEARRAY, sizeof(__pyx_k_PG_TYPE_NAMEARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_NUMERIC, __pyx_k_PG_TYPE_NUMERIC, sizeof(__pyx_k_PG_TYPE_NUMERIC), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_OID, __pyx_k_PG_TYPE_OID, sizeof(__pyx_k_PG_TYPE_OID), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_OPAQUE, __pyx_k_PG_TYPE_OPAQUE, sizeof(__pyx_k_PG_TYPE_OPAQUE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_PATH, __pyx_k_PG_TYPE_PATH, sizeof(__pyx_k_PG_TYPE_PATH), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_PGNODETREE, __pyx_k_PG_TYPE_PGNODETREE, sizeof(__pyx_k_PG_TYPE_PGNODETREE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_POINT, __pyx_k_PG_TYPE_POINT, sizeof(__pyx_k_PG_TYPE_POINT), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_POLYGON, __pyx_k_PG_TYPE_POLYGON, sizeof(__pyx_k_PG_TYPE_POLYGON), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_RECORD, __pyx_k_PG_TYPE_RECORD, sizeof(__pyx_k_PG_TYPE_RECORD), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_RECORDARRAY, __pyx_k_PG_TYPE_RECORDARRAY, sizeof(__pyx_k_PG_TYPE_RECORDARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REFCURSOR, __pyx_k_PG_TYPE_REFCURSOR, sizeof(__pyx_k_PG_TYPE_REFCURSOR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGCLASS, __pyx_k_PG_TYPE_REGCLASS, sizeof(__pyx_k_PG_TYPE_REGCLASS), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGCONFIG, __pyx_k_PG_TYPE_REGCONFIG, sizeof(__pyx_k_PG_TYPE_REGCONFIG), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGDICTIONARY, __pyx_k_PG_TYPE_REGDICTIONARY, sizeof(__pyx_k_PG_TYPE_REGDICTIONARY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGOPER, __pyx_k_PG_TYPE_REGOPER, sizeof(__pyx_k_PG_TYPE_REGOPER), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGOPERATOR, __pyx_k_PG_TYPE_REGOPERATOR, sizeof(__pyx_k_PG_TYPE_REGOPERATOR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGPROC, __pyx_k_PG_TYPE_REGPROC, sizeof(__pyx_k_PG_TYPE_REGPROC), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGPROCEDURE, __pyx_k_PG_TYPE_REGPROCEDURE, sizeof(__pyx_k_PG_TYPE_REGPROCEDURE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGTYPE, __pyx_k_PG_TYPE_REGTYPE, sizeof(__pyx_k_PG_TYPE_REGTYPE), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_REGTYPEARRAY, __pyx_k_PG_TYPE_REGTYPEARRAY, sizeof(__pyx_k_PG_TYPE_REGTYPEARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_RELTIME, __pyx_k_PG_TYPE_RELTIME, sizeof(__pyx_k_PG_TYPE_RELTIME), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TEXT, __pyx_k_PG_TYPE_TEXT, sizeof(__pyx_k_PG_TYPE_TEXT), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TEXTARRAY, __pyx_k_PG_TYPE_TEXTARRAY, sizeof(__pyx_k_PG_TYPE_TEXTARRAY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TID, __pyx_k_PG_TYPE_TID, sizeof(__pyx_k_PG_TYPE_TID), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TIME, __pyx_k_PG_TYPE_TIME, sizeof(__pyx_k_PG_TYPE_TIME), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TIMESTAMP, __pyx_k_PG_TYPE_TIMESTAMP, sizeof(__pyx_k_PG_TYPE_TIMESTAMP), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TIMESTAMPTZ, __pyx_k_PG_TYPE_TIMESTAMPTZ, sizeof(__pyx_k_PG_TYPE_TIMESTAMPTZ), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TIMETZ, __pyx_k_PG_TYPE_TIMETZ, sizeof(__pyx_k_PG_TYPE_TIMETZ), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TINTERVAL, __pyx_k_PG_TYPE_TINTERVAL, sizeof(__pyx_k_PG_TYPE_TINTERVAL), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TRIGGER, __pyx_k_PG_TYPE_TRIGGER, sizeof(__pyx_k_PG_TYPE_TRIGGER), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TSQUERY, __pyx_k_PG_TYPE_TSQUERY, sizeof(__pyx_k_PG_TYPE_TSQUERY), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_TSVECTOR, __pyx_k_PG_TYPE_TSVECTOR, sizeof(__pyx_k_PG_TYPE_TSVECTOR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_UNKNOWN, __pyx_k_PG_TYPE_UNKNOWN, sizeof(__pyx_k_PG_TYPE_UNKNOWN), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_UUID, __pyx_k_PG_TYPE_UUID, sizeof(__pyx_k_PG_TYPE_UUID), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_VARBIT, __pyx_k_PG_TYPE_VARBIT, sizeof(__pyx_k_PG_TYPE_VARBIT), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_VARCHAR, __pyx_k_PG_TYPE_VARCHAR, sizeof(__pyx_k_PG_TYPE_VARCHAR), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_VECTOROID, __pyx_k_PG_TYPE_VECTOROID, sizeof(__pyx_k_PG_TYPE_VECTOROID), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_VOID, __pyx_k_PG_TYPE_VOID, sizeof(__pyx_k_PG_TYPE_VOID), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_XID, __pyx_k_PG_TYPE_XID, sizeof(__pyx_k_PG_TYPE_XID), 0, 0, 1, 1},
  {&__pyx_n_s_PG_TYPE_XML, __pyx_k_PG_TYPE_XML, sizeof(__pyx_k_PG_TYPE_XML), 0, 0, 1, 1},
  {&__pyx_n_s_PY2, __pyx_k_PY2, sizeof(__pyx_k_PY2), 0, 0, 1, 1},
  {&__pyx_n_s_ProgrammingError, __pyx_k_ProgrammingError, sizeof(__pyx_k_ProgrammingError), 0, 0, 1, 1},
  {&__pyx_n_b_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 0, 1},
  {&__pyx_kp_s_Q_2, __pyx_k_Q_2, sizeof(__pyx_k_Q_2), 0, 0, 1, 0},
  {&__pyx_n_s_ROLLBACK, __pyx_k_ROLLBACK, sizeof(__pyx_k_ROLLBACK), 0, 0, 1, 1},
  {&__pyx_kp_b_ROLLBACK_2, __pyx_k_ROLLBACK_2, sizeof(__pyx_k_ROLLBACK_2), 0, 0, 0, 0},
  {&__pyx_n_s_ROWID, __pyx_k_ROWID, sizeof(__pyx_k_ROWID), 0, 0, 1, 1},
  {&__pyx_n_b_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 0, 1},
  {&__pyx_n_s_SELECT, __pyx_k_SELECT, sizeof(__pyx_k_SELECT), 0, 0, 1, 1},
  {&__pyx_n_s_SHOW, __pyx_k_SHOW, sizeof(__pyx_k_SHOW), 0, 0, 1, 1},
  {&__pyx_n_s_SOCK_STREAM, __pyx_k_SOCK_STREAM, sizeof(__pyx_k_SOCK_STREAM), 0, 0, 1, 1},
  {&__pyx_n_s_STRING, __pyx_k_STRING, sizeof(__pyx_k_STRING), 0, 0, 1, 1},
  {&__pyx_kp_s_Server_refuses_SSL, __pyx_k_Server_refuses_SSL, sizeof(__pyx_k_Server_refuses_SSL), 0, 0, 1, 0},
  {&__pyx_n_s_StandardError, __pyx_k_StandardError, sizeof(__pyx_k_StandardError), 0, 0, 1, 1},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_b_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 0, 1},
  {&__pyx_n_b_TE, __pyx_k_TE, sizeof(__pyx_k_TE), 0, 0, 0, 1},
  {&__pyx_n_s_TIME, __pyx_k_TIME, sizeof(__pyx_k_TIME), 0, 0, 1, 1},
  {&__pyx_n_u_TRUE, __pyx_k_TRUE, sizeof(__pyx_k_TRUE), 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_s_Timestamp, __pyx_k_Timestamp, sizeof(__pyx_k_Timestamp), 0, 0, 1, 1},
  {&__pyx_kp_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 0},
  {&__pyx_n_s_UPDATE, __pyx_k_UPDATE, sizeof(__pyx_k_UPDATE), 0, 0, 1, 1},
  {&__pyx_n_s_UTC, __pyx_k_UTC, sizeof(__pyx_k_UTC), 0, 0, 1, 1},
  {&__pyx_n_s_UTC_dst, __pyx_k_UTC_dst, sizeof(__pyx_k_UTC_dst), 0, 0, 1, 1},
  {&__pyx_n_s_UTC_tzname, __pyx_k_UTC_tzname, sizeof(__pyx_k_UTC_tzname), 0, 0, 1, 1},
  {&__pyx_n_s_UTC_utcoffset, __pyx_k_UTC_utcoffset, sizeof(__pyx_k_UTC_utcoffset), 0, 0, 1, 1},
  {&__pyx_n_s_UTF8, __pyx_k_UTF8, sizeof(__pyx_k_UTF8), 0, 0, 1, 1},
  {&__pyx_n_s_UUID, __pyx_k_UUID, sizeof(__pyx_k_UUID), 0, 0, 1, 1},
  {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Unknown_oid, __pyx_k_Unknown_oid, sizeof(__pyx_k_Unknown_oid), 0, 0, 1, 0},
  {&__pyx_n_s_VERSION, __pyx_k_VERSION, sizeof(__pyx_k_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 0},
  {&__pyx_n_s_Warning, __pyx_k_Warning, sizeof(__pyx_k_Warning), 0, 0, 1, 1},
  {&__pyx_kp_b_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 0, 0},
  {&__pyx_kp_s_Y_m_d, __pyx_k_Y_m_d, sizeof(__pyx_k_Y_m_d), 0, 0, 1, 0},
  {&__pyx_kp_s_Y_m_d_H_M_S, __pyx_k_Y_m_d_H_M_S, sizeof(__pyx_k_Y_m_d_H_M_S), 0, 0, 1, 0},
  {&__pyx_kp_s_Y_m_d_H_M_S_f, __pyx_k_Y_m_d_H_M_S_f, sizeof(__pyx_k_Y_m_d_H_M_S_f), 0, 0, 1, 0},
  {&__pyx_kp_b__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 0, 0},
  {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0},
  {&__pyx_kp_s__18, __pyx_k__18, sizeof(__pyx_k__18), 0, 0, 1, 0},
  {&__pyx_kp_b__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 0, 0},
  {&__pyx_kp_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 0},
  {&__pyx_kp_s__33, __pyx_k__33, sizeof(__pyx_k__33), 0, 0, 1, 0},
  {&__pyx_kp_s__35, __pyx_k__35, sizeof(__pyx_k__35), 0, 0, 1, 0},
  {&__pyx_kp_u__38, __pyx_k__38, sizeof(__pyx_k__38), 0, 1, 0, 0},
  {&__pyx_kp_u__39, __pyx_k__39, sizeof(__pyx_k__39), 0, 1, 0, 0},
  {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
  {&__pyx_kp_b__50, __pyx_k__50, sizeof(__pyx_k__50), 0, 0, 0, 0},
  {&__pyx_kp_b__56, __pyx_k__56, sizeof(__pyx_k__56), 0, 0, 0, 0},
  {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
  {&__pyx_kp_b__66, __pyx_k__66, sizeof(__pyx_k__66), 0, 0, 0, 0},
  {&__pyx_kp_s__69, __pyx_k__69, sizeof(__pyx_k__69), 0, 0, 1, 0},
  {&__pyx_kp_u__69, __pyx_k__69, sizeof(__pyx_k__69), 0, 1, 0, 0},
  {&__pyx_kp_s__70, __pyx_k__70, sizeof(__pyx_k__70), 0, 0, 1, 0},
  {&__pyx_kp_u__70, __pyx_k__70, sizeof(__pyx_k__70), 0, 1, 0, 0},
  {&__pyx_kp_u__73, __pyx_k__73, sizeof(__pyx_k__73), 0, 1, 0, 0},
  {&__pyx_kp_s__74, __pyx_k__74, sizeof(__pyx_k__74), 0, 0, 1, 0},
  {&__pyx_kp_s__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 0, 1, 0},
  {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0},
  {&__pyx_n_s_action, __pyx_k_action, sizeof(__pyx_k_action), 0, 0, 1, 1},
  {&__pyx_n_s_add_argument, __pyx_k_add_argument, sizeof(__pyx_k_add_argument), 0, 0, 1, 1},
  {&__pyx_n_s_apilevel, __pyx_k_apilevel, sizeof(__pyx_k_apilevel), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_argparse, __pyx_k_argparse, sizeof(__pyx_k_argparse), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_arraysize, __pyx_k_arraysize, sizeof(__pyx_k_arraysize), 0, 0, 1, 1},
  {&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
  {&__pyx_n_s_autocommit, __pyx_k_autocommit, sizeof(__pyx_k_autocommit), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_b2a_hex, __pyx_k_b2a_hex, sizeof(__pyx_k_b2a_hex), 0, 0, 1, 1},
  {&__pyx_n_s_begin, __pyx_k_begin, sizeof(__pyx_k_begin), 0, 0, 1, 1},
  {&__pyx_n_s_big, __pyx_k_big, sizeof(__pyx_k_big), 0, 0, 1, 1},
  {&__pyx_n_s_binascii, __pyx_k_binascii, sizeof(__pyx_k_binascii), 0, 0, 1, 1},
  {&__pyx_kp_s_bytea, __pyx_k_bytea, sizeof(__pyx_k_bytea), 0, 0, 1, 0},
  {&__pyx_n_s_byteorder, __pyx_k_byteorder, sizeof(__pyx_k_byteorder), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_kp_b_c_S, __pyx_k_c_S, sizeof(__pyx_k_c_S), 0, 0, 0, 0},
  {&__pyx_n_s_callproc, __pyx_k_callproc, sizeof(__pyx_k_callproc), 0, 0, 1, 1},
  {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_cli, __pyx_k_cli, sizeof(__pyx_k_cli), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
  {&__pyx_n_s_cmp, __pyx_k_cmp, sizeof(__pyx_k_cmp), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_column, __pyx_k_column, sizeof(__pyx_k_column), 0, 0, 1, 1},
  {&__pyx_n_s_commit, __pyx_k_commit, sizeof(__pyx_k_commit), 0, 0, 1, 1},
  {&__pyx_n_s_conn, __pyx_k_conn, sizeof(__pyx_k_conn), 0, 0, 1, 1},
  {&__pyx_n_s_connect, __pyx_k_connect, sizeof(__pyx_k_connect), 0, 0, 1, 1},
  {&__pyx_n_s_connection, __pyx_k_connection, sizeof(__pyx_k_connection), 0, 0, 1, 1},
  {&__pyx_n_s_cur, __pyx_k_cur, sizeof(__pyx_k_cur), 0, 0, 1, 1},
  {&__pyx_n_s_cursor, __pyx_k_cursor, sizeof(__pyx_k_cursor), 0, 0, 1, 1},
  {&__pyx_n_b_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 0, 1},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_kp_s_d_i_s, __pyx_k_d_i_s, sizeof(__pyx_k_d_i_s), 0, 0, 1, 0},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_database, __pyx_k_database, sizeof(__pyx_k_database), 0, 0, 1, 1},
  {&__pyx_kp_b_database_2, __pyx_k_database_2, sizeof(__pyx_k_database_2), 0, 0, 0, 0},
  {&__pyx_kp_s_database_3, __pyx_k_database_3, sizeof(__pyx_k_database_3), 0, 0, 1, 0},
  {&__pyx_kp_s_database_name, __pyx_k_database_name, sizeof(__pyx_k_database_name), 0, 0, 1, 0},
  {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
  {&__pyx_kp_s_date_2, __pyx_k_date_2, sizeof(__pyx_k_date_2), 0, 0, 1, 0},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_day, __pyx_k_day, sizeof(__pyx_k_day), 0, 0, 1, 1},
  {&__pyx_n_s_days, __pyx_k_days, sizeof(__pyx_k_days), 0, 0, 1, 1},
  {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1},
  {&__pyx_kp_s_decimal_2, __pyx_k_decimal_2, sizeof(__pyx_k_decimal_2), 0, 0, 1, 0},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_decode_column_locals__get_timez, __pyx_k_decode_column_locals__get_timez, sizeof(__pyx_k_decode_column_locals__get_timez), 0, 0, 1, 1},
  {&__pyx_n_s_decode_column_locals__parse_poi, __pyx_k_decode_column_locals__parse_poi, sizeof(__pyx_k_decode_column_locals__parse_poi), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1},
  {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1},
  {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_dst, __pyx_k_dst, sizeof(__pyx_k_dst), 0, 0, 1, 1},
  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_escape_parameter, __pyx_k_escape_parameter, sizeof(__pyx_k_escape_parameter), 0, 0, 1, 1},
  {&__pyx_n_s_escaped_args, __pyx_k_escaped_args, sizeof(__pyx_k_escaped_args), 0, 0, 1, 1},
  {&__pyx_n_s_eval, __pyx_k_eval, sizeof(__pyx_k_eval), 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_executemany, __pyx_k_executemany, sizeof(__pyx_k_executemany), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
  {&__pyx_n_s_false, __pyx_k_false, sizeof(__pyx_k_false), 0, 0, 1, 1},
  {&__pyx_n_s_fetchall, __pyx_k_fetchall, sizeof(__pyx_k_fetchall), 0, 0, 1, 1},
  {&__pyx_n_s_fetchmany, __pyx_k_fetchmany, sizeof(__pyx_k_fetchmany), 0, 0, 1, 1},
  {&__pyx_n_s_fetchone, __pyx_k_fetchone, sizeof(__pyx_k_fetchone), 0, 0, 1, 1},
  {&__pyx_kp_s_field_separator, __pyx_k_field_separator, sizeof(__pyx_k_field_separator), 0, 0, 1, 0},
  {&__pyx_n_s_field_separator_2, __pyx_k_field_separator_2, sizeof(__pyx_k_field_separator_2), 0, 0, 1, 1},
  {&__pyx_kp_s_field_separator_3, __pyx_k_field_separator_3, sizeof(__pyx_k_field_separator_3), 0, 0, 1, 0},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_find, __pyx_k_find, sizeof(__pyx_k_find), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_from_bytes, __pyx_k_from_bytes, sizeof(__pyx_k_from_bytes), 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_timezone_offset, __pyx_k_get_timezone_offset, sizeof(__pyx_k_get_timezone_offset), 0, 0, 1, 1},
  {&__pyx_n_s_hashlib, __pyx_k_hashlib, sizeof(__pyx_k_hashlib), 0, 0, 1, 1},
  {&__pyx_kp_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 0},
  {&__pyx_n_s_help, __pyx_k_help, sizeof(__pyx_k_help), 0, 0, 1, 1},
  {&__pyx_n_s_hex_str, __pyx_k_hex_str, sizeof(__pyx_k_hex_str), 0, 0, 1, 1},
  {&__pyx_n_s_hexdigest, __pyx_k_hexdigest, sizeof(__pyx_k_hexdigest), 0, 0, 1, 1},
  {&__pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_k_home_nakagami_minipg_minipg_min, sizeof(__pyx_k_home_nakagami_minipg_minipg_min), 0, 0, 1, 0},
  {&__pyx_n_s_host, __pyx_k_host, sizeof(__pyx_k_host), 0, 0, 1, 1},
  {&__pyx_kp_s_host_2, __pyx_k_host_2, sizeof(__pyx_k_host_2), 0, 0, 1, 0},
  {&__pyx_kp_s_host_name, __pyx_k_host_name, sizeof(__pyx_k_host_name), 0, 0, 1, 0},
  {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
  {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_ia, __pyx_k_ia, sizeof(__pyx_k_ia), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_kp_u_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 1, 0, 0},
  {&__pyx_n_s_is_connect, __pyx_k_is_connect, sizeof(__pyx_k_is_connect), 0, 0, 1, 1},
  {&__pyx_n_s_isoformat, __pyx_k_isoformat, sizeof(__pyx_k_isoformat), 0, 0, 1, 1},
  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_localhost, __pyx_k_localhost, sizeof(__pyx_k_localhost), 0, 0, 1, 1},
  {&__pyx_kp_s_login_password, __pyx_k_login_password, sizeof(__pyx_k_login_password), 0, 0, 1, 0},
  {&__pyx_kp_s_login_user, __pyx_k_login_user, sizeof(__pyx_k_login_user), 0, 0, 1, 0},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_main_2, __pyx_k_main_2, sizeof(__pyx_k_main_2), 0, 0, 1, 1},
  {&__pyx_n_b_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 0, 1},
  {&__pyx_n_s_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_metavar, __pyx_k_metavar, sizeof(__pyx_k_metavar), 0, 0, 1, 1},
  {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
  {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 0, 0, 1, 1},
  {&__pyx_n_s_minipg_minipg, __pyx_k_minipg_minipg, sizeof(__pyx_k_minipg_minipg), 0, 0, 1, 1},
  {&__pyx_n_s_minites, __pyx_k_minites, sizeof(__pyx_k_minites), 0, 0, 1, 1},
  {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
  {&__pyx_n_s_minutes, __pyx_k_minutes, sizeof(__pyx_k_minutes), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_month, __pyx_k_month, sizeof(__pyx_k_month), 0, 0, 1, 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_next, __pyx_k_next, sizeof(__pyx_k_next), 0, 0, 1, 1},
  {&__pyx_n_s_next_2, __pyx_k_next_2, sizeof(__pyx_k_next_2), 0, 0, 1, 1},
  {&__pyx_n_s_nextset, __pyx_k_nextset, sizeof(__pyx_k_nextset), 0, 0, 1, 1},
  {&__pyx_kp_s_no_header, __pyx_k_no_header, sizeof(__pyx_k_no_header), 0, 0, 1, 0},
  {&__pyx_n_s_null, __pyx_k_null, sizeof(__pyx_k_null), 0, 0, 1, 1},
  {&__pyx_kp_s_null_2, __pyx_k_null_2, sizeof(__pyx_k_null_2), 0, 0, 1, 0},
  {&__pyx_kp_s_null_value_replacement_string, __pyx_k_null_value_replacement_string, sizeof(__pyx_k_null_value_replacement_string), 0, 0, 1, 0},
  {&__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_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_oid, __pyx_k_oid, sizeof(__pyx_k_oid), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_output_results, __pyx_k_output_results, sizeof(__pyx_k_output_results), 0, 0, 1, 1},
  {&__pyx_n_s_output_results_locals__ustr, __pyx_k_output_results_locals__ustr, sizeof(__pyx_k_output_results_locals__ustr), 0, 0, 1, 1},
  {&__pyx_n_b_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 0, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1},
  {&__pyx_n_s_paramstyle, __pyx_k_paramstyle, sizeof(__pyx_k_paramstyle), 0, 0, 1, 1},
  {&__pyx_n_s_parse_args, __pyx_k_parse_args, sizeof(__pyx_k_parse_args), 0, 0, 1, 1},
  {&__pyx_n_s_parse_point, __pyx_k_parse_point, sizeof(__pyx_k_parse_point), 0, 0, 1, 1},
  {&__pyx_n_s_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 0, 0, 1, 1},
  {&__pyx_n_s_password, __pyx_k_password, sizeof(__pyx_k_password), 0, 0, 1, 1},
  {&__pyx_kp_s_password_2, __pyx_k_password_2, sizeof(__pyx_k_password_2), 0, 0, 1, 0},
  {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
  {&__pyx_n_s_popleft, __pyx_k_popleft, sizeof(__pyx_k_popleft), 0, 0, 1, 1},
  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
  {&__pyx_kp_s_port_2, __pyx_k_port_2, sizeof(__pyx_k_port_2), 0, 0, 1, 0},
  {&__pyx_kp_s_port_number, __pyx_k_port_number, sizeof(__pyx_k_port_number), 0, 0, 1, 0},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_procname, __pyx_k_procname, sizeof(__pyx_k_procname), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 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_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_query, __pyx_k_query, sizeof(__pyx_k_query), 0, 0, 1, 1},
  {&__pyx_kp_s_query_2, __pyx_k_query_2, sizeof(__pyx_k_query_2), 0, 0, 1, 0},
  {&__pyx_kp_s_query_string, __pyx_k_query_string, sizeof(__pyx_k_query_string), 0, 0, 1, 0},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1},
  {&__pyx_n_s_recv, __pyx_k_recv, sizeof(__pyx_k_recv), 0, 0, 1, 1},
  {&__pyx_n_s_reopen, __pyx_k_reopen, sizeof(__pyx_k_reopen), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 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_rfind, __pyx_k_rfind, sizeof(__pyx_k_rfind), 0, 0, 1, 1},
  {&__pyx_n_s_rollback, __pyx_k_rollback, sizeof(__pyx_k_rollback), 0, 0, 1, 1},
  {&__pyx_n_s_rowcount, __pyx_k_rowcount, sizeof(__pyx_k_rowcount), 0, 0, 1, 1},
  {&__pyx_n_s_rowcount_2, __pyx_k_rowcount_2, sizeof(__pyx_k_rowcount_2), 0, 0, 1, 1},
  {&__pyx_n_s_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 0, 0, 1, 1},
  {&__pyx_n_s_rs, __pyx_k_rs, sizeof(__pyx_k_rs), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
  {&__pyx_kp_u_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 1, 0, 0},
  {&__pyx_kp_u_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 1, 0, 0},
  {&__pyx_kp_s_s_s_s, __pyx_k_s_s_s, sizeof(__pyx_k_s_s_s), 0, 0, 1, 0},
  {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
  {&__pyx_n_s_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 0, 0, 1, 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_n_s_separator, __pyx_k_separator, sizeof(__pyx_k_separator), 0, 0, 1, 1},
  {&__pyx_n_s_seq_of_params, __pyx_k_seq_of_params, sizeof(__pyx_k_seq_of_params), 0, 0, 1, 1},
  {&__pyx_n_b_server_encoding, __pyx_k_server_encoding, sizeof(__pyx_k_server_encoding), 0, 0, 0, 1},
  {&__pyx_n_s_set_autocommit, __pyx_k_set_autocommit, sizeof(__pyx_k_set_autocommit), 0, 0, 1, 1},
  {&__pyx_n_s_set_defaults, __pyx_k_set_defaults, sizeof(__pyx_k_set_defaults), 0, 0, 1, 1},
  {&__pyx_n_s_setinputsizes, __pyx_k_setinputsizes, sizeof(__pyx_k_setinputsizes), 0, 0, 1, 1},
  {&__pyx_n_s_setoutputsize, __pyx_k_setoutputsize, sizeof(__pyx_k_setoutputsize), 0, 0, 1, 1},
  {&__pyx_n_s_settimeout, __pyx_k_settimeout, sizeof(__pyx_k_settimeout), 0, 0, 1, 1},
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
  {&__pyx_n_s_sizes, __pyx_k_sizes, sizeof(__pyx_k_sizes), 0, 0, 1, 1},
  {&__pyx_n_s_socket, __pyx_k_socket, sizeof(__pyx_k_socket), 0, 0, 1, 1},
  {&__pyx_kp_s_socket_s_d, __pyx_k_socket_s_d, sizeof(__pyx_k_socket_s_d), 0, 0, 1, 0},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_ssl, __pyx_k_ssl, sizeof(__pyx_k_ssl), 0, 0, 1, 1},
  {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
  {&__pyx_n_s_stdin, __pyx_k_stdin, sizeof(__pyx_k_stdin), 0, 0, 1, 1},
  {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  {&__pyx_n_s_store_false, __pyx_k_store_false, sizeof(__pyx_k_store_false), 0, 0, 1, 1},
  {&__pyx_n_s_store_true, __pyx_k_store_true, sizeof(__pyx_k_store_true), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1},
  {&__pyx_n_s_struct_time, __pyx_k_struct_time, sizeof(__pyx_k_struct_time), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_threadsafety, __pyx_k_threadsafety, sizeof(__pyx_k_threadsafety), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 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_s_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1},
  {&__pyx_kp_s_timestamp, __pyx_k_timestamp, sizeof(__pyx_k_timestamp), 0, 0, 1, 0},
  {&__pyx_kp_s_timestamp_with_time_zone, __pyx_k_timestamp_with_time_zone, sizeof(__pyx_k_timestamp_with_time_zone), 0, 0, 1, 0},
  {&__pyx_n_s_tm_hour, __pyx_k_tm_hour, sizeof(__pyx_k_tm_hour), 0, 0, 1, 1},
  {&__pyx_n_s_tm_mday, __pyx_k_tm_mday, sizeof(__pyx_k_tm_mday), 0, 0, 1, 1},
  {&__pyx_n_s_tm_min, __pyx_k_tm_min, sizeof(__pyx_k_tm_min), 0, 0, 1, 1},
  {&__pyx_n_s_tm_mon, __pyx_k_tm_mon, sizeof(__pyx_k_tm_mon), 0, 0, 1, 1},
  {&__pyx_n_s_tm_sec, __pyx_k_tm_sec, sizeof(__pyx_k_tm_sec), 0, 0, 1, 1},
  {&__pyx_n_s_tm_year, __pyx_k_tm_year, sizeof(__pyx_k_tm_year), 0, 0, 1, 1},
  {&__pyx_n_s_to_bytes, __pyx_k_to_bytes, sizeof(__pyx_k_to_bytes), 0, 0, 1, 1},
  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_true, __pyx_k_true, sizeof(__pyx_k_true), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_tzinfo, __pyx_k_tzinfo, sizeof(__pyx_k_tzinfo), 0, 0, 1, 1},
  {&__pyx_n_s_tzname, __pyx_k_tzname, sizeof(__pyx_k_tzname), 0, 0, 1, 1},
  {&__pyx_n_s_use_ssl, __pyx_k_use_ssl, sizeof(__pyx_k_use_ssl), 0, 0, 1, 1},
  {&__pyx_n_s_user, __pyx_k_user, sizeof(__pyx_k_user), 0, 0, 1, 1},
  {&__pyx_kp_b_user_2, __pyx_k_user_2, sizeof(__pyx_k_user_2), 0, 0, 0, 0},
  {&__pyx_kp_s_user_3, __pyx_k_user_3, sizeof(__pyx_k_user_3), 0, 0, 1, 0},
  {&__pyx_n_s_ustr, __pyx_k_ustr, sizeof(__pyx_k_ustr), 0, 0, 1, 1},
  {&__pyx_n_s_utcoffset, __pyx_k_utcoffset, sizeof(__pyx_k_utcoffset), 0, 0, 1, 1},
  {&__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_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
  {&__pyx_n_s_with_header, __pyx_k_with_header, sizeof(__pyx_k_with_header), 0, 0, 1, 1},
  {&__pyx_n_s_wrap_socket, __pyx_k_wrap_socket, sizeof(__pyx_k_wrap_socket), 0, 0, 1, 1},
  {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_kp_u_x_2, __pyx_k_x_2, sizeof(__pyx_k_x_2), 0, 1, 0, 0},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 394, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 468, __pyx_L1_error)
  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 49, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 251, __pyx_L1_error)
  __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 252, __pyx_L1_error)
  __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_n_s_eval); if (!__pyx_builtin_eval) __PYX_ERR(0, 276, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 279, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 343, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 482, __pyx_L1_error)
  __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 570, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "minipg/minipg.py":144
 * class UTC(datetime.tzinfo):
 *     def utcoffset(self, dt):
 *         return datetime.timedelta(0)             # <<<<<<<<<<<<<<
 * 
 *     def tzname(self, dt):
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "minipg/minipg.py":150
 * 
 *     def dst(self, dt):
 *         return datetime.timedelta(0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "minipg/minipg.py":155
 * def _decode_column(data, oid, encoding, tzinfo):
 *     def _get_timezone_offset(data):
 *         n = data.rfind('+')             # <<<<<<<<<<<<<<
 *         if n == -1:
 *             n = data.rfind('-')
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s__4); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "minipg/minipg.py":157
 *         n = data.rfind('+')
 *         if n == -1:
 *             n = data.rfind('-')             # <<<<<<<<<<<<<<
 *             s = data[:n]
 *             offset = int(data[n:]) * 3600 * -1
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s__6); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "minipg/minipg.py":166
 * 
 *     def _parse_point(data):
 *         x, y = data[1:-1].split(',')             # <<<<<<<<<<<<<<
 *         return (float(x), float(y))
 * 
 */
  __pyx_slice__8 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__8)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__8);
  __Pyx_GIVEREF(__pyx_slice__8);
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s__9); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "minipg/minipg.py":154
 * 
 * def _decode_column(data, oid, encoding, tzinfo):
 *     def _get_timezone_offset(data):             # <<<<<<<<<<<<<<
 *         n = data.rfind('+')
 *         if n == -1:
 */
  __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_n, __pyx_n_s_s, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_get_timezone_offset, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 154, __pyx_L1_error)

  /* "minipg/minipg.py":165
 *         return s, datetime.timedelta(seconds=offset)
 * 
 *     def _parse_point(data):             # <<<<<<<<<<<<<<
 *         x, y = data[1:-1].split(',')
 *         return (float(x), float(y))
 */
  __pyx_tuple__13 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_parse_point, 165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 165, __pyx_L1_error)

  /* "minipg/minipg.py":225
 *         if data == '1 day':
 *             return datetime.timedelta(days=1)
 *         dt = data.split('days')             # <<<<<<<<<<<<<<
 *         if len(dt) < 2:
 *             days = 0
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_days); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "minipg/minipg.py":228
 *         if len(dt) < 2:
 *             days = 0
 *             hours, minites, seconds = dt[0].split(':')             # <<<<<<<<<<<<<<
 *             if seconds.find('.') != -1:
 *                 seconds, microseconds = seconds.split('.')
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__16); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "minipg/minipg.py":229
 *             days = 0
 *             hours, minites, seconds = dt[0].split(':')
 *             if seconds.find('.') != -1:             # <<<<<<<<<<<<<<
 *                 seconds, microseconds = seconds.split('.')
 *             else:
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s__18); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "minipg/minipg.py":230
 *             hours, minites, seconds = dt[0].split(':')
 *             if seconds.find('.') != -1:
 *                 seconds, microseconds = seconds.split('.')             # <<<<<<<<<<<<<<
 *             else:
 *                 microseconds = 0
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s__18); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "minipg/minipg.py":236
 *             days = int(dt[0])
 *             if dt[1]:
 *                 hours, minites, seconds = dt[1].split(':')             # <<<<<<<<<<<<<<
 *                 if seconds.find('.') != -1:
 *                     seconds, microseconds = seconds.split('.')
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s__16); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "minipg/minipg.py":237
 *             if dt[1]:
 *                 hours, minites, seconds = dt[1].split(':')
 *                 if seconds.find('.') != -1:             # <<<<<<<<<<<<<<
 *                     seconds, microseconds = seconds.split('.')
 *                 else:
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s__18); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "minipg/minipg.py":238
 *                 hours, minites, seconds = dt[1].split(':')
 *                 if seconds.find('.') != -1:
 *                     seconds, microseconds = seconds.split('.')             # <<<<<<<<<<<<<<
 *                 else:
 *                     microseconds = 0
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s__18); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "minipg/minipg.py":249
 *         return datetime.timedelta(microseconds=microseconds, seconds=seconds, minutes=minites, hours=hours, days=days)
 *     elif oid in (PG_TYPE_BYTEA, ):
 *         assert data[:2] == u'\\x'             # <<<<<<<<<<<<<<
 *         hex_str = data[2:]
 *         ia = [int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2)]
 */
  __pyx_slice__24 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__24);
  __Pyx_GIVEREF(__pyx_slice__24);

  /* "minipg/minipg.py":250
 *     elif oid in (PG_TYPE_BYTEA, ):
 *         assert data[:2] == u'\\x'
 *         hex_str = data[2:]             # <<<<<<<<<<<<<<
 *         ia = [int(hex_str[i:i+2], 16) for i in range(0, len(hex_str), 2)]
 *         return b''.join([chr(c) for c in ia]) if PY2 else bytes(ia)
 */
  __pyx_slice__25 = PySlice_New(__pyx_int_2, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(0, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__25);
  __Pyx_GIVEREF(__pyx_slice__25);

  /* "minipg/minipg.py":262
 *         return data
 *     elif oid in (PG_TYPE_INT2ARRAY, PG_TYPE_INT4ARRAY):
 *         return [int(i) for i in data[1:-1].split(',')]             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):
 *         return [s for s in data[1:-1].split(',')]
 */
  __pyx_slice__27 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__27);
  __Pyx_GIVEREF(__pyx_slice__27);
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s__9); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "minipg/minipg.py":264
 *         return [int(i) for i in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_NAMEARRAY, PG_TYPE_TEXTARRAY):
 *         return [s for s in data[1:-1].split(',')]             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):
 *         return [float(f) for f in data[1:-1].split(',')]
 */
  __pyx_slice__29 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__29);
  __Pyx_GIVEREF(__pyx_slice__29);
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s__9); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "minipg/minipg.py":266
 *         return [s for s in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_FLOAT4ARRAY, ):
 *         return [float(f) for f in data[1:-1].split(',')]             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_INT2VECTOR, ):
 *         return [int(i) for i in data.split(' ')]
 */
  __pyx_slice__31 = PySlice_New(__pyx_int_1, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__31);
  __Pyx_GIVEREF(__pyx_slice__31);
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s__9); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "minipg/minipg.py":268
 *         return [float(f) for f in data[1:-1].split(',')]
 *     elif oid in (PG_TYPE_INT2VECTOR, ):
 *         return [int(i) for i in data.split(' ')]             # <<<<<<<<<<<<<<
 *     elif oid in (PG_TYPE_POINT, ):
 *         return _parse_point(data)
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s__33); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "minipg/minipg.py":272
 *         return _parse_point(data)
 *     elif oid in (PG_TYPE_CIRCLE, ):
 *         p = data[1:data.find(')')+1]             # <<<<<<<<<<<<<<
 *         r = data[len(p)+2:-1]
 *         return (_parse_point(p), float(r))
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s__35); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "minipg/minipg.py":299
 *         return chr((val >> 24) & 0xff) + chr((val >> 16) & 0xff) + chr((val >> 8) & 0xff) + chr(val & 0xff)
 *     else:
 *         return val.to_bytes(4, byteorder='big')             # <<<<<<<<<<<<<<
 * 
 * Date = datetime.date
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "minipg/minipg.py":429
 *         if args:
 *             escaped_args = tuple(
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args             # <<<<<<<<<<<<<<
 *             )
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 */
  __pyx_tuple__40 = PyTuple_Pack(2, __pyx_kp_u__38, __pyx_kp_u__39); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "minipg/minipg.py":423
 *     def execute(self, query, args=()):
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")             # <<<<<<<<<<<<<<
 *         self.description = []
 *         self._rows.clear()
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_u_08003_Lost_connection); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "minipg/minipg.py":431
 *                 self.connection.escape_parameter(arg).replace(u'%', u'%%') for arg in args
 *             )
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')             # <<<<<<<<<<<<<<
 *             query = query % escaped_args
 *             query = query.replace(u'%%', u'%')
 */
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_kp_u__38, __pyx_kp_u__39); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_tuple__43 = PyTuple_Pack(2, __pyx_kp_u_s_2, __pyx_kp_u_s_3); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 431, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "minipg/minipg.py":433
 *             query = query.replace(u'%', u'%%').replace(u'%%s', u'%s')
 *             query = query % escaped_args
 *             query = query.replace(u'%%', u'%')             # <<<<<<<<<<<<<<
 *         self.query = query
 *         self.connection.execute(query, self)
 */
  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_kp_u__39, __pyx_kp_u__38); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "minipg/minipg.py":446
 *     def fetchone(self):
 *         if not self.connection or not self.connection.is_connect():
 *             raise OperationalError(u"08003:Lost connection")             # <<<<<<<<<<<<<<
 *         if len(self._rows):
 *             return self._rows.popleft()
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_u_08003_Lost_connection); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "minipg/minipg.py":536
 *                     import hashlib
 *                     salt = data[4:]
 *                     hash1 = hashlib.md5(self.password.encode('ascii') + self.user.encode("ascii")).hexdigest().encode("ascii")             # <<<<<<<<<<<<<<
 *                     hash2 = hashlib.md5(hash1+salt).hexdigest().encode("ascii")
 *                     self._send_message(b'p', b''.join([b'md5', hash2, b'\x00']))
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "minipg/minipg.py":537
 *                     salt = data[4:]
 *                     hash1 = hashlib.md5(self.password.encode('ascii') + self.user.encode("ascii")).hexdigest().encode("ascii")
 *                     hash2 = hashlib.md5(hash1+salt).hexdigest().encode("ascii")             # <<<<<<<<<<<<<<
 *                     self._send_message(b'p', b''.join([b'md5', hash2, b'\x00']))
 *                 else:
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "minipg/minipg.py":542
 *                     errobj = InterfaceError("Authentication method %d not supported." % (auth_method,))
 *             elif code == 83:    # ParameterStatus('S')
 *                 k, v, _ = data.split(b'\x00')             # <<<<<<<<<<<<<<
 *                 if k == b'server_encoding':
 *                     self.encoding = v.decode('ascii')
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_b__50); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 542, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "minipg/minipg.py":544
 *                 k, v, _ = data.split(b'\x00')
 *                 if k == b'server_encoding':
 *                     self.encoding = v.decode('ascii')             # <<<<<<<<<<<<<<
 *             elif code == 75:    # BackendKeyData('K')
 *                 pass
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "minipg/minipg.py":554
 *                     obj._rowcount = 1
 *                 else:
 *                     for k in ('SELECT', 'UPDATE', 'DELETE', 'INSERT'):             # <<<<<<<<<<<<<<
 *                         if command[:len(k)] == k:
 *                             obj._rowcount = int(command.split(' ')[-1])
 */
  __pyx_tuple__53 = PyTuple_Pack(4, __pyx_n_s_SELECT, __pyx_n_s_UPDATE, __pyx_n_s_DELETE, __pyx_n_s_INSERT); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "minipg/minipg.py":556
 *                     for k in ('SELECT', 'UPDATE', 'DELETE', 'INSERT'):
 *                         if command[:len(k)] == k:
 *                             obj._rowcount = int(command.split(' ')[-1])             # <<<<<<<<<<<<<<
 *                             break
 *             elif code == 84:    # RowDescription('T')
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s__33); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "minipg/minipg.py":566
 *                 idx = 0
 *                 for i in range(count):
 *                     name = data[n:n+data[n:].find(b'\x00')]             # <<<<<<<<<<<<<<
 *                     n += len(name) + 1
 *                     try:
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_b__50); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "minipg/minipg.py":614
 *                 pass
 *             elif code == 69 and not errobj:     # ErrorResponse('E')
 *                 err = data.split(b'\x00')             # <<<<<<<<<<<<<<
 *                 # http://www.postgresql.org/docs/9.3/static/errcodes-appendix.html
 *                 errcode = err[1][1:]
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_b__50); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "minipg/minipg.py":616
 *                 err = data.split(b'\x00')
 *                 # http://www.postgresql.org/docs/9.3/static/errcodes-appendix.html
 *                 errcode = err[1][1:]             # <<<<<<<<<<<<<<
 *                 message = errcode + b':' + err[2][1:]
 *                 if not PY2:
 */
  __pyx_slice__58 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__58)) __PYX_ERR(0, 616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__58);
  __Pyx_GIVEREF(__pyx_slice__58);

  /* "minipg/minipg.py":617
 *                 # http://www.postgresql.org/docs/9.3/static/errcodes-appendix.html
 *                 errcode = err[1][1:]
 *                 message = errcode + b':' + err[2][1:]             # <<<<<<<<<<<<<<
 *                 if not PY2:
 *                     message = message.decode(self.encoding)
 */
  __pyx_slice__59 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__59)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__59);
  __Pyx_GIVEREF(__pyx_slice__59);

  /* "minipg/minipg.py":620
 *                 if not PY2:
 *                     message = message.decode(self.encoding)
 *                 if errcode[:2] == b'23':             # <<<<<<<<<<<<<<
 *                     errobj = IntegrityError(message)
 *                 else:
 */
  __pyx_slice__60 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__60)) __PYX_ERR(0, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__60);
  __Pyx_GIVEREF(__pyx_slice__60);

  /* "minipg/minipg.py":632
 *             elif code == 71:    # CopyInResponse('G')
 *                 while True:
 *                     buf = obj.read(8192)             # <<<<<<<<<<<<<<
 *                     if not buf:
 *                         break
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_int_8192); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "minipg/minipg.py":651
 *     def _read(self, ln):
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")             # <<<<<<<<<<<<<<
 *         r = b''
 *         while len(r) < ln:
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_u_08003_Lost_connection); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "minipg/minipg.py":656
 *             b = self.sock.recv(ln-len(r))
 *             if not b:
 *                 raise OperationalError(u"08003:Can't recv packets")             # <<<<<<<<<<<<<<
 *             r += b
 *         return r
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_u_08003_Can_t_recv_packets); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "minipg/minipg.py":665
 *             b = str(b)
 *         if not self.sock:
 *             raise OperationalError(u"08003:Lost connection")             # <<<<<<<<<<<<<<
 *         n = 0
 *         while (n < len(b)):
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_u_08003_Lost_connection); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "minipg/minipg.py":682
 *                 self.sock = ssl.wrap_socket(self.sock)
 *             else:
 *                 raise InterfaceError("Server refuses SSL")             # <<<<<<<<<<<<<<
 *         if self.timeout is not None:
 *             self.sock.settimeout(float(self.timeout))
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Server_refuses_SSL); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 682, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "minipg/minipg.py":687
 *         # protocol version 3.0
 *         v = b'\x00\x03\x00\x00'
 *         v += b'user\x00' + self.user.encode('ascii') + b'\x00'             # <<<<<<<<<<<<<<
 *         if self.database:
 *             v += b'database\x00' + self.database.encode('ascii') + b'\x00'
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "minipg/minipg.py":689
 *         v += b'user\x00' + self.user.encode('ascii') + b'\x00'
 *         if self.database:
 *             v += b'database\x00' + self.database.encode('ascii') + b'\x00'             # <<<<<<<<<<<<<<
 *         v += b'\x00'
 * 
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_n_s_ascii); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "minipg/minipg.py":703
 *             return 'NULL'
 *         elif (PY2 and t == unicode) or (not PY2 and t == str):  # string
 *             return u"'" + v.replace(u"'", u"''") + u"'"             # <<<<<<<<<<<<<<
 *         elif PY2 and t == str:    # PY2 str
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])
 */
  __pyx_tuple__71 = PyTuple_Pack(2, __pyx_kp_u__69, __pyx_kp_u__70); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 703, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "minipg/minipg.py":706
 *         elif PY2 and t == str:    # PY2 str
 *             v = ''.join(['\\%03o' % (ord(c), ) if ord(c) < 32 or ord(c) > 127 else c for c in v])
 *             return "'" + v.replace("'", "''") + "'"             # <<<<<<<<<<<<<<
 *         elif t == bytearray or t == bytes:        # binary
 *             return "'" + ''.join(['\\%03o' % (c, ) for c in v]) + "'::bytea"
 */
  __pyx_tuple__72 = PyTuple_Pack(2, __pyx_kp_s__69, __pyx_kp_s__70); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "minipg/minipg.py":799
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):
 *     def _ustr(c):             # <<<<<<<<<<<<<<
 *         if c is None:
 *             return null
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_c); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);
  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_ustr, 799, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 799, __pyx_L1_error)

  /* "minipg/minipg.py":824
 * def main(file):
 *     parser = ArgumentParser(description='Execute query and print results.')
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')
 */
  __pyx_tuple__77 = PyTuple_Pack(2, __pyx_kp_s_H_2, __pyx_kp_s_host_2); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "minipg/minipg.py":825
 *     parser = ArgumentParser(description='Execute query and print results.')
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')
 */
  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_kp_s_U, __pyx_kp_s_user_3); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "minipg/minipg.py":826
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')
 */
  __pyx_tuple__79 = PyTuple_Pack(2, __pyx_kp_s_W, __pyx_kp_s_password_2); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 826, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "minipg/minipg.py":827
 *     parser.add_argument('-U', '--user', required=True, metavar='user', type=str, help='login user')
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')
 */
  __pyx_tuple__80 = PyTuple_Pack(2, __pyx_kp_s_P, __pyx_kp_s_port_2); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "minipg/minipg.py":828
 *     parser.add_argument('-W', '--password', default='', metavar='password', type=str, help='login password')
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')
 */
  __pyx_tuple__81 = PyTuple_Pack(2, __pyx_kp_s_D, __pyx_kp_s_database_3); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 828, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "minipg/minipg.py":829
 *     parser.add_argument('-P', '--port', default=5432, metavar='port', type=int, help='port number')
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')             # <<<<<<<<<<<<<<
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')
 */
  __pyx_tuple__82 = PyTuple_Pack(2, __pyx_kp_s_Q_2, __pyx_kp_s_query_2); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "minipg/minipg.py":830
 *     parser.add_argument('-D', '--database', metavar='database', type=str, help='database name')
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')             # <<<<<<<<<<<<<<
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')
 *     parser.add_argument('--no-header', action='store_false', dest='with_header', help='No output header')
 */
  __pyx_tuple__83 = PyTuple_Pack(2, __pyx_kp_s_F, __pyx_kp_s_field_separator); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "minipg/minipg.py":831
 *     parser.add_argument('-Q', '--query', metavar='query', type=str, help='query string')
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')             # <<<<<<<<<<<<<<
 *     parser.add_argument('--no-header', action='store_false', dest='with_header', help='No output header')
 *     parser.add_argument('--null', default='null', metavar='null', type=str, help='null value replacement string')
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_header); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "minipg/minipg.py":832
 *     parser.add_argument('-F', '--field-separator', default="\t", metavar='field_separator', type=str, help='field separator')
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')
 *     parser.add_argument('--no-header', action='store_false', dest='with_header', help='No output header')             # <<<<<<<<<<<<<<
 *     parser.add_argument('--null', default='null', metavar='null', type=str, help='null value replacement string')
 * 
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_no_header); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "minipg/minipg.py":833
 *     parser.add_argument('--header', action='store_true', dest='with_header', help='Output header')
 *     parser.add_argument('--no-header', action='store_false', dest='with_header', help='No output header')
 *     parser.add_argument('--null', default='null', metavar='null', type=str, help='null value replacement string')             # <<<<<<<<<<<<<<
 * 
 *     parser.set_defaults(with_header=True)
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_null_2); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "minipg/minipg.py":37
 * from argparse import ArgumentParser
 * 
 * VERSION = (0, 5, 7)             # <<<<<<<<<<<<<<
 * __version__ = '%s.%s.%s' % VERSION
 * apilevel = '2.0'
 */
  __pyx_tuple__87 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_5, __pyx_int_7); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "minipg/minipg.py":143
 * 
 * class UTC(datetime.tzinfo):
 *     def utcoffset(self, dt):             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(0)
 * 
 */
  __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_utcoffset, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 143, __pyx_L1_error)

  /* "minipg/minipg.py":146
 *         return datetime.timedelta(0)
 * 
 *     def tzname(self, dt):             # <<<<<<<<<<<<<<
 *         return "UTC"
 * 
 */
  __pyx_tuple__90 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_tzname, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 146, __pyx_L1_error)

  /* "minipg/minipg.py":149
 *         return "UTC"
 * 
 *     def dst(self, dt):             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(0)
 * 
 */
  __pyx_tuple__92 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dt); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_dst, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 149, __pyx_L1_error)

  /* "minipg/minipg.py":307
 * 
 * 
 * def Binary(b):             # <<<<<<<<<<<<<<
 *     return bytearray(b)
 * 
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_Binary, 307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 307, __pyx_L1_error)

  /* "minipg/minipg.py":312
 * 
 * class DBAPITypeObject:
 *     def __init__(self, *values):             # <<<<<<<<<<<<<<
 *         self.values = values
 * 
 */
  __pyx_tuple__96 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_values); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_init, 312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 312, __pyx_L1_error)

  /* "minipg/minipg.py":315
 *         self.values = values
 * 
 *     def __cmp__(self, other):             # <<<<<<<<<<<<<<
 *         if other in self.values:
 *             return 0
 */
  __pyx_tuple__98 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_cmp, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 315, __pyx_L1_error)

  /* "minipg/minipg.py":338
 * 
 * class Error(StandardError):
 *     def __init__(self, *args):             # <<<<<<<<<<<<<<
 *         if len(args) > 0:
 *             self.message = args[0]
 */
  __pyx_tuple__100 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_init, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 338, __pyx_L1_error)

  /* "minipg/minipg.py":345
 *         super(Error, self).__init__(*args)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.message
 * 
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_str, 345, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 345, __pyx_L1_error)

  /* "minipg/minipg.py":348
 *         return self.message
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.message
 * 
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);
  __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_repr, 348, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 348, __pyx_L1_error)

  /* "minipg/minipg.py":369
 * 
 * class InternalError(DatabaseError):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         DatabaseError.__init__(self, 'InternalError')
 * 
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);
  __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_init, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 369, __pyx_L1_error)

  /* "minipg/minipg.py":390
 * 
 * class NotSupportedError(DatabaseError):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         DatabaseError.__init__(self, 'NotSupportedError')
 * 
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);
  __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_init, 390, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 390, __pyx_L1_error)

  /* "minipg/minipg.py":395
 * 
 * class Cursor(object):
 *     def __init__(self, connection):             # <<<<<<<<<<<<<<
 *         self.connection = connection
 *         self.description = []
 */
  __pyx_tuple__110 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_connection); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);
  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_init, 395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 395, __pyx_L1_error)

  /* "minipg/minipg.py":403
 *         self.query = None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);
  __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_enter, 403, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 403, __pyx_L1_error)

  /* "minipg/minipg.py":406
 *         return self
 * 
 *     def __exit__(self, exc, value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */
  __pyx_tuple__114 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc, __pyx_n_s_value, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);
  __pyx_codeobj__115 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__114, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_exit, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__115)) __PYX_ERR(0, 406, __pyx_L1_error)

  /* "minipg/minipg.py":409
 *         self.close()
 * 
 *     def callproc(self, procname, args=()):             # <<<<<<<<<<<<<<
 *         raise NotSupportedError()
 * 
 */
  __pyx_tuple__116 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_procname, __pyx_n_s_args); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);
  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_callproc, 409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 409, __pyx_L1_error)
  __pyx_tuple__118 = PyTuple_Pack(1, ((PyObject*)__pyx_empty_tuple)); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "minipg/minipg.py":412
 *         raise NotSupportedError()
 * 
 *     def nextset(self, procname, args=()):             # <<<<<<<<<<<<<<
 *         raise NotSupportedError()
 * 
 */
  __pyx_tuple__119 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_procname, __pyx_n_s_args); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_nextset, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 412, __pyx_L1_error)
  __pyx_tuple__121 = PyTuple_Pack(1, ((PyObject*)__pyx_empty_tuple)); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "minipg/minipg.py":415
 *         raise NotSupportedError()
 * 
 *     def setinputsizes(sizes):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_n_s_sizes); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);
  __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_setinputsizes, 415, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 415, __pyx_L1_error)

  /* "minipg/minipg.py":418
 *         pass
 * 
 *     def setoutputsize(size, column=None):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_tuple__124 = PyTuple_Pack(2, __pyx_n_s_size, __pyx_n_s_column); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);
  __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_setoutputsize, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 418, __pyx_L1_error)
  __pyx_tuple__126 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "minipg/minipg.py":421
 *         pass
 * 
 *     def execute(self, query, args=()):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")
 */
  __pyx_tuple__127 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_query, __pyx_n_s_args, __pyx_n_s_escaped_args, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_execute, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 421, __pyx_L1_error)
  __pyx_tuple__129 = PyTuple_Pack(1, ((PyObject*)__pyx_empty_tuple)); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "minipg/minipg.py":437
 *         self.connection.execute(query, self)
 * 
 *     def executemany(self, query, seq_of_params):             # <<<<<<<<<<<<<<
 *         rowcount = 0
 *         for params in seq_of_params:
 */
  __pyx_tuple__130 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_query, __pyx_n_s_seq_of_params, __pyx_n_s_rowcount_2, __pyx_n_s_params); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_executemany, 437, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 437, __pyx_L1_error)

  /* "minipg/minipg.py":444
 *         self._rowcount = rowcount
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise OperationalError(u"08003:Lost connection")
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_fetchone, 444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 444, __pyx_L1_error)

  /* "minipg/minipg.py":451
 *         return None
 * 
 *     def fetchmany(self, size=1):             # <<<<<<<<<<<<<<
 *         rs = []
 *         for i in range(size):
 */
  __pyx_tuple__134 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_size, __pyx_n_s_rs, __pyx_n_s_i, __pyx_n_s_r); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_fetchmany, 451, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 451, __pyx_L1_error)
  __pyx_tuple__136 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "minipg/minipg.py":460
 *         return rs
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         r = list(self._rows)
 *         self._rows.clear()
 */
  __pyx_tuple__137 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_fetchall, 460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 460, __pyx_L1_error)

  /* "minipg/minipg.py":465
 *         return r
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         self.connection = None
 * 
 */
  __pyx_tuple__139 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);
  __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_close, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 465, __pyx_L1_error)

  /* "minipg/minipg.py":469
 * 
 *     @property
 *     def rowcount(self):             # <<<<<<<<<<<<<<
 *         return self._rowcount
 * 
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_rowcount_2, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 469, __pyx_L1_error)

  /* "minipg/minipg.py":473
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         return self.connection is None or not self.connection.is_connect()
 * 
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);
  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_closed, 473, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 473, __pyx_L1_error)

  /* "minipg/minipg.py":476
 *         return self.connection is None or not self.connection.is_connect()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_iter, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 476, __pyx_L1_error)

  /* "minipg/minipg.py":479
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         r = self.fetchone()
 *         if not r:
 */
  __pyx_tuple__147 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_r); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_next, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 479, __pyx_L1_error)

  /* "minipg/minipg.py":485
 *         return r
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         return self.__next__()
 * 
 */
  __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_next_2, 485, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 485, __pyx_L1_error)

  /* "minipg/minipg.py":505
 *         self.encoders = {}
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_tuple__151 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_enter, 505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 505, __pyx_L1_error)

  /* "minipg/minipg.py":508
 *         return self
 * 
 *     def __exit__(self, exc, value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */
  __pyx_tuple__153 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc, __pyx_n_s_value, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_exit, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 508, __pyx_L1_error)

  /* "minipg/minipg.py":695
 *         self.process_messages(None)
 * 
 *     def escape_parameter(self, v):             # <<<<<<<<<<<<<<
 *         t = type(v)
 *         func = self.encoders.get(t)
 */
  __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_v); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_escape_parameter, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 695, __pyx_L1_error)

  /* "minipg/minipg.py":736
 *         return self._ready_for_query in b'TE'
 * 
 *     def is_connect(self):             # <<<<<<<<<<<<<<
 *         return bool(self.sock)
 * 
 */
  __pyx_tuple__157 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_is_connect, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 736, __pyx_L1_error)

  /* "minipg/minipg.py":739
 *         return bool(self.sock)
 * 
 *     def cursor(self):             # <<<<<<<<<<<<<<
 *         return Cursor(self)
 * 
 */
  __pyx_tuple__159 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_cursor, 739, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 739, __pyx_L1_error)

  /* "minipg/minipg.py":750
 *             self.commit()
 * 
 *     def execute(self, query, obj=None):             # <<<<<<<<<<<<<<
 *         if self._ready_for_query != b'T':
 *             self.begin()
 */
  __pyx_tuple__161 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_query, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_execute, 750, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 750, __pyx_L1_error)

  /* "minipg/minipg.py":755
 *         self._execute(query, obj)
 * 
 *     def set_autocommit(self, autocommit):             # <<<<<<<<<<<<<<
 *         self.autocommit = autocommit
 * 
 */
  __pyx_tuple__163 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_autocommit); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_set_autocommit, 755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 755, __pyx_L1_error)

  /* "minipg/minipg.py":758
 *         self.autocommit = autocommit
 * 
 *     def begin(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('BEGIN')
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_begin, 758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 758, __pyx_L1_error)

  /* "minipg/minipg.py":766
 *         self._process_messages(None)
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('COMMIT')
 */
  __pyx_tuple__167 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_commit, 766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 766, __pyx_L1_error)

  /* "minipg/minipg.py":773
 *             self.process_messages(None)
 * 
 *     def rollback(self):             # <<<<<<<<<<<<<<
 *         if self.sock:
 *             if DEBUG:
 */
  __pyx_tuple__169 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_rollback, 773, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 773, __pyx_L1_error)

  /* "minipg/minipg.py":780
 *         self.process_messages(None)
 * 
 *     def reopen(self):             # <<<<<<<<<<<<<<
 *         self.close()
 *         self._open()
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_reopen, 780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 780, __pyx_L1_error)

  /* "minipg/minipg.py":784
 *         self._open()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::close()')
 */
  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_close, 784, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 784, __pyx_L1_error)

  /* "minipg/minipg.py":794
 * 
 * 
 * def connect(host, user, password='', database=None, port=5432, timeout=None, use_ssl=False, tzinfo=None):             # <<<<<<<<<<<<<<
 *     return Connection(user, password, database, host, port, timeout, use_ssl, tzinfo)
 * 
 */
  __pyx_tuple__175 = PyTuple_Pack(8, __pyx_n_s_host, __pyx_n_s_user, __pyx_n_s_password, __pyx_n_s_database, __pyx_n_s_port, __pyx_n_s_timeout, __pyx_n_s_use_ssl, __pyx_n_s_tzinfo); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_connect, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 794, __pyx_L1_error)
  __pyx_tuple__177 = PyTuple_Pack(6, ((PyObject*)__pyx_kp_s__26), ((PyObject *)Py_None), ((PyObject *)__pyx_int_5432), ((PyObject *)Py_None), ((PyObject *)Py_False), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);

  /* "minipg/minipg.py":798
 * 
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):             # <<<<<<<<<<<<<<
 *     def _ustr(c):
 *         if c is None:
 */
  __pyx_tuple__178 = PyTuple_Pack(12, __pyx_n_s_conn, __pyx_n_s_query, __pyx_n_s_with_header, __pyx_n_s_separator, __pyx_n_s_null, __pyx_n_s_file, __pyx_n_s_ustr, __pyx_n_s_ustr, __pyx_n_s_cur, __pyx_n_s_r, __pyx_n_s_d, __pyx_n_s_c); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);
  __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_output_results, 798, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(0, 798, __pyx_L1_error)

  /* "minipg/minipg.py":822
 * 
 * 
 * def main(file):             # <<<<<<<<<<<<<<
 *     parser = ArgumentParser(description='Execute query and print results.')
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 */
  __pyx_tuple__180 = PyTuple_Pack(4, __pyx_n_s_file, __pyx_n_s_parser, __pyx_n_s_args, __pyx_n_s_conn); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(0, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);
  __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_nakagami_minipg_minipg_min, __pyx_n_s_main_2, 822, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 822, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3600 = PyInt_FromLong(3600); if (unlikely(!__pyx_int_3600)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5432 = PyInt_FromLong(5432); if (unlikely(!__pyx_int_5432)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8192 = PyInt_FromLong(8192); if (unlikely(!__pyx_int_8192)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initminipg(void); /*proto*/
PyMODINIT_FUNC initminipg(void)
#else
PyMODINIT_FUNC PyInit_minipg(void); /*proto*/
PyMODINIT_FUNC PyInit_minipg(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_minipg(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("minipg", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_minipg__minipg) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "minipg.minipg")) {
      if (unlikely(PyDict_SetItemString(modules, "minipg.minipg", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PY2, (void *)&__pyx_v_6minipg_6minipg_PY2, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_DEBUG, (void *)&__pyx_v_6minipg_6minipg_DEBUG, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_BOOL, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_BOOL, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_BYTEA, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_BYTEA, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_CHAR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_CHAR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_NAME, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_NAME, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INT8, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INT8, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INT2, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INT2, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INT2VECTOR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INT2VECTOR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INT4, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INT4, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGPROC, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGPROC, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TEXT, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TEXT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_OID, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_OID, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TID, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TID, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_XID, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_XID, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_CID, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_CID, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_VECTOROID, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_VECTOROID, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_JSON, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_JSON, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_XML, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_XML, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_PGNODETREE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_PGNODETREE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_POINT, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_POINT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_LSEG, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_LSEG, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_PATH, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_PATH, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_BOX, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_BOX, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_POLYGON, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_POLYGON, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_LINE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_LINE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_FLOAT4, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_FLOAT4, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_FLOAT8, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_FLOAT8, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ABSTIME, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ABSTIME, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_RELTIME, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_RELTIME, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TINTERVAL, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TINTERVAL, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_UNKNOWN, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_UNKNOWN, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_CIRCLE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_CIRCLE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_CASH, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_CASH, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_MACADDR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_MACADDR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INET, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INET, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_CIDR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_CIDR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_NAMEARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_NAMEARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INT2ARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INT2ARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INT4ARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INT4ARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TEXTARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TEXTARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ARRAYOID, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ARRAYOID, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_FLOAT4ARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_FLOAT4ARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ACLITEM, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ACLITEM, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_CSTRINGARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_CSTRINGARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_BPCHAR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_BPCHAR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_VARCHAR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_VARCHAR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_DATE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_DATE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TIME, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TIME, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TIMESTAMP, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TIMESTAMP, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TIMESTAMPTZ, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TIMESTAMPTZ, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INTERVAL, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INTERVAL, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TIMETZ, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TIMETZ, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_BIT, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_BIT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_VARBIT, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_VARBIT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_NUMERIC, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_NUMERIC, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REFCURSOR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REFCURSOR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGPROCEDURE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGPROCEDURE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGOPER, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGOPER, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGOPERATOR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGOPERATOR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGCLASS, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGCLASS, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGTYPE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGTYPE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGTYPEARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGTYPEARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_UUID, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_UUID, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TSVECTOR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TSVECTOR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_GTSVECTOR, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_GTSVECTOR, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TSQUERY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TSQUERY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGCONFIG, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGCONFIG, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_REGDICTIONARY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_REGDICTIONARY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INT4RANGE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INT4RANGE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_RECORD, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_RECORD, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_RECORDARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_RECORDARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_CSTRING, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_CSTRING, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ANY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ANY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ANYARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ANYARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_VOID, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_VOID, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_TRIGGER, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_TRIGGER, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_EVTTRIGGER, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_EVTTRIGGER, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_LANGUAGE_HANDLER, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_LANGUAGE_HANDLER, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_INTERNAL, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_INTERNAL, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_OPAQUE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_OPAQUE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ANYELEMENT, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ANYELEMENT, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ANYNONARRAY, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ANYNONARRAY, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ANYENUM, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ANYENUM, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_FDW_HANDLER, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_FDW_HANDLER, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_PG_TYPE_ANYRANGE, (void *)&__pyx_v_6minipg_6minipg_PG_TYPE_ANYRANGE, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("DEBUG_OUTPUT", (void (*)(void))__pyx_f_6minipg_6minipg_DEBUG_OUTPUT, "void (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_decode_column", (void (*)(void))__pyx_f_6minipg_6minipg__decode_column, "PyObject *(PyObject *, int, PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_bytes_to_bint", (void (*)(void))__pyx_f_6minipg_6minipg__bytes_to_bint, "PY_LONG_LONG (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_bint_to_bytes", (void (*)(void))__pyx_f_6minipg_6minipg__bint_to_bytes, "PyObject *(int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Type init code ---*/
  __pyx_vtabptr_6minipg_6minipg_Connection = &__pyx_vtable_6minipg_6minipg_Connection;
  __pyx_vtable_6minipg_6minipg_Connection.escape_parameter = (PyObject *(*)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6minipg_6minipg_10Connection_escape_parameter;
  __pyx_vtable_6minipg_6minipg_Connection._process_messages = (PyObject *(*)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *))__pyx_f_6minipg_6minipg_10Connection__process_messages;
  __pyx_vtable_6minipg_6minipg_Connection.process_messages = (void (*)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *))__pyx_f_6minipg_6minipg_10Connection_process_messages;
  __pyx_vtable_6minipg_6minipg_Connection._send_message = (void (*)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *, PyObject *))__pyx_f_6minipg_6minipg_10Connection__send_message;
  __pyx_vtable_6minipg_6minipg_Connection._read = (PyObject *(*)(struct __pyx_obj_6minipg_6minipg_Connection *, int))__pyx_f_6minipg_6minipg_10Connection__read;
  __pyx_vtable_6minipg_6minipg_Connection._write = (void (*)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *))__pyx_f_6minipg_6minipg_10Connection__write;
  __pyx_vtable_6minipg_6minipg_Connection._open = (void (*)(struct __pyx_obj_6minipg_6minipg_Connection *))__pyx_f_6minipg_6minipg_10Connection__open;
  __pyx_vtable_6minipg_6minipg_Connection.begin = (PyObject *(*)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch))__pyx_f_6minipg_6minipg_10Connection_begin;
  __pyx_vtable_6minipg_6minipg_Connection._execute = (void (*)(struct __pyx_obj_6minipg_6minipg_Connection *, PyObject *, PyObject *))__pyx_f_6minipg_6minipg_10Connection__execute;
  __pyx_vtable_6minipg_6minipg_Connection.commit = (PyObject *(*)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch))__pyx_f_6minipg_6minipg_10Connection_commit;
  __pyx_vtable_6minipg_6minipg_Connection.rollback = (PyObject *(*)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch))__pyx_f_6minipg_6minipg_10Connection_rollback;
  __pyx_vtable_6minipg_6minipg_Connection.reopen = (PyObject *(*)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch))__pyx_f_6minipg_6minipg_10Connection_reopen;
  __pyx_vtable_6minipg_6minipg_Connection.close = (PyObject *(*)(struct __pyx_obj_6minipg_6minipg_Connection *, int __pyx_skip_dispatch))__pyx_f_6minipg_6minipg_10Connection_close;
  if (PyType_Ready(&__pyx_type_6minipg_6minipg_Connection) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
  __pyx_type_6minipg_6minipg_Connection.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_6minipg_6minipg_Connection.tp_dict, __pyx_vtabptr_6minipg_6minipg_Connection) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "Connection", (PyObject *)&__pyx_type_6minipg_6minipg_Connection) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
  __pyx_ptype_6minipg_6minipg_Connection = &__pyx_type_6minipg_6minipg_Connection;
  if (PyType_Ready(&__pyx_type_6minipg_6minipg___pyx_scope_struct__execute) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  __pyx_type_6minipg_6minipg___pyx_scope_struct__execute.tp_print = 0;
  __pyx_ptype_6minipg_6minipg___pyx_scope_struct__execute = &__pyx_type_6minipg_6minipg___pyx_scope_struct__execute;
  if (PyType_Ready(&__pyx_type_6minipg_6minipg___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
  __pyx_type_6minipg_6minipg___pyx_scope_struct_1_genexpr.tp_print = 0;
  __pyx_ptype_6minipg_6minipg___pyx_scope_struct_1_genexpr = &__pyx_type_6minipg_6minipg___pyx_scope_struct_1_genexpr;
  if (PyType_Ready(&__pyx_type_6minipg_6minipg___pyx_scope_struct_2_output_results) < 0) __PYX_ERR(0, 798, __pyx_L1_error)
  __pyx_type_6minipg_6minipg___pyx_scope_struct_2_output_results.tp_print = 0;
  __pyx_ptype_6minipg_6minipg___pyx_scope_struct_2_output_results = &__pyx_type_6minipg_6minipg___pyx_scope_struct_2_output_results;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "minipg/minipg.py":27
 * 
 * from __future__ import print_function
 * import sys             # <<<<<<<<<<<<<<
 * import socket
 * import decimal
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":28
 * from __future__ import print_function
 * import sys
 * import socket             # <<<<<<<<<<<<<<
 * import decimal
 * import datetime
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_socket, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_socket, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":29
 * import sys
 * import socket
 * import decimal             # <<<<<<<<<<<<<<
 * import datetime
 * import time
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_decimal, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decimal, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":30
 * import socket
 * import decimal
 * import datetime             # <<<<<<<<<<<<<<
 * import time
 * import uuid
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":31
 * import decimal
 * import datetime
 * import time             # <<<<<<<<<<<<<<
 * import uuid
 * import collections
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":32
 * import datetime
 * import time
 * import uuid             # <<<<<<<<<<<<<<
 * import collections
 * import binascii
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_uuid, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uuid, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":33
 * import time
 * import uuid
 * import collections             # <<<<<<<<<<<<<<
 * import binascii
 * from argparse import ArgumentParser
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":34
 * import uuid
 * import collections
 * import binascii             # <<<<<<<<<<<<<<
 * from argparse import ArgumentParser
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_binascii, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_binascii, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":35
 * import collections
 * import binascii
 * from argparse import ArgumentParser             # <<<<<<<<<<<<<<
 * 
 * VERSION = (0, 5, 7)
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ArgumentParser);
  __Pyx_GIVEREF(__pyx_n_s_ArgumentParser);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ArgumentParser);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_argparse, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ArgumentParser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArgumentParser, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":37
 * from argparse import ArgumentParser
 * 
 * VERSION = (0, 5, 7)             # <<<<<<<<<<<<<<
 * __version__ = '%s.%s.%s' % VERSION
 * apilevel = '2.0'
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_VERSION, __pyx_tuple__87) < 0) __PYX_ERR(0, 37, __pyx_L1_error)

  /* "minipg/minipg.py":38
 * 
 * VERSION = (0, 5, 7)
 * __version__ = '%s.%s.%s' % VERSION             # <<<<<<<<<<<<<<
 * apilevel = '2.0'
 * threadsafety = 1
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":39
 * VERSION = (0, 5, 7)
 * __version__ = '%s.%s.%s' % VERSION
 * apilevel = '2.0'             # <<<<<<<<<<<<<<
 * threadsafety = 1
 * paramstyle = 'format'
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_apilevel, __pyx_kp_s_2_0) < 0) __PYX_ERR(0, 39, __pyx_L1_error)

  /* "minipg/minipg.py":40
 * __version__ = '%s.%s.%s' % VERSION
 * apilevel = '2.0'
 * threadsafety = 1             # <<<<<<<<<<<<<<
 * paramstyle = 'format'
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threadsafety, __pyx_int_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)

  /* "minipg/minipg.py":41
 * apilevel = '2.0'
 * threadsafety = 1
 * paramstyle = 'format'             # <<<<<<<<<<<<<<
 * 
 * PY2 = sys.version_info[0] == 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_paramstyle, __pyx_n_s_format) < 0) __PYX_ERR(0, 41, __pyx_L1_error)

  /* "minipg/minipg.py":43
 * paramstyle = 'format'
 * 
 * PY2 = sys.version_info[0] == 2             # <<<<<<<<<<<<<<
 * 
 * DEBUG = False
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_6minipg_6minipg_PY2 = __pyx_t_3;

  /* "minipg/minipg.py":45
 * PY2 = sys.version_info[0] == 2
 * 
 * DEBUG = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_6minipg_6minipg_DEBUG = 0;

  /* "minipg/minipg.py":56
 * 
 * # postgresql-9.3.5/src/include/catalog/pg_type.h
 * PG_TYPE_BOOL = 16             # <<<<<<<<<<<<<<
 * PG_TYPE_BYTEA = 17
 * PG_TYPE_CHAR = 18
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_BOOL = 16;

  /* "minipg/minipg.py":57
 * # postgresql-9.3.5/src/include/catalog/pg_type.h
 * PG_TYPE_BOOL = 16
 * PG_TYPE_BYTEA = 17             # <<<<<<<<<<<<<<
 * PG_TYPE_CHAR = 18
 * PG_TYPE_NAME = 19
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_BYTEA = 17;

  /* "minipg/minipg.py":58
 * PG_TYPE_BOOL = 16
 * PG_TYPE_BYTEA = 17
 * PG_TYPE_CHAR = 18             # <<<<<<<<<<<<<<
 * PG_TYPE_NAME = 19
 * PG_TYPE_INT8 = 20
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_CHAR = 18;

  /* "minipg/minipg.py":59
 * PG_TYPE_BYTEA = 17
 * PG_TYPE_CHAR = 18
 * PG_TYPE_NAME = 19             # <<<<<<<<<<<<<<
 * PG_TYPE_INT8 = 20
 * PG_TYPE_INT2 = 21
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_NAME = 19;

  /* "minipg/minipg.py":60
 * PG_TYPE_CHAR = 18
 * PG_TYPE_NAME = 19
 * PG_TYPE_INT8 = 20             # <<<<<<<<<<<<<<
 * PG_TYPE_INT2 = 21
 * PG_TYPE_INT2VECTOR = 22
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INT8 = 20;

  /* "minipg/minipg.py":61
 * PG_TYPE_NAME = 19
 * PG_TYPE_INT8 = 20
 * PG_TYPE_INT2 = 21             # <<<<<<<<<<<<<<
 * PG_TYPE_INT2VECTOR = 22
 * PG_TYPE_INT4 = 23
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INT2 = 21;

  /* "minipg/minipg.py":62
 * PG_TYPE_INT8 = 20
 * PG_TYPE_INT2 = 21
 * PG_TYPE_INT2VECTOR = 22             # <<<<<<<<<<<<<<
 * PG_TYPE_INT4 = 23
 * PG_TYPE_REGPROC = 24
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INT2VECTOR = 22;

  /* "minipg/minipg.py":63
 * PG_TYPE_INT2 = 21
 * PG_TYPE_INT2VECTOR = 22
 * PG_TYPE_INT4 = 23             # <<<<<<<<<<<<<<
 * PG_TYPE_REGPROC = 24
 * PG_TYPE_TEXT = 25
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INT4 = 23;

  /* "minipg/minipg.py":64
 * PG_TYPE_INT2VECTOR = 22
 * PG_TYPE_INT4 = 23
 * PG_TYPE_REGPROC = 24             # <<<<<<<<<<<<<<
 * PG_TYPE_TEXT = 25
 * PG_TYPE_OID = 26
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGPROC = 24;

  /* "minipg/minipg.py":65
 * PG_TYPE_INT4 = 23
 * PG_TYPE_REGPROC = 24
 * PG_TYPE_TEXT = 25             # <<<<<<<<<<<<<<
 * PG_TYPE_OID = 26
 * PG_TYPE_TID = 27
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TEXT = 25;

  /* "minipg/minipg.py":66
 * PG_TYPE_REGPROC = 24
 * PG_TYPE_TEXT = 25
 * PG_TYPE_OID = 26             # <<<<<<<<<<<<<<
 * PG_TYPE_TID = 27
 * PG_TYPE_XID = 28
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_OID = 26;

  /* "minipg/minipg.py":67
 * PG_TYPE_TEXT = 25
 * PG_TYPE_OID = 26
 * PG_TYPE_TID = 27             # <<<<<<<<<<<<<<
 * PG_TYPE_XID = 28
 * PG_TYPE_CID = 29
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TID = 27;

  /* "minipg/minipg.py":68
 * PG_TYPE_OID = 26
 * PG_TYPE_TID = 27
 * PG_TYPE_XID = 28             # <<<<<<<<<<<<<<
 * PG_TYPE_CID = 29
 * PG_TYPE_VECTOROID = 30
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_XID = 28;

  /* "minipg/minipg.py":69
 * PG_TYPE_TID = 27
 * PG_TYPE_XID = 28
 * PG_TYPE_CID = 29             # <<<<<<<<<<<<<<
 * PG_TYPE_VECTOROID = 30
 * PG_TYPE_JSON = 114
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_CID = 29;

  /* "minipg/minipg.py":70
 * PG_TYPE_XID = 28
 * PG_TYPE_CID = 29
 * PG_TYPE_VECTOROID = 30             # <<<<<<<<<<<<<<
 * PG_TYPE_JSON = 114
 * PG_TYPE_XML = 142
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_VECTOROID = 30;

  /* "minipg/minipg.py":71
 * PG_TYPE_CID = 29
 * PG_TYPE_VECTOROID = 30
 * PG_TYPE_JSON = 114             # <<<<<<<<<<<<<<
 * PG_TYPE_XML = 142
 * PG_TYPE_PGNODETREE = 194
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_JSON = 0x72;

  /* "minipg/minipg.py":72
 * PG_TYPE_VECTOROID = 30
 * PG_TYPE_JSON = 114
 * PG_TYPE_XML = 142             # <<<<<<<<<<<<<<
 * PG_TYPE_PGNODETREE = 194
 * PG_TYPE_POINT = 600
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_XML = 0x8E;

  /* "minipg/minipg.py":73
 * PG_TYPE_JSON = 114
 * PG_TYPE_XML = 142
 * PG_TYPE_PGNODETREE = 194             # <<<<<<<<<<<<<<
 * PG_TYPE_POINT = 600
 * PG_TYPE_LSEG = 601
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_PGNODETREE = 0xC2;

  /* "minipg/minipg.py":74
 * PG_TYPE_XML = 142
 * PG_TYPE_PGNODETREE = 194
 * PG_TYPE_POINT = 600             # <<<<<<<<<<<<<<
 * PG_TYPE_LSEG = 601
 * PG_TYPE_PATH = 602
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_POINT = 0x258;

  /* "minipg/minipg.py":75
 * PG_TYPE_PGNODETREE = 194
 * PG_TYPE_POINT = 600
 * PG_TYPE_LSEG = 601             # <<<<<<<<<<<<<<
 * PG_TYPE_PATH = 602
 * PG_TYPE_BOX = 603
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_LSEG = 0x259;

  /* "minipg/minipg.py":76
 * PG_TYPE_POINT = 600
 * PG_TYPE_LSEG = 601
 * PG_TYPE_PATH = 602             # <<<<<<<<<<<<<<
 * PG_TYPE_BOX = 603
 * PG_TYPE_POLYGON = 604
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_PATH = 0x25A;

  /* "minipg/minipg.py":77
 * PG_TYPE_LSEG = 601
 * PG_TYPE_PATH = 602
 * PG_TYPE_BOX = 603             # <<<<<<<<<<<<<<
 * PG_TYPE_POLYGON = 604
 * PG_TYPE_LINE = 628
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_BOX = 0x25B;

  /* "minipg/minipg.py":78
 * PG_TYPE_PATH = 602
 * PG_TYPE_BOX = 603
 * PG_TYPE_POLYGON = 604             # <<<<<<<<<<<<<<
 * PG_TYPE_LINE = 628
 * PG_TYPE_FLOAT4 = 700
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_POLYGON = 0x25C;

  /* "minipg/minipg.py":79
 * PG_TYPE_BOX = 603
 * PG_TYPE_POLYGON = 604
 * PG_TYPE_LINE = 628             # <<<<<<<<<<<<<<
 * PG_TYPE_FLOAT4 = 700
 * PG_TYPE_FLOAT8 = 701
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_LINE = 0x274;

  /* "minipg/minipg.py":80
 * PG_TYPE_POLYGON = 604
 * PG_TYPE_LINE = 628
 * PG_TYPE_FLOAT4 = 700             # <<<<<<<<<<<<<<
 * PG_TYPE_FLOAT8 = 701
 * PG_TYPE_ABSTIME = 702
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT4 = 0x2BC;

  /* "minipg/minipg.py":81
 * PG_TYPE_LINE = 628
 * PG_TYPE_FLOAT4 = 700
 * PG_TYPE_FLOAT8 = 701             # <<<<<<<<<<<<<<
 * PG_TYPE_ABSTIME = 702
 * PG_TYPE_RELTIME = 703
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT8 = 0x2BD;

  /* "minipg/minipg.py":82
 * PG_TYPE_FLOAT4 = 700
 * PG_TYPE_FLOAT8 = 701
 * PG_TYPE_ABSTIME = 702             # <<<<<<<<<<<<<<
 * PG_TYPE_RELTIME = 703
 * PG_TYPE_TINTERVAL = 704
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ABSTIME = 0x2BE;

  /* "minipg/minipg.py":83
 * PG_TYPE_FLOAT8 = 701
 * PG_TYPE_ABSTIME = 702
 * PG_TYPE_RELTIME = 703             # <<<<<<<<<<<<<<
 * PG_TYPE_TINTERVAL = 704
 * PG_TYPE_UNKNOWN = 705
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_RELTIME = 0x2BF;

  /* "minipg/minipg.py":84
 * PG_TYPE_ABSTIME = 702
 * PG_TYPE_RELTIME = 703
 * PG_TYPE_TINTERVAL = 704             # <<<<<<<<<<<<<<
 * PG_TYPE_UNKNOWN = 705
 * PG_TYPE_CIRCLE = 718
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TINTERVAL = 0x2C0;

  /* "minipg/minipg.py":85
 * PG_TYPE_RELTIME = 703
 * PG_TYPE_TINTERVAL = 704
 * PG_TYPE_UNKNOWN = 705             # <<<<<<<<<<<<<<
 * PG_TYPE_CIRCLE = 718
 * PG_TYPE_CASH = 790
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_UNKNOWN = 0x2C1;

  /* "minipg/minipg.py":86
 * PG_TYPE_TINTERVAL = 704
 * PG_TYPE_UNKNOWN = 705
 * PG_TYPE_CIRCLE = 718             # <<<<<<<<<<<<<<
 * PG_TYPE_CASH = 790
 * PG_TYPE_MACADDR = 829
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_CIRCLE = 0x2CE;

  /* "minipg/minipg.py":87
 * PG_TYPE_UNKNOWN = 705
 * PG_TYPE_CIRCLE = 718
 * PG_TYPE_CASH = 790             # <<<<<<<<<<<<<<
 * PG_TYPE_MACADDR = 829
 * PG_TYPE_INET = 869
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_CASH = 0x316;

  /* "minipg/minipg.py":88
 * PG_TYPE_CIRCLE = 718
 * PG_TYPE_CASH = 790
 * PG_TYPE_MACADDR = 829             # <<<<<<<<<<<<<<
 * PG_TYPE_INET = 869
 * PG_TYPE_CIDR = 650
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_MACADDR = 0x33D;

  /* "minipg/minipg.py":89
 * PG_TYPE_CASH = 790
 * PG_TYPE_MACADDR = 829
 * PG_TYPE_INET = 869             # <<<<<<<<<<<<<<
 * PG_TYPE_CIDR = 650
 * PG_TYPE_NAMEARRAY = 1003
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INET = 0x365;

  /* "minipg/minipg.py":90
 * PG_TYPE_MACADDR = 829
 * PG_TYPE_INET = 869
 * PG_TYPE_CIDR = 650             # <<<<<<<<<<<<<<
 * PG_TYPE_NAMEARRAY = 1003
 * PG_TYPE_INT2ARRAY = 1005
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_CIDR = 0x28A;

  /* "minipg/minipg.py":91
 * PG_TYPE_INET = 869
 * PG_TYPE_CIDR = 650
 * PG_TYPE_NAMEARRAY = 1003             # <<<<<<<<<<<<<<
 * PG_TYPE_INT2ARRAY = 1005
 * PG_TYPE_INT4ARRAY = 1007
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_NAMEARRAY = 0x3EB;

  /* "minipg/minipg.py":92
 * PG_TYPE_CIDR = 650
 * PG_TYPE_NAMEARRAY = 1003
 * PG_TYPE_INT2ARRAY = 1005             # <<<<<<<<<<<<<<
 * PG_TYPE_INT4ARRAY = 1007
 * PG_TYPE_TEXTARRAY = 1009
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INT2ARRAY = 0x3ED;

  /* "minipg/minipg.py":93
 * PG_TYPE_NAMEARRAY = 1003
 * PG_TYPE_INT2ARRAY = 1005
 * PG_TYPE_INT4ARRAY = 1007             # <<<<<<<<<<<<<<
 * PG_TYPE_TEXTARRAY = 1009
 * PG_TYPE_ARRAYOID = 1028
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INT4ARRAY = 0x3EF;

  /* "minipg/minipg.py":94
 * PG_TYPE_INT2ARRAY = 1005
 * PG_TYPE_INT4ARRAY = 1007
 * PG_TYPE_TEXTARRAY = 1009             # <<<<<<<<<<<<<<
 * PG_TYPE_ARRAYOID = 1028
 * PG_TYPE_FLOAT4ARRAY = 1021
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TEXTARRAY = 0x3F1;

  /* "minipg/minipg.py":95
 * PG_TYPE_INT4ARRAY = 1007
 * PG_TYPE_TEXTARRAY = 1009
 * PG_TYPE_ARRAYOID = 1028             # <<<<<<<<<<<<<<
 * PG_TYPE_FLOAT4ARRAY = 1021
 * PG_TYPE_ACLITEM = 1033
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ARRAYOID = 0x404;

  /* "minipg/minipg.py":96
 * PG_TYPE_TEXTARRAY = 1009
 * PG_TYPE_ARRAYOID = 1028
 * PG_TYPE_FLOAT4ARRAY = 1021             # <<<<<<<<<<<<<<
 * PG_TYPE_ACLITEM = 1033
 * PG_TYPE_CSTRINGARRAY = 1263
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_FLOAT4ARRAY = 0x3FD;

  /* "minipg/minipg.py":97
 * PG_TYPE_ARRAYOID = 1028
 * PG_TYPE_FLOAT4ARRAY = 1021
 * PG_TYPE_ACLITEM = 1033             # <<<<<<<<<<<<<<
 * PG_TYPE_CSTRINGARRAY = 1263
 * PG_TYPE_BPCHAR = 1042
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ACLITEM = 0x409;

  /* "minipg/minipg.py":98
 * PG_TYPE_FLOAT4ARRAY = 1021
 * PG_TYPE_ACLITEM = 1033
 * PG_TYPE_CSTRINGARRAY = 1263             # <<<<<<<<<<<<<<
 * PG_TYPE_BPCHAR = 1042
 * PG_TYPE_VARCHAR = 1043
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_CSTRINGARRAY = 0x4EF;

  /* "minipg/minipg.py":99
 * PG_TYPE_ACLITEM = 1033
 * PG_TYPE_CSTRINGARRAY = 1263
 * PG_TYPE_BPCHAR = 1042             # <<<<<<<<<<<<<<
 * PG_TYPE_VARCHAR = 1043
 * PG_TYPE_DATE = 1082
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_BPCHAR = 0x412;

  /* "minipg/minipg.py":100
 * PG_TYPE_CSTRINGARRAY = 1263
 * PG_TYPE_BPCHAR = 1042
 * PG_TYPE_VARCHAR = 1043             # <<<<<<<<<<<<<<
 * PG_TYPE_DATE = 1082
 * PG_TYPE_TIME = 1083
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_VARCHAR = 0x413;

  /* "minipg/minipg.py":101
 * PG_TYPE_BPCHAR = 1042
 * PG_TYPE_VARCHAR = 1043
 * PG_TYPE_DATE = 1082             # <<<<<<<<<<<<<<
 * PG_TYPE_TIME = 1083
 * PG_TYPE_TIMESTAMP = 1114
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_DATE = 0x43A;

  /* "minipg/minipg.py":102
 * PG_TYPE_VARCHAR = 1043
 * PG_TYPE_DATE = 1082
 * PG_TYPE_TIME = 1083             # <<<<<<<<<<<<<<
 * PG_TYPE_TIMESTAMP = 1114
 * PG_TYPE_TIMESTAMPTZ = 1184
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TIME = 0x43B;

  /* "minipg/minipg.py":103
 * PG_TYPE_DATE = 1082
 * PG_TYPE_TIME = 1083
 * PG_TYPE_TIMESTAMP = 1114             # <<<<<<<<<<<<<<
 * PG_TYPE_TIMESTAMPTZ = 1184
 * PG_TYPE_INTERVAL = 1186
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TIMESTAMP = 0x45A;

  /* "minipg/minipg.py":104
 * PG_TYPE_TIME = 1083
 * PG_TYPE_TIMESTAMP = 1114
 * PG_TYPE_TIMESTAMPTZ = 1184             # <<<<<<<<<<<<<<
 * PG_TYPE_INTERVAL = 1186
 * PG_TYPE_TIMETZ = 1266
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TIMESTAMPTZ = 0x4A0;

  /* "minipg/minipg.py":105
 * PG_TYPE_TIMESTAMP = 1114
 * PG_TYPE_TIMESTAMPTZ = 1184
 * PG_TYPE_INTERVAL = 1186             # <<<<<<<<<<<<<<
 * PG_TYPE_TIMETZ = 1266
 * PG_TYPE_BIT = 1560
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INTERVAL = 0x4A2;

  /* "minipg/minipg.py":106
 * PG_TYPE_TIMESTAMPTZ = 1184
 * PG_TYPE_INTERVAL = 1186
 * PG_TYPE_TIMETZ = 1266             # <<<<<<<<<<<<<<
 * PG_TYPE_BIT = 1560
 * PG_TYPE_VARBIT = 1562
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TIMETZ = 0x4F2;

  /* "minipg/minipg.py":107
 * PG_TYPE_INTERVAL = 1186
 * PG_TYPE_TIMETZ = 1266
 * PG_TYPE_BIT = 1560             # <<<<<<<<<<<<<<
 * PG_TYPE_VARBIT = 1562
 * PG_TYPE_NUMERIC = 1700
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_BIT = 0x618;

  /* "minipg/minipg.py":108
 * PG_TYPE_TIMETZ = 1266
 * PG_TYPE_BIT = 1560
 * PG_TYPE_VARBIT = 1562             # <<<<<<<<<<<<<<
 * PG_TYPE_NUMERIC = 1700
 * PG_TYPE_REFCURSOR = 1790
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_VARBIT = 0x61A;

  /* "minipg/minipg.py":109
 * PG_TYPE_BIT = 1560
 * PG_TYPE_VARBIT = 1562
 * PG_TYPE_NUMERIC = 1700             # <<<<<<<<<<<<<<
 * PG_TYPE_REFCURSOR = 1790
 * PG_TYPE_REGPROCEDURE = 2202
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_NUMERIC = 0x6A4;

  /* "minipg/minipg.py":110
 * PG_TYPE_VARBIT = 1562
 * PG_TYPE_NUMERIC = 1700
 * PG_TYPE_REFCURSOR = 1790             # <<<<<<<<<<<<<<
 * PG_TYPE_REGPROCEDURE = 2202
 * PG_TYPE_REGOPER = 2203
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REFCURSOR = 0x6FE;

  /* "minipg/minipg.py":111
 * PG_TYPE_NUMERIC = 1700
 * PG_TYPE_REFCURSOR = 1790
 * PG_TYPE_REGPROCEDURE = 2202             # <<<<<<<<<<<<<<
 * PG_TYPE_REGOPER = 2203
 * PG_TYPE_REGOPERATOR = 2204
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGPROCEDURE = 0x89A;

  /* "minipg/minipg.py":112
 * PG_TYPE_REFCURSOR = 1790
 * PG_TYPE_REGPROCEDURE = 2202
 * PG_TYPE_REGOPER = 2203             # <<<<<<<<<<<<<<
 * PG_TYPE_REGOPERATOR = 2204
 * PG_TYPE_REGCLASS = 2205
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGOPER = 0x89B;

  /* "minipg/minipg.py":113
 * PG_TYPE_REGPROCEDURE = 2202
 * PG_TYPE_REGOPER = 2203
 * PG_TYPE_REGOPERATOR = 2204             # <<<<<<<<<<<<<<
 * PG_TYPE_REGCLASS = 2205
 * PG_TYPE_REGTYPE = 2206
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGOPERATOR = 0x89C;

  /* "minipg/minipg.py":114
 * PG_TYPE_REGOPER = 2203
 * PG_TYPE_REGOPERATOR = 2204
 * PG_TYPE_REGCLASS = 2205             # <<<<<<<<<<<<<<
 * PG_TYPE_REGTYPE = 2206
 * PG_TYPE_REGTYPEARRAY = 2211
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGCLASS = 0x89D;

  /* "minipg/minipg.py":115
 * PG_TYPE_REGOPERATOR = 2204
 * PG_TYPE_REGCLASS = 2205
 * PG_TYPE_REGTYPE = 2206             # <<<<<<<<<<<<<<
 * PG_TYPE_REGTYPEARRAY = 2211
 * PG_TYPE_UUID = 2950
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGTYPE = 0x89E;

  /* "minipg/minipg.py":116
 * PG_TYPE_REGCLASS = 2205
 * PG_TYPE_REGTYPE = 2206
 * PG_TYPE_REGTYPEARRAY = 2211             # <<<<<<<<<<<<<<
 * PG_TYPE_UUID = 2950
 * PG_TYPE_TSVECTOR = 3614
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGTYPEARRAY = 0x8A3;

  /* "minipg/minipg.py":117
 * PG_TYPE_REGTYPE = 2206
 * PG_TYPE_REGTYPEARRAY = 2211
 * PG_TYPE_UUID = 2950             # <<<<<<<<<<<<<<
 * PG_TYPE_TSVECTOR = 3614
 * PG_TYPE_GTSVECTOR = 3642
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_UUID = 0xB86;

  /* "minipg/minipg.py":118
 * PG_TYPE_REGTYPEARRAY = 2211
 * PG_TYPE_UUID = 2950
 * PG_TYPE_TSVECTOR = 3614             # <<<<<<<<<<<<<<
 * PG_TYPE_GTSVECTOR = 3642
 * PG_TYPE_TSQUERY = 3615
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TSVECTOR = 0xE1E;

  /* "minipg/minipg.py":119
 * PG_TYPE_UUID = 2950
 * PG_TYPE_TSVECTOR = 3614
 * PG_TYPE_GTSVECTOR = 3642             # <<<<<<<<<<<<<<
 * PG_TYPE_TSQUERY = 3615
 * PG_TYPE_REGCONFIG = 3734
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_GTSVECTOR = 0xE3A;

  /* "minipg/minipg.py":120
 * PG_TYPE_TSVECTOR = 3614
 * PG_TYPE_GTSVECTOR = 3642
 * PG_TYPE_TSQUERY = 3615             # <<<<<<<<<<<<<<
 * PG_TYPE_REGCONFIG = 3734
 * PG_TYPE_REGDICTIONARY = 3769
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TSQUERY = 0xE1F;

  /* "minipg/minipg.py":121
 * PG_TYPE_GTSVECTOR = 3642
 * PG_TYPE_TSQUERY = 3615
 * PG_TYPE_REGCONFIG = 3734             # <<<<<<<<<<<<<<
 * PG_TYPE_REGDICTIONARY = 3769
 * PG_TYPE_INT4RANGE = 3904
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGCONFIG = 0xE96;

  /* "minipg/minipg.py":122
 * PG_TYPE_TSQUERY = 3615
 * PG_TYPE_REGCONFIG = 3734
 * PG_TYPE_REGDICTIONARY = 3769             # <<<<<<<<<<<<<<
 * PG_TYPE_INT4RANGE = 3904
 * PG_TYPE_RECORD = 2249
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_REGDICTIONARY = 0xEB9;

  /* "minipg/minipg.py":123
 * PG_TYPE_REGCONFIG = 3734
 * PG_TYPE_REGDICTIONARY = 3769
 * PG_TYPE_INT4RANGE = 3904             # <<<<<<<<<<<<<<
 * PG_TYPE_RECORD = 2249
 * PG_TYPE_RECORDARRAY = 2287
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INT4RANGE = 0xF40;

  /* "minipg/minipg.py":124
 * PG_TYPE_REGDICTIONARY = 3769
 * PG_TYPE_INT4RANGE = 3904
 * PG_TYPE_RECORD = 2249             # <<<<<<<<<<<<<<
 * PG_TYPE_RECORDARRAY = 2287
 * PG_TYPE_CSTRING = 2275
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_RECORD = 0x8C9;

  /* "minipg/minipg.py":125
 * PG_TYPE_INT4RANGE = 3904
 * PG_TYPE_RECORD = 2249
 * PG_TYPE_RECORDARRAY = 2287             # <<<<<<<<<<<<<<
 * PG_TYPE_CSTRING = 2275
 * PG_TYPE_ANY = 2276
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_RECORDARRAY = 0x8EF;

  /* "minipg/minipg.py":126
 * PG_TYPE_RECORD = 2249
 * PG_TYPE_RECORDARRAY = 2287
 * PG_TYPE_CSTRING = 2275             # <<<<<<<<<<<<<<
 * PG_TYPE_ANY = 2276
 * PG_TYPE_ANYARRAY = 2277
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_CSTRING = 0x8E3;

  /* "minipg/minipg.py":127
 * PG_TYPE_RECORDARRAY = 2287
 * PG_TYPE_CSTRING = 2275
 * PG_TYPE_ANY = 2276             # <<<<<<<<<<<<<<
 * PG_TYPE_ANYARRAY = 2277
 * PG_TYPE_VOID = 2278
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ANY = 0x8E4;

  /* "minipg/minipg.py":128
 * PG_TYPE_CSTRING = 2275
 * PG_TYPE_ANY = 2276
 * PG_TYPE_ANYARRAY = 2277             # <<<<<<<<<<<<<<
 * PG_TYPE_VOID = 2278
 * PG_TYPE_TRIGGER = 2279
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ANYARRAY = 0x8E5;

  /* "minipg/minipg.py":129
 * PG_TYPE_ANY = 2276
 * PG_TYPE_ANYARRAY = 2277
 * PG_TYPE_VOID = 2278             # <<<<<<<<<<<<<<
 * PG_TYPE_TRIGGER = 2279
 * PG_TYPE_EVTTRIGGER = 3838
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_VOID = 0x8E6;

  /* "minipg/minipg.py":130
 * PG_TYPE_ANYARRAY = 2277
 * PG_TYPE_VOID = 2278
 * PG_TYPE_TRIGGER = 2279             # <<<<<<<<<<<<<<
 * PG_TYPE_EVTTRIGGER = 3838
 * PG_TYPE_LANGUAGE_HANDLER = 2280
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_TRIGGER = 0x8E7;

  /* "minipg/minipg.py":131
 * PG_TYPE_VOID = 2278
 * PG_TYPE_TRIGGER = 2279
 * PG_TYPE_EVTTRIGGER = 3838             # <<<<<<<<<<<<<<
 * PG_TYPE_LANGUAGE_HANDLER = 2280
 * PG_TYPE_INTERNAL = 2281
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_EVTTRIGGER = 0xEFE;

  /* "minipg/minipg.py":132
 * PG_TYPE_TRIGGER = 2279
 * PG_TYPE_EVTTRIGGER = 3838
 * PG_TYPE_LANGUAGE_HANDLER = 2280             # <<<<<<<<<<<<<<
 * PG_TYPE_INTERNAL = 2281
 * PG_TYPE_OPAQUE = 2282
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_LANGUAGE_HANDLER = 0x8E8;

  /* "minipg/minipg.py":133
 * PG_TYPE_EVTTRIGGER = 3838
 * PG_TYPE_LANGUAGE_HANDLER = 2280
 * PG_TYPE_INTERNAL = 2281             # <<<<<<<<<<<<<<
 * PG_TYPE_OPAQUE = 2282
 * PG_TYPE_ANYELEMENT = 2283
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_INTERNAL = 0x8E9;

  /* "minipg/minipg.py":134
 * PG_TYPE_LANGUAGE_HANDLER = 2280
 * PG_TYPE_INTERNAL = 2281
 * PG_TYPE_OPAQUE = 2282             # <<<<<<<<<<<<<<
 * PG_TYPE_ANYELEMENT = 2283
 * PG_TYPE_ANYNONARRAY = 2776
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_OPAQUE = 0x8EA;

  /* "minipg/minipg.py":135
 * PG_TYPE_INTERNAL = 2281
 * PG_TYPE_OPAQUE = 2282
 * PG_TYPE_ANYELEMENT = 2283             # <<<<<<<<<<<<<<
 * PG_TYPE_ANYNONARRAY = 2776
 * PG_TYPE_ANYENUM = 3500
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ANYELEMENT = 0x8EB;

  /* "minipg/minipg.py":136
 * PG_TYPE_OPAQUE = 2282
 * PG_TYPE_ANYELEMENT = 2283
 * PG_TYPE_ANYNONARRAY = 2776             # <<<<<<<<<<<<<<
 * PG_TYPE_ANYENUM = 3500
 * PG_TYPE_FDW_HANDLER = 3115
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ANYNONARRAY = 0xAD8;

  /* "minipg/minipg.py":137
 * PG_TYPE_ANYELEMENT = 2283
 * PG_TYPE_ANYNONARRAY = 2776
 * PG_TYPE_ANYENUM = 3500             # <<<<<<<<<<<<<<
 * PG_TYPE_FDW_HANDLER = 3115
 * PG_TYPE_ANYRANGE = 3831
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ANYENUM = 0xDAC;

  /* "minipg/minipg.py":138
 * PG_TYPE_ANYNONARRAY = 2776
 * PG_TYPE_ANYENUM = 3500
 * PG_TYPE_FDW_HANDLER = 3115             # <<<<<<<<<<<<<<
 * PG_TYPE_ANYRANGE = 3831
 * 
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_FDW_HANDLER = 0xC2B;

  /* "minipg/minipg.py":139
 * PG_TYPE_ANYENUM = 3500
 * PG_TYPE_FDW_HANDLER = 3115
 * PG_TYPE_ANYRANGE = 3831             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_6minipg_6minipg_PG_TYPE_ANYRANGE = 0xEF7;

  /* "minipg/minipg.py":142
 * 
 * 
 * class UTC(datetime.tzinfo):             # <<<<<<<<<<<<<<
 *     def utcoffset(self, dt):
 *         return datetime.timedelta(0)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tzinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_UTC, __pyx_n_s_UTC, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "minipg/minipg.py":143
 * 
 * class UTC(datetime.tzinfo):
 *     def utcoffset(self, dt):             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(0)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_3UTC_1utcoffset, 0, __pyx_n_s_UTC_utcoffset, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_utcoffset, __pyx_t_5) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "minipg/minipg.py":146
 *         return datetime.timedelta(0)
 * 
 *     def tzname(self, dt):             # <<<<<<<<<<<<<<
 *         return "UTC"
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_3UTC_3tzname, 0, __pyx_n_s_UTC_tzname, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_tzname, __pyx_t_5) < 0) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "minipg/minipg.py":149
 *         return "UTC"
 * 
 *     def dst(self, dt):             # <<<<<<<<<<<<<<
 *         return datetime.timedelta(0)
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_3UTC_5dst, 0, __pyx_n_s_UTC_dst, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_dst, __pyx_t_5) < 0) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "minipg/minipg.py":142
 * 
 * 
 * class UTC(datetime.tzinfo):             # <<<<<<<<<<<<<<
 *     def utcoffset(self, dt):
 *         return datetime.timedelta(0)
 */
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_UTC, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UTC, __pyx_t_5) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":301
 *         return val.to_bytes(4, byteorder='big')
 * 
 * Date = datetime.date             # <<<<<<<<<<<<<<
 * Time = datetime.time
 * TimeDelta = datetime.timedelta
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Date, __pyx_t_1) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":302
 * 
 * Date = datetime.date
 * Time = datetime.time             # <<<<<<<<<<<<<<
 * TimeDelta = datetime.timedelta
 * Timestamp = datetime.datetime
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Time, __pyx_t_2) < 0) __PYX_ERR(0, 302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":303
 * Date = datetime.date
 * Time = datetime.time
 * TimeDelta = datetime.timedelta             # <<<<<<<<<<<<<<
 * Timestamp = datetime.datetime
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TimeDelta, __pyx_t_1) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":304
 * Time = datetime.time
 * TimeDelta = datetime.timedelta
 * Timestamp = datetime.datetime             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Timestamp, __pyx_t_2) < 0) __PYX_ERR(0, 304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":307
 * 
 * 
 * def Binary(b):             # <<<<<<<<<<<<<<
 *     return bytearray(b)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_1Binary, 0, __pyx_n_s_Binary, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Binary, __pyx_t_2) < 0) __PYX_ERR(0, 307, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":311
 * 
 * 
 * class DBAPITypeObject:             # <<<<<<<<<<<<<<
 *     def __init__(self, *values):
 *         self.values = values
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_DBAPITypeObject, __pyx_n_s_DBAPITypeObject, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "minipg/minipg.py":312
 * 
 * class DBAPITypeObject:
 *     def __init__(self, *values):             # <<<<<<<<<<<<<<
 *         self.values = values
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_15DBAPITypeObject_1__init__, 0, __pyx_n_s_DBAPITypeObject___init, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":315
 *         self.values = values
 * 
 *     def __cmp__(self, other):             # <<<<<<<<<<<<<<
 *         if other in self.values:
 *             return 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_15DBAPITypeObject_3__cmp__, 0, __pyx_n_s_DBAPITypeObject___cmp, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_cmp, __pyx_t_1) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":311
 * 
 * 
 * class DBAPITypeObject:             # <<<<<<<<<<<<<<
 *     def __init__(self, *values):
 *         self.values = values
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_DBAPITypeObject, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DBAPITypeObject, __pyx_t_1) < 0) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":324
 * 
 * 
 * STRING = DBAPITypeObject(str)             # <<<<<<<<<<<<<<
 * BINARY = DBAPITypeObject(bytes)
 * NUMBER = DBAPITypeObject(int, decimal.Decimal)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DBAPITypeObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)(&PyString_Type))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)(&PyString_Type))};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)(&PyString_Type))};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_INCREF(((PyObject *)(&PyString_Type)));
      __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)(&PyString_Type)));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":325
 * 
 * STRING = DBAPITypeObject(str)
 * BINARY = DBAPITypeObject(bytes)             # <<<<<<<<<<<<<<
 * NUMBER = DBAPITypeObject(int, decimal.Decimal)
 * DATETIME = DBAPITypeObject(datetime.datetime, datetime.date, datetime.time)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DBAPITypeObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)(&PyBytes_Type))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)(&PyBytes_Type))};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)(&PyBytes_Type))};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
      __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)(&PyBytes_Type)));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY, __pyx_t_2) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":326
 * STRING = DBAPITypeObject(str)
 * BINARY = DBAPITypeObject(bytes)
 * NUMBER = DBAPITypeObject(int, decimal.Decimal)             # <<<<<<<<<<<<<<
 * DATETIME = DBAPITypeObject(datetime.datetime, datetime.date, datetime.time)
 * DATE = DBAPITypeObject(datetime.date)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DBAPITypeObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_3 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_3 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)(&PyInt_Type)), __pyx_t_5};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)(&PyInt_Type)), __pyx_t_5};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_3, ((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_3, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NUMBER, __pyx_t_2) < 0) __PYX_ERR(0, 326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":327
 * BINARY = DBAPITypeObject(bytes)
 * NUMBER = DBAPITypeObject(int, decimal.Decimal)
 * DATETIME = DBAPITypeObject(datetime.datetime, datetime.date, datetime.time)             # <<<<<<<<<<<<<<
 * DATE = DBAPITypeObject(datetime.date)
 * TIME = DBAPITypeObject(datetime.time)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DBAPITypeObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_date); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  __pyx_t_3 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_3 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_5, __pyx_t_4, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_t_5, __pyx_t_4, __pyx_t_7};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(3+__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_3, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_3, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_3, __pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_t_7 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DATETIME, __pyx_t_2) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":328
 * NUMBER = DBAPITypeObject(int, decimal.Decimal)
 * DATETIME = DBAPITypeObject(datetime.datetime, datetime.date, datetime.time)
 * DATE = DBAPITypeObject(datetime.date)             # <<<<<<<<<<<<<<
 * TIME = DBAPITypeObject(datetime.time)
 * ROWID = DBAPITypeObject()
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DBAPITypeObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DATE, __pyx_t_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":329
 * DATETIME = DBAPITypeObject(datetime.datetime, datetime.date, datetime.time)
 * DATE = DBAPITypeObject(datetime.date)
 * TIME = DBAPITypeObject(datetime.time)             # <<<<<<<<<<<<<<
 * ROWID = DBAPITypeObject()
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DBAPITypeObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIME, __pyx_t_2) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":330
 * DATE = DBAPITypeObject(datetime.date)
 * TIME = DBAPITypeObject(datetime.time)
 * ROWID = DBAPITypeObject()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DBAPITypeObject); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_8) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ROWID, __pyx_t_2) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":333
 * 
 * 
 * if not PY2:             # <<<<<<<<<<<<<<
 *     StandardError = Exception
 * 
 */
  __pyx_t_9 = ((!(__pyx_v_6minipg_6minipg_PY2 != 0)) != 0);
  if (__pyx_t_9) {

    /* "minipg/minipg.py":334
 * 
 * if not PY2:
 *     StandardError = Exception             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_StandardError, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))) < 0) __PYX_ERR(0, 334, __pyx_L1_error)

    /* "minipg/minipg.py":333
 * 
 * 
 * if not PY2:             # <<<<<<<<<<<<<<
 *     StandardError = Exception
 * 
 */
  }

  /* "minipg/minipg.py":337
 * 
 * 
 * class Error(StandardError):             # <<<<<<<<<<<<<<
 *     def __init__(self, *args):
 *         if len(args) > 0:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_StandardError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "minipg/minipg.py":338
 * 
 * class Error(StandardError):
 *     def __init__(self, *args):             # <<<<<<<<<<<<<<
 *         if len(args) > 0:
 *             self.message = args[0]
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_5Error_1__init__, 0, __pyx_n_s_Error___init, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":345
 *         super(Error, self).__init__(*args)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.message
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_5Error_3__str__, 0, __pyx_n_s_Error___str, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_str, __pyx_t_7) < 0) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":348
 *         return self.message
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.message
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_5Error_5__repr__, 0, __pyx_n_s_Error___repr, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":337
 * 
 * 
 * class Error(StandardError):             # <<<<<<<<<<<<<<
 *     def __init__(self, *args):
 *         if len(args) > 0:
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Error, __pyx_t_1, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_7) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":352
 * 
 * 
 * class Warning(StandardError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_StandardError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Warning, __pyx_n_s_Warning, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Warning, __pyx_t_2, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Warning, __pyx_t_7) < 0) __PYX_ERR(0, 352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":356
 * 
 * 
 * class InterfaceError(Error):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_InterfaceError, __pyx_n_s_InterfaceError, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_InterfaceError, __pyx_t_1, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceError, __pyx_t_7) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":360
 * 
 * 
 * class DatabaseError(Error):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_DatabaseError, __pyx_n_s_DatabaseError, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_DatabaseError, __pyx_t_2, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatabaseError, __pyx_t_7) < 0) __PYX_ERR(0, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":364
 * 
 * 
 * class DisconnectByPeer(Warning):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Warning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_DisconnectByPeer, __pyx_n_s_DisconnectByPeer, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_DisconnectByPeer, __pyx_t_1, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DisconnectByPeer, __pyx_t_7) < 0) __PYX_ERR(0, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":368
 * 
 * 
 * class InternalError(DatabaseError):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         DatabaseError.__init__(self, 'InternalError')
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_InternalError, __pyx_n_s_InternalError, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "minipg/minipg.py":369
 * 
 * class InternalError(DatabaseError):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         DatabaseError.__init__(self, 'InternalError')
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_13InternalError_1__init__, 0, __pyx_n_s_InternalError___init, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":368
 * 
 * 
 * class InternalError(DatabaseError):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         DatabaseError.__init__(self, 'InternalError')
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_InternalError, __pyx_t_2, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InternalError, __pyx_t_7) < 0) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":373
 * 
 * 
 * class OperationalError(DatabaseError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_OperationalError, __pyx_n_s_OperationalError, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OperationalError, __pyx_t_1, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OperationalError, __pyx_t_7) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":377
 * 
 * 
 * class ProgrammingError(DatabaseError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ProgrammingError, __pyx_n_s_ProgrammingError, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ProgrammingError, __pyx_t_2, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ProgrammingError, __pyx_t_7) < 0) __PYX_ERR(0, 377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":381
 * 
 * 
 * class IntegrityError(DatabaseError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_IntegrityError, __pyx_n_s_IntegrityError, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_IntegrityError, __pyx_t_1, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntegrityError, __pyx_t_7) < 0) __PYX_ERR(0, 381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":385
 * 
 * 
 * class DataError(DatabaseError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_DataError, __pyx_n_s_DataError, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_DataError, __pyx_t_2, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DataError, __pyx_t_7) < 0) __PYX_ERR(0, 385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "minipg/minipg.py":389
 * 
 * 
 * class NotSupportedError(DatabaseError):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         DatabaseError.__init__(self, 'NotSupportedError')
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_DatabaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_NotSupportedError, __pyx_n_s_NotSupportedError, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "minipg/minipg.py":390
 * 
 * class NotSupportedError(DatabaseError):
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         DatabaseError.__init__(self, 'NotSupportedError')
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_17NotSupportedError_1__init__, 0, __pyx_n_s_NotSupportedError___init, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":389
 * 
 * 
 * class NotSupportedError(DatabaseError):             # <<<<<<<<<<<<<<
 *     def __init__(self):
 *         DatabaseError.__init__(self, 'NotSupportedError')
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_NotSupportedError, __pyx_t_1, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NotSupportedError, __pyx_t_7) < 0) __PYX_ERR(0, 389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":394
 * 
 * 
 * class Cursor(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, connection):
 *         self.connection = connection
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Cursor, __pyx_n_s_Cursor, (PyObject *) NULL, __pyx_n_s_minipg_minipg, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "minipg/minipg.py":395
 * 
 * class Cursor(object):
 *     def __init__(self, connection):             # <<<<<<<<<<<<<<
 *         self.connection = connection
 *         self.description = []
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_1__init__, 0, __pyx_n_s_Cursor___init, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":403
 *         self.query = None
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_3__enter__, 0, __pyx_n_s_Cursor___enter, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_enter, __pyx_t_7) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":406
 *         return self
 * 
 *     def __exit__(self, exc, value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_5__exit__, 0, __pyx_n_s_Cursor___exit, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__115)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_exit, __pyx_t_7) < 0) __PYX_ERR(0, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":409
 *         self.close()
 * 
 *     def callproc(self, procname, args=()):             # <<<<<<<<<<<<<<
 *         raise NotSupportedError()
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_7callproc, 0, __pyx_n_s_Cursor_callproc, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__118);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_callproc, __pyx_t_7) < 0) __PYX_ERR(0, 409, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":412
 *         raise NotSupportedError()
 * 
 *     def nextset(self, procname, args=()):             # <<<<<<<<<<<<<<
 *         raise NotSupportedError()
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_9nextset, 0, __pyx_n_s_Cursor_nextset, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__121);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_nextset, __pyx_t_7) < 0) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":415
 *         raise NotSupportedError()
 * 
 *     def setinputsizes(sizes):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_11setinputsizes, 0, __pyx_n_s_Cursor_setinputsizes, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_setinputsizes, __pyx_t_7) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":418
 *         pass
 * 
 *     def setoutputsize(size, column=None):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_13setoutputsize, 0, __pyx_n_s_Cursor_setoutputsize, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__126);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_setoutputsize, __pyx_t_7) < 0) __PYX_ERR(0, 418, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":421
 *         pass
 * 
 *     def execute(self, query, args=()):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise ProgrammingError(u"08003:Lost connection")
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_15execute, 0, __pyx_n_s_Cursor_execute, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__129);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_execute, __pyx_t_7) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":437
 *         self.connection.execute(query, self)
 * 
 *     def executemany(self, query, seq_of_params):             # <<<<<<<<<<<<<<
 *         rowcount = 0
 *         for params in seq_of_params:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_17executemany, 0, __pyx_n_s_Cursor_executemany, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_executemany, __pyx_t_7) < 0) __PYX_ERR(0, 437, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":444
 *         self._rowcount = rowcount
 * 
 *     def fetchone(self):             # <<<<<<<<<<<<<<
 *         if not self.connection or not self.connection.is_connect():
 *             raise OperationalError(u"08003:Lost connection")
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_19fetchone, 0, __pyx_n_s_Cursor_fetchone, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_fetchone, __pyx_t_7) < 0) __PYX_ERR(0, 444, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":451
 *         return None
 * 
 *     def fetchmany(self, size=1):             # <<<<<<<<<<<<<<
 *         rs = []
 *         for i in range(size):
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_21fetchmany, 0, __pyx_n_s_Cursor_fetchmany, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__136);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_fetchmany, __pyx_t_7) < 0) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":460
 *         return rs
 * 
 *     def fetchall(self):             # <<<<<<<<<<<<<<
 *         r = list(self._rows)
 *         self._rows.clear()
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_23fetchall, 0, __pyx_n_s_Cursor_fetchall, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_fetchall, __pyx_t_7) < 0) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":465
 *         return r
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         self.connection = None
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_25close, 0, __pyx_n_s_Cursor_close, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_close, __pyx_t_7) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":469
 * 
 *     @property
 *     def rowcount(self):             # <<<<<<<<<<<<<<
 *         return self._rowcount
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_27rowcount, 0, __pyx_n_s_Cursor_rowcount, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "minipg/minipg.py":468
 *         self.connection = None
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def rowcount(self):
 *         return self._rowcount
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_rowcount_2, __pyx_t_7) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":473
 * 
 *     @property
 *     def closed(self):             # <<<<<<<<<<<<<<
 *         return self.connection is None or not self.connection.is_connect()
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_29closed, 0, __pyx_n_s_Cursor_closed, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "minipg/minipg.py":472
 *         return self._rowcount
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def closed(self):
 *         return self.connection is None or not self.connection.is_connect()
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_closed, __pyx_t_7) < 0) __PYX_ERR(0, 473, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":476
 *         return self.connection is None or not self.connection.is_connect()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_31__iter__, 0, __pyx_n_s_Cursor___iter, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_iter, __pyx_t_7) < 0) __PYX_ERR(0, 476, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":479
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         r = self.fetchone()
 *         if not r:
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_33__next__, 0, __pyx_n_s_Cursor___next, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_next, __pyx_t_7) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":485
 *         return r
 * 
 *     def next(self):             # <<<<<<<<<<<<<<
 *         return self.__next__()
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_6Cursor_35next, 0, __pyx_n_s_Cursor_next, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyObject_SetItem(__pyx_t_8, __pyx_n_s_next_2, __pyx_t_7) < 0) __PYX_ERR(0, 485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "minipg/minipg.py":394
 * 
 * 
 * class Cursor(object):             # <<<<<<<<<<<<<<
 *     def __init__(self, connection):
 *         self.connection = connection
 */
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Cursor, __pyx_t_1, __pyx_t_8, NULL, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cursor, __pyx_t_7) < 0) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":505
 *         self.encoders = {}
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection___enter, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":508
 *         return self
 * 
 *     def __exit__(self, exc, value, traceback):             # <<<<<<<<<<<<<<
 *         self.close()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection___exit, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(0, 508, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":695
 *         self.process_messages(None)
 * 
 *     def escape_parameter(self, v):             # <<<<<<<<<<<<<<
 *         t = type(v)
 *         func = self.encoders.get(t)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_7escape_parameter, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_escape_parameter, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_escape_parameter, __pyx_t_1) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":736
 *         return self._ready_for_query in b'TE'
 * 
 *     def is_connect(self):             # <<<<<<<<<<<<<<
 *         return bool(self.sock)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_9is_connect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_is_connect, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_is_connect, __pyx_t_1) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":739
 *         return bool(self.sock)
 * 
 *     def cursor(self):             # <<<<<<<<<<<<<<
 *         return Cursor(self)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_11cursor, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_cursor, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_cursor, __pyx_t_1) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":750
 *             self.commit()
 * 
 *     def execute(self, query, obj=None):             # <<<<<<<<<<<<<<
 *         if self._ready_for_query != b'T':
 *             self.begin()
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_13execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_execute, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_execute, __pyx_t_1) < 0) __PYX_ERR(0, 750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":755
 *         self._execute(query, obj)
 * 
 *     def set_autocommit(self, autocommit):             # <<<<<<<<<<<<<<
 *         self.autocommit = autocommit
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_15set_autocommit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_set_autocommit, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_set_autocommit, __pyx_t_1) < 0) __PYX_ERR(0, 755, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":758
 *         self.autocommit = autocommit
 * 
 *     def begin(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('BEGIN')
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_17begin, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_begin, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_begin, __pyx_t_1) < 0) __PYX_ERR(0, 758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":766
 *         self._process_messages(None)
 * 
 *     def commit(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('COMMIT')
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_19commit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_commit, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_commit, __pyx_t_1) < 0) __PYX_ERR(0, 766, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":773
 *             self.process_messages(None)
 * 
 *     def rollback(self):             # <<<<<<<<<<<<<<
 *         if self.sock:
 *             if DEBUG:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_21rollback, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_rollback, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_rollback, __pyx_t_1) < 0) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":780
 *         self.process_messages(None)
 * 
 *     def reopen(self):             # <<<<<<<<<<<<<<
 *         self.close()
 *         self._open()
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_23reopen, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_reopen, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_reopen, __pyx_t_1) < 0) __PYX_ERR(0, 780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":784
 *         self._open()
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if DEBUG:
 *             DEBUG_OUTPUT('Connection::close()')
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_10Connection_25close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Connection_close_2, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6minipg_6minipg_Connection->tp_dict, __pyx_n_s_close, __pyx_t_1) < 0) __PYX_ERR(0, 784, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_6minipg_6minipg_Connection);

  /* "minipg/minipg.py":794
 * 
 * 
 * def connect(host, user, password='', database=None, port=5432, timeout=None, use_ssl=False, tzinfo=None):             # <<<<<<<<<<<<<<
 *     return Connection(user, password, database, host, port, timeout, use_ssl, tzinfo)
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_3connect, 0, __pyx_n_s_connect, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__177);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_connect, __pyx_t_1) < 0) __PYX_ERR(0, 794, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":798
 * 
 * 
 * def output_results(conn, query, with_header=True, separator="\t", null='null', file=sys.stdout):             # <<<<<<<<<<<<<<
 *     def _ustr(c):
 *         if c is None:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_5output_results, 0, __pyx_n_s_output_results, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 798, __pyx_L1_error)
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_file = __pyx_t_8;
  __Pyx_GIVEREF(__pyx_t_8);
  __pyx_t_8 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_6minipg_6minipg_8__defaults__);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_output_results, __pyx_t_1) < 0) __PYX_ERR(0, 798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":822
 * 
 * 
 * def main(file):             # <<<<<<<<<<<<<<
 *     parser = ArgumentParser(description='Execute query and print results.')
 *     parser.add_argument('-H', '--host', default='localhost', metavar='host', type=str, help='host name')
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_6minipg_6minipg_7main, 0, __pyx_n_s_main_2, NULL, __pyx_n_s_minipg_minipg, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_main_2, __pyx_t_1) < 0) __PYX_ERR(0, 822, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "minipg/minipg.py":846
 *     conn.commit()
 * 
 * if __name__ == '__main__':             # <<<<<<<<<<<<<<
 *     main(sys.stdout)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_9) {

    /* "minipg/minipg.py":847
 * 
 * if __name__ == '__main__':
 *     main(sys.stdout)             # <<<<<<<<<<<<<<
 */
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_main_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
        PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 847, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "minipg/minipg.py":846
 *     conn.commit()
 * 
 * if __name__ == '__main__':             # <<<<<<<<<<<<<<
 *     main(sys.stdout)
 */
  }

  /* "minipg/minipg.py":1
 * ##############################################################################             # <<<<<<<<<<<<<<
 * #The MIT License (MIT)
 * #
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init minipg.minipg", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init minipg.minipg");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* PyObjectCall */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyErrFetchRestore */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
  static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* RaiseArgTupleInvalid */
  static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
  static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
  static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

/* SliceObject */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* RaiseTooManyValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
  static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
  static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* FetchCommonType */
  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
  static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    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)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__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 (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    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);
}

/* PyCFunctionFastCall */
      #if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
}
#endif  // CYTHON_FAST_PYCCALL

/* PyFunctionFastCall */
      #if CYTHON_FAST_PYCALL
#include "frameobject.h"
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = PyThreadState_GET();
    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 = f->f_localsplus;
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif  // CPython < 3.6
#endif  // CYTHON_FAST_PYCALL

/* PyObjectCallMethO */
      #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
      #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyObjectCallNoArg */
        #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* BytesEquals */
          static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
          static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* GetItemInt */
          static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_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((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyIntBinop */
          #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                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
                    }
                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
                    }
                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
                    }
                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
                    }
                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
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* StringJoin */
          #if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

/* RaiseException */
          #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* UnicodeAsUCS4 */
            static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
   Py_ssize_t length;
   #if CYTHON_PEP393_ENABLED
   length = PyUnicode_GET_LENGTH(x);
   if (likely(length == 1)) {
       return PyUnicode_READ_CHAR(x, 0);
   }
   #else
   length = PyUnicode_GET_SIZE(x);
   if (likely(length == 1)) {
       return PyUnicode_AS_UNICODE(x)[0];
   }
   #if Py_UNICODE_SIZE == 2
   else if (PyUnicode_GET_SIZE(x) == 2) {
       Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
       if (high_val >= 0xD800 && high_val <= 0xDBFF) {
           Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
           if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
               return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
           }
       }
   }
   #endif
   #endif
   PyErr_Format(PyExc_ValueError,
                "only single character unicode strings can be converted to Py_UCS4, "
                "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
   return (Py_UCS4)-1;
}

/* object_ord */
            static long __Pyx__PyObject_Ord(PyObject* c) {
    Py_ssize_t size;
    if (PyBytes_Check(c)) {
        size = PyBytes_GET_SIZE(c);
        if (likely(size == 1)) {
            return (unsigned char) PyBytes_AS_STRING(c)[0];
        }
#if PY_MAJOR_VERSION < 3
    } else if (PyUnicode_Check(c)) {
        return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    } else if (PyByteArray_Check(c)) {
        size = PyByteArray_GET_SIZE(c);
        if (likely(size == 1)) {
            return (unsigned char) PyByteArray_AS_STRING(c)[0];
        }
#endif
    } else {
        PyErr_Format(PyExc_TypeError,
            "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name);
        return (long)(Py_UCS4)-1;
    }
    PyErr_Format(PyExc_TypeError,
        "ord() expected a character, but string of length %zd found", size);
    return (long)(Py_UCS4)-1;
}

/* None */
            static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* SaveResetException */
            #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
            #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    return PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
            #if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
#endif
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* Import */
              static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* 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;
    length = stop - start;
    if (unlikely(length <= 0))
        return PyUnicode_FromUnicode(NULL, 0);
    cstring += start;
    if (decode_func) {
        return decode_func(cstring, length, errors);
    } else {
        return PyUnicode_Decode(cstring, length, encoding, errors);
    }
}

/* SetItemInt */
              static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
                                               CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_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((n >= 0) & (n < PyList_GET_SIZE(o)))) {
            PyObject* old = PyList_GET_ITEM(o, n);
            Py_INCREF(v);
            PyList_SET_ITEM(o, n, v);
            Py_DECREF(old);
            return 1;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_ass_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return -1;
                    PyErr_Clear();
                }
            }
            return m->sq_ass_item(o, i, v);
        }
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
#else
    if (is_list || PySequence_Check(o)) {
#endif
        return PySequence_SetItem(o, i, v);
    }
#endif
    return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}

/* PyObjectCallMethod1 */
                static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto done;
#if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyCFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            args = PyTuple_New(2);
            if (unlikely(!args)) goto done;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
done:
    Py_XDECREF(method);
    return result;
}

/* append */
                static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* SetVTable */
                static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* ImportFrom */
                static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CalculateMetaclass */
                static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
                static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CodeObjectCache */
                static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
                #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
                #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#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
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
                static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
                static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (PY_LONG_LONG) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (PY_LONG_LONG) 0;
                case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, digits[0])
                case 2:
                    if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_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(PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (PY_LONG_LONG) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (PY_LONG_LONG) 0;
                case -1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_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(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_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(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            PY_LONG_LONG val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (PY_LONG_LONG) -1;
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (PY_LONG_LONG) -1;
        val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to PY_LONG_LONG");
    return (PY_LONG_LONG) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to PY_LONG_LONG");
    return (PY_LONG_LONG) -1;
}

/* GetAttr */
                static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#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);
}

/* Globals */
                static PyObject* __Pyx_Globals(void) {
    Py_ssize_t i;
    PyObject *names;
    PyObject *globals = __pyx_d;
    Py_INCREF(globals);
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_ITEM(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = __Pyx_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

/* CIntFromPy */
                static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

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

/* CoroutineBase */
                #include <structmember.h>
#include <frameobject.h>
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);
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __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 (Py_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 (!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!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;
}
#endif
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
    PyObject *retval;
    __Pyx_PyThreadState_declare
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    __Pyx_PyThreadState_assign
    if (value) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(__pyx_tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = __pyx_tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
    if (unlikely(!retval && !PyErr_Occurred())) {
        PyErr_SetNone(PyExc_StopIteration);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Coroutine_SendEx(gen, val);
    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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    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_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(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);
    }
    return __Pyx_Coroutine_MethodReturn(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_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None);
}
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(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    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);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
            goto throw_here;
        }
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
}
static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
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);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    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
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Coroutine_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _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)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    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;
    PyObject_GC_Track(gen);
    return gen;
}

/* 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 */
                    #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 (!abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_VERSION_HEX >= 0x03030000) ?
                        "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;
}

/* 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, 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")},
    {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},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "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 PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Coroutine_del,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
                    static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* VoidPtrExport */
                    static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
    PyObject *d;
    PyObject *cobj = 0;
    d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
    Py_XINCREF(d);
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0)
            goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItem(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* FunctionExport */
                    static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* InitStrings */
                    static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
#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 = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
  #else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
  #endif
#else
  res = PyNumber_Int(x);
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
